0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 18:41:52 +00:00

remove V8JS_TSRMLS_FETCH

This commit is contained in:
Stefan Siegl 2017-03-11 13:43:30 +01:00
parent 24bb1761bf
commit 3e8ef5f684
6 changed files with 0 additions and 34 deletions

View File

@ -65,8 +65,6 @@ void v8js_array_access_getter(uint32_t index, const v8::PropertyCallbackInfo<v8:
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
zval zvalue; zval zvalue;
@ -86,8 +84,6 @@ void v8js_array_access_setter(uint32_t index, v8::Local<v8::Value> value,
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
zval zvalue; zval zvalue;
@ -160,8 +156,6 @@ static void v8js_array_access_length(v8::Local<v8::String> property, const v8::P
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
int length = v8js_array_access_get_count_result(object); int length = v8js_array_access_get_count_result(object);
@ -174,8 +168,6 @@ void v8js_array_access_deleter(uint32_t index, const v8::PropertyCallbackInfo<v8
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
zval zvalue; zval zvalue;
@ -193,8 +185,6 @@ void v8js_array_access_query(uint32_t index, const v8::PropertyCallbackInfo<v8::
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
/* If index is set, then return an integer encoding a v8::PropertyAttribute; /* If index is set, then return an integer encoding a v8::PropertyAttribute;
@ -211,8 +201,6 @@ void v8js_array_access_enumerator(const v8::PropertyCallbackInfo<v8::Array>& inf
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
int length = v8js_array_access_get_count_result(object); int length = v8js_array_access_get_count_result(object);

View File

@ -213,7 +213,6 @@ static zend_object* v8js_new(zend_class_entry *ce) /* {{{ */
object_properties_init(&c->std, ce); object_properties_init(&c->std, ce);
c->std.handlers = &v8js_object_handlers; c->std.handlers = &v8js_object_handlers;
TSRMLS_SET_CTX(c->zts_ctx);
new(&c->object_name) v8::Persistent<v8::String>(); new(&c->object_name) v8::Persistent<v8::String>();
new(&c->context) v8::Persistent<v8::Context>(); new(&c->context) v8::Persistent<v8::Context>();

View File

@ -74,20 +74,10 @@ struct v8js_ctx {
zval zval_snapshot_blob; zval zval_snapshot_blob;
v8::StartupData snapshot_blob; v8::StartupData snapshot_blob;
#ifdef ZTS
void ***zts_ctx;
#endif
zend_object std; 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) { static inline struct v8js_ctx *v8js_ctx_fetch_object(zend_object *obj) {
return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std)); return (struct v8js_ctx *)((char *)obj - XtOffsetOf(struct v8js_ctx, std));
} }

View File

@ -193,7 +193,6 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int leve
V8JS_METHOD(var_dump) /* {{{ */ V8JS_METHOD(var_dump) /* {{{ */
{ {
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
V8JS_TSRMLS_FETCH();
for (int i = 0; i < info.Length(); i++) { for (int i = 0; i < info.Length(); i++) {
v8js_dumper(isolate, info[i], 1); v8js_dumper(isolate, info[i], 1);
@ -206,7 +205,6 @@ V8JS_METHOD(var_dump) /* {{{ */
V8JS_METHOD(require) V8JS_METHOD(require)
{ {
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
V8JS_TSRMLS_FETCH();
// Get the extension context // Get the extension context
v8::Local<v8::External> data = v8::Local<v8::External>::Cast(info.Data()); v8::Local<v8::External> data = v8::Local<v8::External>::Cast(info.Data());

View File

@ -191,7 +191,6 @@ void v8js_php_callback(const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ *
v8::Isolate *isolate = info.GetIsolate(); v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Object> self = info.Holder(); v8::Local<v8::Object> self = info.Holder();
V8JS_TSRMLS_FETCH();
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
zend_function *method_ptr; zend_function *method_ptr;
@ -243,7 +242,6 @@ static void v8js_construct_callback(const v8::FunctionCallbackInfo<v8::Value>& i
Z_ADDREF_P(&value); Z_ADDREF_P(&value);
} else { } else {
// Object created from JavaScript context. Need to create PHP object first. // Object created from JavaScript context. Need to create PHP object first.
V8JS_TSRMLS_FETCH();
zend_class_entry *ce = static_cast<zend_class_entry *>(ext_ce->Value()); zend_class_entry *ce = static_cast<zend_class_entry *>(ext_ce->Value());
zend_function *ctor_ptr = ce->constructor; zend_function *ctor_ptr = ce->constructor;
@ -322,7 +320,6 @@ static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo<v8::Ar
v8::Local<v8::Array> result = v8::Array::New(isolate, 0); v8::Local<v8::Array> result = v8::Array::New(isolate, 0);
uint32_t result_len = 0; uint32_t result_len = 0;
V8JS_TSRMLS_FETCH();
zend_class_entry *ce; zend_class_entry *ce;
void *ptr; void *ptr;
HashTable *proptable; HashTable *proptable;
@ -425,8 +422,6 @@ static void v8js_invoke_callback(const v8::FunctionCallbackInfo<v8::Value>& info
v8::Local<v8::Value> *argv = static_cast<v8::Local<v8::Value> *>(alloca(sizeof(v8::Local<v8::Value>) * argc)); v8::Local<v8::Value> *argv = static_cast<v8::Local<v8::Value> *>(alloca(sizeof(v8::Local<v8::Value>) * argc));
v8::Local<v8::Value> result; v8::Local<v8::Value> result;
V8JS_TSRMLS_FETCH();
for (i=0; i<argc; i++) { for (i=0; i<argc; i++) {
new(&argv[i]) v8::Local<v8::Value>; new(&argv[i]) v8::Local<v8::Value>;
argv[i] = info[i]; argv[i] = info[i];
@ -465,7 +460,6 @@ static void v8js_fake_call_impl(const v8::FunctionCallbackInfo<v8::Value>& info)
char *error; char *error;
size_t error_len; size_t error_len;
V8JS_TSRMLS_FETCH();
zend_class_entry *ce; zend_class_entry *ce;
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
ce = object->ce; ce = object->ce;
@ -590,7 +584,6 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> property
v8::Local<v8::Value> ret_value; v8::Local<v8::Value> ret_value;
v8::Local<v8::Function> cb; v8::Local<v8::Function> cb;
V8JS_TSRMLS_FETCH();
zend_class_entry *scope, *ce; zend_class_entry *scope, *ce;
zend_function *method_ptr = NULL; zend_function *method_ptr = NULL;
zval php_value; zval php_value;

View File

@ -32,8 +32,6 @@ static void v8js_fetch_php_variable(v8::Local<v8::String> name, const v8::Proper
v8::Isolate *isolate = ctx->isolate; v8::Isolate *isolate = ctx->isolate;
zval *variable; zval *variable;
V8JS_TSRMLS_FETCH();
zend_is_auto_global(ctx->variable_name); zend_is_auto_global(ctx->variable_name);
if ((variable = zend_hash_find(&EG(symbol_table), ctx->variable_name))) { if ((variable = zend_hash_find(&EG(symbol_table), ctx->variable_name))) {