@@ -60,13 +60,7 @@ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_ex
6060		return  retval;
6161	}
6262
63- 	v8::Isolate *isolate = obj->ctx ->isolate ;
64- 	v8::Locker locker (isolate);
65- 	v8::Isolate::Scope isolate_scope (isolate);
66- 	v8::HandleScope local_scope (isolate);
67- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
68- 	v8::Context::Scope temp_scope (temp_context);
69- 
63+ 	V8JS_CTX_PROLOGUE_EX (obj->ctx , retval);
7064	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
7165
7266	if  (Z_TYPE_P (member) == IS_STRING && v8obj->IsObject () && !v8obj->IsFunction ())
@@ -126,13 +120,7 @@ static zval *v8js_v8object_read_property(zval *object, zval *member, int type ZE
126120		return  retval;
127121	}
128122
129- 	v8::Isolate *isolate = obj->ctx ->isolate ;
130- 	v8::Locker locker (isolate);
131- 	v8::Isolate::Scope isolate_scope (isolate);
132- 	v8::HandleScope local_scope (isolate);
133- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
134- 	v8::Context::Scope temp_scope (temp_context);
135- 
123+ 	V8JS_CTX_PROLOGUE_EX (obj->ctx , retval);
136124	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
137125
138126	if  (Z_TYPE_P (member) == IS_STRING && v8obj->IsObject () && !v8obj->IsFunction ())
@@ -175,13 +163,7 @@ static void v8js_v8object_write_property(zval *object, zval *member, zval *value
175163		return ;
176164	}
177165
178- 	v8::Isolate *isolate = obj->ctx ->isolate ;
179- 	v8::Locker locker (isolate);
180- 	v8::Isolate::Scope isolate_scope (isolate);
181- 	v8::HandleScope local_scope (isolate);
182- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
183- 	v8::Context::Scope temp_scope (temp_context);
184- 
166+ 	V8JS_CTX_PROLOGUE (obj->ctx );
185167	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
186168
187169	if  (v8obj->IsObject () && !v8obj->IsFunction ()) {
@@ -200,13 +182,7 @@ static void v8js_v8object_unset_property(zval *object, zval *member ZEND_HASH_KE
200182		return ;
201183	}
202184
203- 	v8::Isolate *isolate = obj->ctx ->isolate ;
204- 	v8::Locker locker (isolate);
205- 	v8::Isolate::Scope isolate_scope (isolate);
206- 	v8::HandleScope local_scope (isolate);
207- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
208- 	v8::Context::Scope temp_scope (temp_context);
209- 
185+ 	V8JS_CTX_PROLOGUE (obj->ctx );
210186	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
211187
212188	if  (v8obj->IsObject () && !v8obj->IsFunction ()) {
@@ -245,12 +221,7 @@ static HashTable *v8js_v8object_get_properties(zval *object TSRMLS_DC) /* {{{ */
245221		return  NULL ;
246222	}
247223
248- 	v8::Isolate *isolate = obj->ctx ->isolate ;
249- 	v8::Locker locker (isolate);
250- 	v8::Isolate::Scope isolate_scope (isolate);
251- 	v8::HandleScope local_scope (isolate);
252- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
253- 	v8::Context::Scope temp_scope (temp_context);
224+ 	V8JS_CTX_PROLOGUE_EX (obj->ctx , NULL );
254225	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
255226
256227	if  (v8js_get_properties_hash (v8obj, obj->properties , obj->flags , isolate TSRMLS_CC) == SUCCESS) {
@@ -279,12 +250,7 @@ static zend_function *v8js_v8object_get_method(zval **object_ptr, char *method,
279250		return  NULL ;
280251	}
281252
282- 	v8::Isolate *isolate = obj->ctx ->isolate ;
283- 	v8::Locker locker (isolate);
284- 	v8::Isolate::Scope isolate_scope (isolate);
285- 	v8::HandleScope local_scope (isolate);
286- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
287- 	v8::Context::Scope temp_scope (temp_context);
253+ 	V8JS_CTX_PROLOGUE_EX (obj->ctx , NULL );
288254	v8::Local<v8::String> jsKey = V8JS_STRL (method, method_len);
289255	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
290256
@@ -378,12 +344,7 @@ static int v8js_v8object_get_closure(zval *object, zend_class_entry **ce_ptr, ze
378344		return  FAILURE;
379345	}
380346
381- 	v8::Isolate *isolate = obj->ctx ->isolate ;
382- 	v8::Locker locker (isolate);
383- 	v8::Isolate::Scope isolate_scope (isolate);
384- 	v8::HandleScope local_scope (isolate);
385- 	v8::Local<v8::Context> temp_context = v8::Context::New (isolate);
386- 	v8::Context::Scope temp_scope (temp_context);
347+ 	V8JS_CTX_PROLOGUE_EX (obj->ctx , FAILURE);
387348	v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New (isolate, obj->v8obj );
388349
389350	if  (!v8obj->IsFunction ()) {
0 commit comments