Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Unified Diff: src/objects.cc

Issue 11361275: Remove atomic increment/decrement on each DOM call (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Simpiler approach Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 944c5a15e596a885beb807833bdcc40e1fad9508..31f2d6d93636d3cd93d14e52aacf425eb2ac182b 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -200,12 +200,7 @@ MaybeObject* JSObject::GetPropertyWithCallback(Object* receiver,
LOG(isolate, ApiNamedPropertyAccess("load", self, name));
CustomArguments args(isolate, data->data(), self, this);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = call_fun(v8::Utils::ToLocal(key), info);
- }
+ v8::Handle<v8::Value> result = call_fun(v8::Utils::ToLocal(key), info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (result.IsEmpty()) {
return isolate->heap()->undefined_value();
@@ -1928,18 +1923,13 @@ MaybeObject* JSObject::SetPropertyWithInterceptor(
v8::AccessorInfo info(args.end());
v8::NamedPropertySetter setter =
v8::ToCData<v8::NamedPropertySetter>(interceptor->setter());
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- Handle<Object> value_unhole(value->IsTheHole() ?
- isolate->heap()->undefined_value() :
- value,
- isolate);
- result = setter(v8::Utils::ToLocal(name_handle),
- v8::Utils::ToLocal(value_unhole),
- info);
- }
+ Handle<Object> value_unhole(value->IsTheHole() ?
+ isolate->heap()->undefined_value() :
+ value,
+ isolate);
+ v8::Handle<v8::Value> result = setter(v8::Utils::ToLocal(name_handle),
+ v8::Utils::ToLocal(value_unhole),
+ info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (!result.IsEmpty()) return *value_handle;
}
@@ -2025,13 +2015,9 @@ MaybeObject* JSObject::SetPropertyWithCallback(Object* structure,
LOG(isolate, ApiNamedPropertyAccess("store", this, name));
CustomArguments args(isolate, data->data(), this, JSObject::cast(holder));
v8::AccessorInfo info(args.end());
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- call_fun(v8::Utils::ToLocal(key),
- v8::Utils::ToLocal(value_handle),
- info);
- }
+ call_fun(v8::Utils::ToLocal(key),
+ v8::Utils::ToLocal(value_handle),
+ info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
return *value_handle;
}
@@ -3232,12 +3218,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor(
v8::ToCData<v8::NamedPropertyQuery>(interceptor->query());
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name));
- v8::Handle<v8::Integer> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = query(v8::Utils::ToLocal(name_handle), info);
- }
+ v8::Handle<v8::Integer> result = query(v8::Utils::ToLocal(name_handle), info);
if (!result.IsEmpty()) {
ASSERT(result->IsInt32());
return static_cast<PropertyAttributes>(result->Int32Value());
@@ -3247,12 +3228,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor(
v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter());
LOG(isolate,
ApiNamedPropertyAccess("interceptor-named-get-has", this, name));
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = getter(v8::Utils::ToLocal(name_handle), info);
- }
+ v8::Handle<v8::Value> result = getter(v8::Utils::ToLocal(name_handle), info);
if (!result.IsEmpty()) return DONT_ENUM;
}
return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle,
@@ -3378,12 +3354,7 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor(
v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query());
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-has", this, index));
- v8::Handle<v8::Integer> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = query(index, info);
- }
+ v8::Handle<v8::Integer> result = query(index, info);
if (!result.IsEmpty())
return static_cast<PropertyAttributes>(result->Int32Value());
} else if (!interceptor->getter()->IsUndefined()) {
@@ -3391,12 +3362,7 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor(
v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter());
LOG(isolate,
ApiIndexedPropertyAccess("interceptor-indexed-get-has", this, index));
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = getter(index, info);
- }
+ v8::Handle<v8::Value> result = getter(index, info);
if (!result.IsEmpty()) return NONE;
}
@@ -4055,12 +4021,7 @@ MaybeObject* JSObject::DeletePropertyWithInterceptor(String* name) {
ApiNamedPropertyAccess("interceptor-named-delete", *this_handle, name));
CustomArguments args(isolate, interceptor->data(), this, this);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Boolean> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = deleter(v8::Utils::ToLocal(name_handle), info);
- }
+ v8::Handle<v8::Boolean> result = deleter(v8::Utils::ToLocal(name_handle), info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (!result.IsEmpty()) {
ASSERT(result->IsBoolean());
@@ -4092,12 +4053,7 @@ MaybeObject* JSObject::DeleteElementWithInterceptor(uint32_t index) {
ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index));
CustomArguments args(isolate, interceptor->data(), this, this);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Boolean> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = deleter(index, info);
- }
+ v8::Handle<v8::Boolean> result = deleter(index, info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (!result.IsEmpty()) {
ASSERT(result->IsBoolean());
@@ -9708,12 +9664,7 @@ MaybeObject* JSObject::SetElementWithInterceptor(uint32_t index,
ApiIndexedPropertyAccess("interceptor-indexed-set", this, index));
CustomArguments args(isolate, interceptor->data(), this, this);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = setter(index, v8::Utils::ToLocal(value_handle), info);
- }
+ v8::Handle<v8::Value> result = setter(index, v8::Utils::ToLocal(value_handle), info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (!result.IsEmpty()) return *value_handle;
}
@@ -9750,12 +9701,7 @@ MaybeObject* JSObject::GetElementWithCallback(Object* receiver,
LOG(isolate, ApiNamedPropertyAccess("load", *self, *key));
CustomArguments args(isolate, data->data(), *self, *holder_handle);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = call_fun(v8::Utils::ToLocal(key), info);
- }
+ v8::Handle<v8::Value> result = call_fun(v8::Utils::ToLocal(key), info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (result.IsEmpty()) return isolate->heap()->undefined_value();
Handle<Object> result_internal = v8::Utils::OpenHandle(*result);
@@ -9810,13 +9756,9 @@ MaybeObject* JSObject::SetElementWithCallback(Object* structure,
LOG(isolate, ApiNamedPropertyAccess("store", *self, *key));
CustomArguments args(isolate, data->data(), *self, *holder_handle);
v8::AccessorInfo info(args.end());
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- call_fun(v8::Utils::ToLocal(key),
- v8::Utils::ToLocal(value_handle),
- info);
- }
+ call_fun(v8::Utils::ToLocal(key),
+ v8::Utils::ToLocal(value_handle),
+ info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
return *value_handle;
}
@@ -10604,12 +10546,7 @@ MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver,
ApiIndexedPropertyAccess("interceptor-indexed-get", this, index));
CustomArguments args(isolate, interceptor->data(), receiver, this);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = getter(index, info);
- }
+ v8::Handle<v8::Value> result = getter(index, info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (!result.IsEmpty()) {
Handle<Object> result_internal = v8::Utils::OpenHandle(*result);
@@ -10908,12 +10845,7 @@ MaybeObject* JSObject::GetPropertyWithInterceptor(
ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name));
CustomArguments args(isolate, interceptor->data(), receiver, this);
v8::AccessorInfo info(args.end());
- v8::Handle<v8::Value> result;
- {
- // Leaving JavaScript.
- VMState state(isolate, EXTERNAL);
- result = getter(v8::Utils::ToLocal(name_handle), info);
- }
+ v8::Handle<v8::Value> result = getter(v8::Utils::ToLocal(name_handle), info);
RETURN_IF_SCHEDULED_EXCEPTION(isolate);
if (!result.IsEmpty()) {
*attributes = NONE;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698