0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-09-19 15:25:19 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
Stefan Siegl
930b450d99 refcount on snapshot_blob zval 2016-03-05 17:12:36 +01:00
Stefan Siegl
d0e78019aa Allow snapshot creation & use with V8 > 4.3.7
This does *not* seem to depend on whether V8 itself was compiled
with support for snapshots or not.

Therefore use PHP_V8_USE_EXTERNAL_STARTUP_DATA only to mark
whether we need to provide external snapshot data to V8.
2016-03-05 17:12:36 +01:00
Stefan Siegl
93d3f9591f Add CreateParams fields in v8js_ctx only if needed 2016-02-28 20:17:56 +01:00
Stefan Siegl
b405a34690 Allow to create snapshots and re-use them 2016-02-28 17:00:47 +01:00
Stefan Siegl
67a9de01bd Allow custom module normalisation 2015-12-06 13:55:13 +01:00
Stefan Siegl
83f51e5021 Merge pull request #156 from stesie/php-exception-behaviour
PHP->JS exception propagation
2015-09-23 19:40:23 +02:00
Stefan Siegl
71f4b7ba05 Cache pseudo-Array FunctionTemplate as well 2015-09-01 15:53:21 +02:00
Stefan Siegl
78dd0a9ff0 Cache v8::FunctionTemplates created by v8js_named_property_callback 2015-08-27 14:46:27 +02:00
Stefan Siegl
f7a592052f Store flags in v8js_ctx class instead of v8 hidden value 2015-08-21 16:12:12 +02:00
Stefan Siegl
829bac9ddc Merge pull request #150 from stesie/issue-140
Fix module caching & memory leaks
2015-08-03 08:40:26 +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
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
2954de2db5 Remove php_ prefix to struct & type names 2014-12-13 01:18:42 +01:00
Stefan Siegl
d269809d8b Move types from php_v8js_macros.h to new headers 2014-12-13 00:43:19 +01:00
Stefan Siegl
5ea36016fe code cleanup, part 1
Splits longish v8js.cc file into pieces.  It used to contain the
definitions of all V8Js exception classes, the V8Js class itself as
well as the V8Object/V8Function classes... besides the module setup
code itself.

This change factors out all exception class definitions into a
seperate pair of files (v8js_exceptions.*).

The V8Js class definition itself is moved to v8js_class.* pair,
with the v8 init & call code moved to v8js_v8.* pair
and the watchdog timer to v8js_timer.* pair.

The V8Object/V8Function code was moved to v8js_v8object_class.*
pair, not differentiating between the two like before.
2014-12-13 00:11:02 +01:00