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

Unified Diff: src/api.cc

Issue 8050013: Move logic for hidden properties into the JSObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix typo. Created 9 years, 3 months 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 | src/handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 7ae01d14e4021ea450d1e21c561b723a199e7ce2..ee06456516e3c457d334c845f926a3c3ea0451c3 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3210,21 +3210,10 @@ bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key,
ENTER_V8(isolate);
i::HandleScope scope(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
- i::Handle<i::Object> hidden_props(i::GetHiddenProperties(
- self,
- i::ALLOW_CREATION));
- i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
+ i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
- EXCEPTION_PREAMBLE(isolate);
- i::Handle<i::Object> obj = i::SetProperty(
- hidden_props,
- key_obj,
- value_obj,
- static_cast<PropertyAttributes>(None),
- i::kNonStrictMode);
- has_pending_exception = obj.is_null();
- EXCEPTION_BAILOUT_CHECK(isolate, false);
- return true;
+ i::Handle<i::Object> result = i::SetHiddenProperty(self, key_obj, value_obj);
+ return *result == *self;
}
@@ -3234,20 +3223,9 @@ v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) {
return Local<v8::Value>());
ENTER_V8(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
- i::Handle<i::Object> hidden_props(i::GetHiddenProperties(
- self,
- i::OMIT_CREATION));
- if (hidden_props->IsUndefined()) {
- return v8::Local<v8::Value>();
- }
i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
- EXCEPTION_PREAMBLE(isolate);
- i::Handle<i::Object> result = i::GetProperty(hidden_props, key_obj);
- has_pending_exception = result.is_null();
- EXCEPTION_BAILOUT_CHECK(isolate, v8::Local<v8::Value>());
- if (result->IsUndefined()) {
- return v8::Local<v8::Value>();
- }
+ i::Handle<i::Object> result(self->GetHiddenProperty(*key_obj));
+ if (result->IsUndefined()) return v8::Local<v8::Value>();
return Utils::ToLocal(result);
}
@@ -3258,15 +3236,9 @@ bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) {
ENTER_V8(isolate);
i::HandleScope scope(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
- i::Handle<i::Object> hidden_props(i::GetHiddenProperties(
- self,
- i::OMIT_CREATION));
- if (hidden_props->IsUndefined()) {
- return true;
- }
- i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props));
i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
- return i::DeleteProperty(js_obj, key_obj)->IsTrue();
+ self->DeleteHiddenProperty(*key_obj);
+ return true;
}
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698