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

35 Commits

Author SHA1 Message Date
Stefan Siegl
12903ca269 add V8Js::setAverageObjectSize method 2016-03-08 09:28:16 +01:00
Stefan Siegl
930b450d99 refcount on snapshot_blob zval 2016-03-05 17:12:36 +01:00
Stefan Siegl
8e3e0c91b5 Add ZEND_ARG_INFO for V8Js::__construct 5th arg: snapshot_blob 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
a1cdd7537b Fix conditional compilation for snapshot=off 2016-02-28 20:29:53 +01:00
Stefan Siegl
2c8ef2aa66 conditionally compile in snapshot functionality 2016-02-28 17:54:00 +01:00
Stefan Siegl
b405a34690 Allow to create snapshots and re-use them 2016-02-28 17:00:47 +01:00
Stefan Siegl
d438624a3d Don't export V8Js methods even if overwritten 2016-01-09 19:11:30 +01:00
Stefan Siegl
1e86e2c9f7 Don't export methods of V8Js object to V8 2016-01-09 19:02:58 +01:00
Stefan Siegl
3508f0c8e7 export public methods of classes derived from \V8Js, closes #183 2016-01-08 15:42:43 +01:00
Stefan Siegl
67a9de01bd Allow custom module normalisation 2015-12-06 13:55:13 +01:00
Stefan Siegl
b38c31b521 Remove v8::Debug agent stuff
Debug Agent support was removed from V8 with 3.28 line which
is pretty old meanwhile.
2015-10-11 19:47:22 +02:00
Stefan Siegl
74440ed9f7 Move V8JSG extensions and v8_flags to process globals 2015-09-26 21:39:26 +02: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
f7c33539c2 Improve PHP->JS->PHP exception back propagation 2015-08-23 15:09:21 +02:00
Stefan Siegl
462eb623b3 Allow PHP exception to JS propagation 2015-08-22 15:16:02 +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
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
dd4996cd56 delete v8::Extension instance on shutdown 2015-08-02 19:42:42 +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
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
e67f1f4c9c Fix handling of failed context creation, closes #136 2015-05-01 11:43:24 +02:00
Stefan Siegl
3726d233b8 return SUCCESS from PHP_MINIT_FUNCTION 2015-03-12 12:22: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
7b926a3d06 ForceDelete was removed, use normal Delete 2015-03-10 15:09:41 +01:00
Stefan Siegl
5b4aaa64f1 More php_v8js_ prefix cleanup 2014-12-13 01:37:25 +01: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
f987cc7b4c Rename php_v8js_objects -> v8js_v8objects
* drop php_ prefix, currently used inconsistently anyways
* change "object" to "v8object" to clarify it's a JS object wrapped
  to a V8Object instance
2014-12-13 00:13:03 +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