0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-23 16:11:53 +00:00
Commit Graph

767 Commits

Author SHA1 Message Date
Stefan Siegl
204cc0fa6a Merge pull request #151 from stesie/mem-leaks-001
Memory Leak Fixes
2015-08-03 08:40:20 +02:00
Stefan Siegl
0deb7d1802 Track list of valid script object in ctx
We don't know whether the V8Js object dtor or the script (resource)
dtor is called first.  Nevertheless they depend on each other as
we must not simply Reset the persistent v8::Script if the v8::Isolate
was disposed before.

Now the V8Js dtor iterates over all script resources and resets the
persistent v8::Script instances; leaving an invalidated resource
object (which cannot be called anymore).
2015-08-02 23:35:47 +02:00
Stefan Siegl
cb7a1b8d6a Dispose persisted v8::Script object on resource dtor (memory leak) 2015-08-02 22:36:23 +02:00
Stefan Siegl
1f56c8e43c Don't only run dtor, really delete the object 2015-08-02 21:26:18 +02:00
Stefan Siegl
981f502303 ignore run-tests.php valgrind result files 2015-08-02 19:43:58 +02:00
Stefan Siegl
dd4996cd56 delete v8::Extension instance on shutdown 2015-08-02 19:42:42 +02:00
Stefan Siegl
4650273c90 Shutdown V8 on GSHUTDOWN 2015-08-02 19:42:03 +02:00
Stefan Siegl
5018192123 Move libplatform.h include farther down
If it is included before php.h, PHP_V8_API_VERSION is not
defined if V8Js is built as a PHP built-in extension.
2015-08-02 18:15:28 +02:00
Stefan Siegl
6bbe4d932b remove useless zero-initializations (immediately overridden afterwards) 2015-08-01 19:58:44 +02:00
Stefan Siegl
441f7b7fab v8js_commonjs_split_terms: use pointer comparison instead of strlen
The strlen usage on term obviously was wrong here, since the term
string is not null-terminated at that place.
2015-08-01 19:54:23 +02:00
Stefan Siegl
cedcac1318 skip useless estrdup/efree cycle
The garbage collector cannot free the object as it is allocated
on the local stack.
2015-08-01 19:45:21 +02:00
Stefan Siegl
f61c11f995 declare base & identifier const 2015-08-01 19:41:50 +02:00
Stefan Siegl
ea3ec4bd65 Fix commonjs memory leaks (and increase test coverage to 100%) 2015-08-01 19:30:55 +02:00
Stefan Siegl
bfc6b29989 Use emalloc/estrdup/efree in v8js_commonjs.cc + fix memory leak 2015-08-01 19:07:45 +02:00
Stefan Siegl
3324490a79 test issue_127_001.phpt doesn't depend on ext_json 2015-08-01 18:47:44 +02:00
Stefan Siegl
2ce7e420a7 Fix use-after-free on module reuse 2015-08-01 18:11:39 +02:00
Stefan Siegl
d8e239a756 test per isolate module cache seperation 2015-08-01 17:57:57 +02:00
Stefan Siegl
3d89f0250d Provide key compare function for modules_loaded
Without the compare function std::map simply compares one
pointer to another.  However we need to compare the actual
strings.

Besides we must not efree normalised_module_id on return
of require method, since the pointer was added to
modules_loaded (and is valid until destruction of V8Js
class); instead it is now freed during V8Js object destruction.
2015-08-01 17:49:11 +02:00
Stefan Siegl
754d398ec9 Move v8js_commonjs.cc forward declarations in .h file 2015-08-01 17:09:48 +02:00
Stefan Siegl
8c5716f502 Bump version to 0.2.1 2015-07-26 00:07:58 +02:00
Stefan Siegl
3fff469174 Remove stray V8JS_DEBUG define
Currently it just enables RSHUTDOWN code that should print
memory usage statistics. However the code implements API calls
that aren't supported anymore (for a long time).
2015-07-25 23:40:50 +02:00
Stefan Siegl
b30ee1e09b auto-add CXXFLAG -Wno-c++11-narrowing if possible 2015-07-25 21:36:34 +02:00
Stefan Siegl
cdcfb973a7 Merge pull request #148 from stesie/test-fail-old-v8
skip extensions_error test for v8 version < 3.30
2015-07-25 20:48:25 +02:00
Stefan Siegl
f6eacd59d0 Merge pull request #147 from stesie/issue-135
Enter endless loop after V8::TerminateExecution call, fixes #135
2015-07-25 20:43:38 +02:00
Stefan Siegl
34242c5d60 skip extensions_error test for v8 version < 3.30 2015-07-25 18:16:04 +02:00
Stefan Siegl
72cb2da9ba Enter endless loop after V8::TerminateExecution call, fixes #135
The V8::TerminateExecution does *not* immediately terminate execution
as its name might suggest.  It just marks the given isolate as
"to terminate" and the execution thread checks - from time to time -
whether to terminate.  For v8 itself this is not problematic as
the call is thought to stop long-running scripts executed in the
browser context.

As v8js exposes this function to JavaScript with the exit() method,
this behaviour is confusing.  In order to stop code execution right
at the exit() call, v8js enters an endless loop and waits for v8
to terminate execution within it.
2015-07-25 17:42:32 +02:00
Stefan Siegl
eafa458620 Merge pull request #146 from stesie/use-arraybufferallocator
Provide v8::ArrayBufferAllocator as needed
2015-07-25 17:40:06 +02:00
Stefan Siegl
22e90d1c50 Call v8::V8::SetArrayBufferAllocator for v8 4.4.10 & higher 2015-07-25 17:28:08 +02:00
Stefan Siegl
493e448bae Provide ArrayBufferAllocator for v8 4.4.44 (and later) 2015-07-25 16:04:25 +02:00
Stefan Siegl
81018372e4 Adapt test to changed v8 error message
Added a "%s" so both messages are matched:

 * Extension or internal compilation error: MakeReferenceError in handlebars at line 1.
 * Extension or internal compilation error in handlebars at line 1.
2015-07-25 16:01:54 +02:00
Stefan Siegl
e67f1f4c9c Fix handling of failed context creation, closes #136 2015-05-01 11:43:24 +02:00
Stefan Siegl
4d17ba2566 Delete V8JSG(timer_thread) on shutdown, refs #138 2015-04-28 00:31:33 +02:00
Stefan Siegl
79f2056bc3 Properly stop timer thread, closes #138
We need to reset V8JSG(timer_stop) and V8JSG(timer_thread), otherwise
subsequent requests fail on multi-request SAPIs.

If we don't reset those, a subsequent request will not start a new timer
thread (as V8JSG(timer_thread) != NULL), but will try to join the thread
(once more) in GSHUTDOWN as V8JSG(timer_thread) still is non-NULL and
hence cause program termination.
2015-04-28 00:21:00 +02:00
Stefan Siegl
b350871795 Correctly force to array on property writing, closes #137 2015-04-26 13:49:13 +02:00
Stefan Siegl
5c43a471b4 Remove reference to my (deprecated) Jenkins site 2015-03-13 16:35:35 +01:00
Stefan Siegl
555f7aa30f Bump version to 0.2.0 2015-03-13 16:33:57 +01:00
Stefan Siegl
fd10356f62 Remove hard-coded PHP_V8_VERSION symbol 2015-03-13 16:18:12 +01:00
Stefan Siegl
1a85a82289 Add myself to package.xml file as lead (sync to pecl) 2015-03-13 16:15:51 +01:00
Stefan Siegl
3940613858 Update package.xml file manifest
Used "fpm" command; it changed sort order of releases.
Afterwards looked over file type associations.
2015-03-13 16:14:18 +01:00
Stefan Siegl
8923eac4ff Fix typo in package description 2015-03-13 16:05:52 +01:00
Stefan Siegl
0b769df7c0 Import package.xml from last release package 2015-03-13 15:50:34 +01:00
Stefan Siegl
5ec269877a Add cscott and myself 2015-03-13 15:42:28 +01:00
Stefan Siegl
5fb79ee994 Merge remote-tracking branch 'pecl/master'
Merging form pecl/v8js master branch to preillyme/v8js on Github
to get both heads on par.

Conflicts:
	php_v8js_macros.h
2015-03-13 13:59:23 +01:00
Stefan Siegl
3726d233b8 return SUCCESS from PHP_MINIT_FUNCTION 2015-03-12 12:22:01 +01:00
Stefan Siegl
0e76b675d2 Require v8 3.24.6 or higher
Just tested it, v8js builds correctly with 3.24.6 and fails to build
against 3.24.5 due to `RequestInterrupt' being undefined.

Syncing the check in config.m4 (used to test 3.21.12 or newer) against
README.md file (which stated 3.24.10 or newer).
2015-03-11 15:00:01 +01:00
Stefan Siegl
90c3b9db5f Fix debug build; move debug stuff into seperate files 2015-03-11 14:06:21 +01:00
Stefan Siegl
8934e8c078 Add note that RUNPATH might need to be fixed 2015-03-10 15:28:25 +01:00
Stefan Siegl
7b926a3d06 ForceDelete was removed, use normal Delete 2015-03-10 15:09:41 +01:00
Stefan Siegl
ddc6a46049 Set c++ -std version on v8 version test 2015-03-10 14:16:37 +01:00
Stefan Siegl
a9ef3d5d67 Merge pull request #134 from stesie/issue-97
Fix build on MacOS X
2015-03-09 13:53:52 +01:00