0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-14 07:18:40 +00:00
Commit Graph

154 Commits

Author SHA1 Message Date
Stefan Siegl
53b8ac759f Merge pull request #200 from stesie/generator-passing
Generator passing from JavaScript to PHP
2016-01-09 13:20: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
1dfddbe060 Bump version to 1.1.0 2016-01-08 09:01:34 +01:00
Stefan Siegl
bd442beffd Bump version to 0.4.1 2016-01-08 08:25:53 +01:00
Stefan Siegl
38b9c053a1 Enable V8Generator support on V8 >= 3.30.0 2016-01-08 00:12:06 +01:00
Stefan Siegl
c2a2cc341f Initialize libv8_platform for Windows as well
V8 doesn't work without libplatform anymore, even under
Windows.

Furthermore adapted two tests to \r\n vs. \n line
ending differences
2016-01-06 11:58:40 +00:00
Stefan Siegl
98205461be Reorder includes for Visual Studio 2015, closes #194
C++ headers need to go first, since PHP headers redefine
"inline" which causes trouble with the C++ header files.
2016-01-06 09:01:35 +00:00
Stefan Siegl
d9e4ae5abe Bump version to 0.4.0 2015-12-07 13:26:44 +01:00
Stefan Siegl
09ac23c5a3 Bump version to 1.0.0 2015-12-04 21:07:47 +01:00
Stefan Siegl
059e0500fb Merge remote-tracking branch 'origin/master' into php7 2015-11-29 12:21:40 +01:00
Stefan Siegl
b29bb886bb Bump version to 0.3.0 2015-10-11 22:00:33 +02:00
Stefan Siegl
3085db6aeb Merge remote-tracking branch 'origin/master' into php7 2015-10-11 19:51:59 +02: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
5cba44ccd0 Merge remote-tracking branch 'origin/master' into php7
Conflicts:
	README.md
	v8js.cc
	v8js_class.cc
	v8js_exceptions.cc
	v8js_object_export.cc
	v8js_v8.cc
	v8js_v8object_class.cc
2015-10-11 02:09:59 +02:00
Stefan Siegl
c6136ec3d2 Fix globals ptr passing wrt. timer thread 2015-09-28 22:03:24 +02:00
Stefan Siegl
74440ed9f7 Move V8JSG extensions and v8_flags to process globals 2015-09-26 21:39:26 +02:00
Stefan Siegl
7d97c97d4c Fix multi-threading, initialize V8 only once 2015-09-26 18:58:12 +02:00
Stefan Siegl
8c623e362b Bump version to 0.2.6 2015-09-26 12:32:21 +02:00
Stefan Siegl
fb0270d8ec Bump version to 0.2.5 2015-09-23 20:11:15 +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
8934db6dec Add v8js.compat_php_exceptions INI switch 2015-09-23 19:19:11 +02:00
Stefan Siegl
aa0b5fd598 Bump version to 0.2.4 2015-09-01 17:18:12 +02:00
Stefan Siegl
fd6eeddc52 Adapt to PHP7 2015-08-29 17:48:26 +02:00
Stefan Siegl
31d1feb7da Bump PHP_V8JS_VERSION #define as well. 2015-08-27 16:25:59 +02:00
Stefan Siegl
de0931a90b Bump version to 0.2.2 2015-08-26 11:19:26 +02:00
Stefan Siegl
b8c9badddb Adapt v8js_class.cc to PHP7 API 2015-08-25 23:38:09 +02:00
Stefan Siegl
5acc64610d Adapt v8js_array_access.cc to PHP7 API 2015-08-24 20:43:24 +02:00
Stefan Siegl
462eb623b3 Allow PHP exception to JS propagation 2015-08-22 15:16:02 +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
4650273c90 Shutdown V8 on GSHUTDOWN 2015-08-02 19:42:03 +02:00
Stefan Siegl
8c5716f502 Bump version to 0.2.1 2015-07-26 00:07:58 +02:00
Stefan Siegl
555f7aa30f Bump version to 0.2.0 2015-03-13 16:33:57 +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
5b4aaa64f1 More php_v8js_ prefix cleanup 2014-12-13 01:37:25 +01:00
Stefan Siegl
294a5c8d1f php_v8js_create_v8 -> v8js_v8object_create 2014-12-13 01:21:02 +01:00
Stefan Siegl
2954de2db5 Remove php_ prefix to struct & type names 2014-12-13 01:18:42 +01:00
Stefan Siegl
3efec8d428 Remove CVS $Id$ comment lines 2014-12-13 00:45:05 +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
6869d318b3 Rename V8Object stuff to v8js_v8object_XXX 2014-12-13 00:28:09 +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
Stefan Siegl
2b4750748e Merge branch 'array-access'
Conflicts:
	v8js_convert.cc
2014-12-10 20:02:33 +01:00
Stefan Siegl
a2a9c30a11 Use zend_try/zend_catch to unwind v8 stack 2014-12-09 23:56:46 +00:00
Stefan Siegl
ab6df6f14f Use std::deque for timer_stack
In order to update limits at runtime we need the stack to be iterable.
2014-12-07 15:54:37 +01:00
Stefan Siegl
3a1f3e5237 Add setMemoryLimit & setTimeLimit setter methods 2014-12-07 13:25:52 +01:00
Stefan Siegl
f1dd5ad23b Add basic ArrayAccess wrapping 2014-11-23 23:39:15 +01:00
Stefan Siegl
0fed780320 Fall back to arbitrary PATH_MAX upper bound 2014-11-13 00:36:52 +01:00
Stefan Siegl
ad09ee0993 Undefine COMPILER symbol 2014-11-12 23:17:02 +00:00
Stefan Siegl
c339d51924 Drop old-age PHP_V8_API_VERSION #ifdef 2014-10-19 12:20:10 +00:00
Stefan Siegl
f6310f9994 Get rid of V8JS_NEW macro. 2014-10-19 11:58:21 +00:00
Stefan Siegl
c91f96a439 Merge pull request #108 from stesie/fix-commonjs-module-reuse
Fix module caching, closes #107
2014-09-20 15:05:31 +02:00
Stefan Siegl
eda74908cc Fix module caching, closes #107
Use v8::Persistent handle to keep module instances around.

Objects cannot be shared between isolates anyhow, hence moved
modules_loaded map from global V8JSG structure to php_v8js_ctx.

Besides fixes a use-after-free on normalised_module_id.
2014-09-19 22:36:27 +00:00
Taneli Leppa
200c16c30e Fixed script destructor and free resource struct when done. 2014-09-16 17:11:13 +03:00
Taneli Leppa
bd7d649d90 Added new functions V8Js::compileString() and V8Js::executeScript().
Conflicts:

	php_v8js_macros.h
2014-09-16 17:09:58 +03:00
Stefan Siegl
ebcb6dc211 Keep track of V8Object/V8Function instances
Disallow access to these once the V8Js object has been destroyed.
2014-08-11 03:11:02 +02:00
Stefan Siegl
a72a180596 Keep a list of disposed isolates and make sure not to use disposed isolates. 2014-08-10 23:48:54 +02:00
Taneli Leppa
cbda704d7e Only pass fatal errors to the V8JS error handler, others go to PHP's error handler. 2014-05-22 11:17:38 +03:00
Karl G
2b61b9d1be Fix V8JS_VERSION to match package.xml (0.1.5) 2014-04-23 14:49:39 +02:00
Stefan Siegl
35d8b815f8 Store error message and re-throw with original type & message 2014-04-13 21:46:31 +02:00
Stefan Siegl
dfd8a1f386 Use V8JSG instead of global variable. 2014-04-12 09:22:58 +02:00
Stefan Siegl
a49fa8ce02 Unwind V8 execution context on fatal error, refs #87
This is yet a first hack to prove applicability.  Currently
unwind environment is held in a global variable, i.e. solution
is neither thread safe nor reentrant yet.
2014-04-12 00:02:43 +02:00
Stefan Siegl
0355a95c78 Fix strdup+getenv behaviour; multi api version support, closes #86 2014-03-22 19:09:53 +01:00
Stefan Siegl
ddbef50ea6 Merge remote-tracking branch 'rosmo/master' 2014-03-22 18:44:13 +01:00
Stefan Siegl
bc86ce9e44 Clear persistent cells with weak references correctly, refs #88 2014-03-22 17:41:00 +01:00
Stefan Siegl
4c64bc4ad9 Make compatible with V8 3.24.10, fixes #83 2014-03-22 00:07:53 +01:00
Taneli Leppa
da53c90f88 Added new "v8js.use_date" ini setting to convert PHP DateTime objects to Javascript Date objects
when set as V8JS object properties.
2014-03-20 16:06:18 +02:00
Taneli Leppa
0a85d27ee7 V8 needs to be notified when timezone changes. Keep track of timezone changes and notify it.
Also added a test.
2014-03-20 11:20:59 +02:00
Taneli Leppa
52dc41e30e Build fix for GCC 4.4 (eg. el6). 2014-03-19 16:24:24 +02:00
Stefan Siegl
1e773dd4a8 Make compatible with V8 3.23.8 (and below) 2013-12-21 20:54:55 +01:00
Stefan Siegl
e20e5098c7 Make compatible with V8 3.23.11 (and below) 2013-12-21 19:56:28 +01:00
Stefan Siegl
69290b5779 Fix build against libv8 3.24.5 2013-12-21 01:18:08 +01:00
C. Scott Ananian
24257b54af Free php_v8js_accessor_ctx when we are done with it. 2013-10-27 02:49:24 -04:00
C. Scott Ananian
3f77a5a356 Make PHP object accessors typesafe using V8::AccessorSignature.
This ensures that if you copy the accessor to another object you can't
trigger a segfault.
2013-10-27 02:49:24 -04:00
C. Scott Ananian
57348c5f7d Fix double-pop of timer_ctx (and efree from wrong thread).
The timer_ctx was being popped & freed in terminate_execution, from the
timer thread (not the main thread), and then popped again in the main
thread when execution was aborted.  Do all pop/free work in main thread.
Also, remember to pop the timer_ctx when just a memory limit is set.
2013-10-27 02:48:52 -04:00
C. Scott Ananian
dba6322812 Fix memory leak: The get_properties handler owns the returned hashtable. 2013-10-26 23:14:39 -04:00
Stefan Siegl
18b129b128 Trigger garbage collection within Isolate::Scope
Before the idle notifications to V8 were sent without a special
Isolate entered, which results in V8 using it's default isolate
(which we don't use at all).  Hence those were pretty useless
anyways (if they were called, which was unlikely).

Besides V8 seems to not trigger the weak object callbacks if
the isolate is destroyed, hence the PHP objects we add-ref'ed
before will leak.

Therefore this removes the previous idle notification logic
and forces garbage collection from the V8Js object destructor.
2013-10-27 00:41:47 +02:00
C. Scott Ananian
39cc821f91 Store tsrm_ls in php_v8js_ctx.
This avoids the need to ever do a (slow) TSRMLS_FETCH().
2013-10-26 02:07:12 -04:00
C. Scott Ananian
303f3f52b5 Refactor template cache into php_v8js_ctx.
Reduce map lookups by adding internal object field pointing to function
template.  Use hidden field to allow easy unwrapping of PHP objects.
2013-10-25 17:40:51 -04:00
C. Scott Ananian
c341511b36 PHP 5.3 compatibility fixes. 2013-10-25 17:40:51 -04:00
C. Scott Ananian
52d8946b89 Add isolate parameter to V8JS_* macros.
This avoids unnecessary calls to Isolate::GetCurrent() in the implementation.
By standardizing on the V8JS_SYM and V8JS_STR macros we also standardize on
UTF-8 encoding for v8 strings.
2013-10-25 16:46:07 -04:00
C. Scott Ananian
49632054a4 Cleanup: remove some warnings when compiled with -Wunused 2013-10-25 14:17:40 -04:00
Stefan Siegl
61eee4cbd6 TSRM/ZTS fixes. 2013-10-19 23:04:35 +00:00
Anatol Belski
c0290d4a17 fix version macros name 2013-10-15 17:42:02 +02:00
Stefan Siegl
d69f2be50a Add v8 debug support 2013-10-13 11:36:57 +02:00
Stefan Siegl
662e491e1f Pass back v8 functions, don't re-wrap 2013-10-03 00:34:50 +02:00
Patrick Reilly
dc1475a3ad updated package for beta release and switch license to MIT 2013-09-28 10:17:33 -07:00
Stefan Siegl
286b0d8ac0 Handle non-construct call 2013-07-12 20:23:12 +02:00
Stefan Siegl
ffa42cdfaf Replaced deprecated v8 api calls with newer equivalents 2013-07-08 00:58:19 +02:00
Patrick Reilly
4a82311b4d fix mutex issue and c++11 support on Ubuntu — remove stray EOL marker 2013-05-15 12:21:38 -07:00
Patrick Reilly
6f44220328 fix merge conflict 2013-05-09 15:55:30 -07:00
Patrick Reilly
713d4119da Merge branch master of github.com:preillyme/v8js 2013-05-09 09:17:39 -07:00
Simon Best
8d8c671aa0 V8 isolates need to be passed into all variable accessor and conversion functions. 2013-04-14 00:36:05 +01:00
Simon Best
8ae7606338 Refactor CommonJS modules functionality to store state in the extension globals and context as appropriate. 2013-04-13 00:00:27 +01:00
Simon Best
93df3411d9 Merged CommonJS modules functionality. 2013-04-11 17:15:55 +01:00
Simon Best
84baa7614a First working version of CommonJS modules. 2013-03-24 16:27:13 +00:00
Patrick Reilly
dfbd5f0c0c Fixed build in 5.4+ 2012-07-06 17:12:53 -07:00
Felipe Pena
7c8c24ab72 - Fix version 2012-06-13 02:41:36 +00:00
Felipe Pena
325b54d9d5 - Preparing release 2012-06-13 02:39:29 +00:00
Felipe Pena
39ac2f2304 - Fixed build in 5.4+
- Fixed bug #59553 (can't build due to missing class member)
2012-06-13 02:24:48 +00:00
Patrick Reilly
7593cbcc59 Update copyright information 2012-04-27 16:41:32 +00:00