From 3e8ef5f6841a3c340951c33d51e01fe6879db783 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sat, 11 Mar 2017 13:43:30 +0100 Subject: [PATCH] remove V8JS_TSRMLS_FETCH --- v8js_array_access.cc | 12 ------------ v8js_class.cc | 1 - v8js_class.h | 10 ---------- v8js_methods.cc | 2 -- v8js_object_export.cc | 7 ------- v8js_variables.cc | 2 -- 6 files changed, 34 deletions(-) diff --git a/v8js_array_access.cc b/v8js_array_access.cc index ea8beb4..cabba33 100644 --- a/v8js_array_access.cc +++ b/v8js_array_access.cc @@ -65,8 +65,6 @@ void v8js_array_access_getter(uint32_t index, const v8::PropertyCallbackInfo self = info.Holder(); - V8JS_TSRMLS_FETCH(); - zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); zval zvalue; @@ -86,8 +84,6 @@ void v8js_array_access_setter(uint32_t index, v8::Local value, v8::Isolate *isolate = info.GetIsolate(); v8::Local self = info.Holder(); - V8JS_TSRMLS_FETCH(); - zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); zval zvalue; @@ -160,8 +156,6 @@ static void v8js_array_access_length(v8::Local property, const v8::P v8::Isolate *isolate = info.GetIsolate(); v8::Local self = info.Holder(); - V8JS_TSRMLS_FETCH(); - zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); int length = v8js_array_access_get_count_result(object); @@ -174,8 +168,6 @@ void v8js_array_access_deleter(uint32_t index, const v8::PropertyCallbackInfo self = info.Holder(); - V8JS_TSRMLS_FETCH(); - zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); zval zvalue; @@ -193,8 +185,6 @@ void v8js_array_access_query(uint32_t index, const v8::PropertyCallbackInfo self = info.Holder(); - V8JS_TSRMLS_FETCH(); - zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); /* If index is set, then return an integer encoding a v8::PropertyAttribute; @@ -211,8 +201,6 @@ void v8js_array_access_enumerator(const v8::PropertyCallbackInfo& inf v8::Isolate *isolate = info.GetIsolate(); v8::Local self = info.Holder(); - V8JS_TSRMLS_FETCH(); - zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); int length = v8js_array_access_get_count_result(object); diff --git a/v8js_class.cc b/v8js_class.cc index e073b66..84730e1 100644 --- a/v8js_class.cc +++ b/v8js_class.cc @@ -213,7 +213,6 @@ static zend_object* v8js_new(zend_class_entry *ce) /* {{{ */ object_properties_init(&c->std, ce); c->std.handlers = &v8js_object_handlers; - TSRMLS_SET_CTX(c->zts_ctx); new(&c->object_name) v8::Persistent(); new(&c->context) v8::Persistent(); diff --git a/v8js_class.h b/v8js_class.h index 46ec8d5..40c647c 100644 --- a/v8js_class.h +++ b/v8js_class.h @@ -74,20 +74,10 @@ struct v8js_ctx { zval zval_snapshot_blob; v8::StartupData snapshot_blob; -#ifdef ZTS - void ***zts_ctx; -#endif - zend_object std; }; /* }}} */ -#ifdef ZTS -# define V8JS_TSRMLS_FETCH() TSRMLS_FETCH_FROM_CTX(((v8js_ctx *) isolate->GetData(0))->zts_ctx); -#else -# define V8JS_TSRMLS_FETCH() -#endif - static inline struct v8js_ctx *v8js_ctx_fetch_object(zend_object *obj) { return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std)); } diff --git a/v8js_methods.cc b/v8js_methods.cc index 9378a39..5b73954 100644 --- a/v8js_methods.cc +++ b/v8js_methods.cc @@ -193,7 +193,6 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local var, int leve V8JS_METHOD(var_dump) /* {{{ */ { v8::Isolate *isolate = info.GetIsolate(); - V8JS_TSRMLS_FETCH(); for (int i = 0; i < info.Length(); i++) { v8js_dumper(isolate, info[i], 1); @@ -206,7 +205,6 @@ V8JS_METHOD(var_dump) /* {{{ */ V8JS_METHOD(require) { v8::Isolate *isolate = info.GetIsolate(); - V8JS_TSRMLS_FETCH(); // Get the extension context v8::Local data = v8::Local::Cast(info.Data()); diff --git a/v8js_object_export.cc b/v8js_object_export.cc index ffc4602..9d3b4ee 100644 --- a/v8js_object_export.cc +++ b/v8js_object_export.cc @@ -191,7 +191,6 @@ void v8js_php_callback(const v8::FunctionCallbackInfo& info) /* {{{ * v8::Isolate *isolate = info.GetIsolate(); v8::Local self = info.Holder(); - V8JS_TSRMLS_FETCH(); zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); zend_function *method_ptr; @@ -243,7 +242,6 @@ static void v8js_construct_callback(const v8::FunctionCallbackInfo& i Z_ADDREF_P(&value); } else { // Object created from JavaScript context. Need to create PHP object first. - V8JS_TSRMLS_FETCH(); zend_class_entry *ce = static_cast(ext_ce->Value()); zend_function *ctor_ptr = ce->constructor; @@ -322,7 +320,6 @@ static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo result = v8::Array::New(isolate, 0); uint32_t result_len = 0; - V8JS_TSRMLS_FETCH(); zend_class_entry *ce; void *ptr; HashTable *proptable; @@ -425,8 +422,6 @@ static void v8js_invoke_callback(const v8::FunctionCallbackInfo& info v8::Local *argv = static_cast *>(alloca(sizeof(v8::Local) * argc)); v8::Local result; - V8JS_TSRMLS_FETCH(); - for (i=0; i; argv[i] = info[i]; @@ -465,7 +460,6 @@ static void v8js_fake_call_impl(const v8::FunctionCallbackInfo& info) char *error; size_t error_len; - V8JS_TSRMLS_FETCH(); zend_class_entry *ce; zend_object *object = reinterpret_cast(self->GetAlignedPointerFromInternalField(1)); ce = object->ce; @@ -590,7 +584,6 @@ v8::Local v8js_named_property_callback(v8::Local property v8::Local ret_value; v8::Local cb; - V8JS_TSRMLS_FETCH(); zend_class_entry *scope, *ce; zend_function *method_ptr = NULL; zval php_value; diff --git a/v8js_variables.cc b/v8js_variables.cc index edd2f75..5d6d9d8 100644 --- a/v8js_variables.cc +++ b/v8js_variables.cc @@ -32,8 +32,6 @@ static void v8js_fetch_php_variable(v8::Local name, const v8::Proper v8::Isolate *isolate = ctx->isolate; zval *variable; - V8JS_TSRMLS_FETCH(); - zend_is_auto_global(ctx->variable_name); if ((variable = zend_hash_find(&EG(symbol_table), ctx->variable_name))) {