Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 2937cec0b133378446822599fdb7b2145963ba38..71d2602dc00d7601e3b6fcd48f8ad6750f0b3736 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3656,27 +3656,24 @@ MUST_USE_RESULT PropertyAttributes JSProxy::GetElementAttributeWithHandler( |
} |
-void JSProxy::Fix() { |
- Isolate* isolate = GetIsolate(); |
- HandleScope scope(isolate); |
- Handle<JSProxy> self(this); |
+void JSProxy::Fix(Handle<JSProxy> proxy) { |
+ Isolate* isolate = proxy->GetIsolate(); |
// Save identity hash. |
- MaybeObject* maybe_hash = GetIdentityHash(OMIT_CREATION); |
+ Handle<Object> hash = JSProxy::GetIdentityHash(proxy, OMIT_CREATION); |
- if (IsJSFunctionProxy()) { |
- isolate->factory()->BecomeJSFunction(self); |
+ if (proxy->IsJSFunctionProxy()) { |
+ isolate->factory()->BecomeJSFunction(proxy); |
// Code will be set on the JavaScript side. |
} else { |
- isolate->factory()->BecomeJSObject(self); |
+ isolate->factory()->BecomeJSObject(proxy); |
} |
- ASSERT(self->IsJSObject()); |
+ ASSERT(proxy->IsJSObject()); |
// Inherit identity, if it was present. |
- Object* hash; |
- if (maybe_hash->To<Object>(&hash) && hash->IsSmi()) { |
- Handle<JSObject> new_self(JSObject::cast(*self)); |
- isolate->factory()->SetIdentityHash(new_self, Smi::cast(hash)); |
+ if (hash->IsSmi()) { |
+ isolate->factory()->SetIdentityHash( |
+ Handle<JSObject>::cast(proxy), Smi::cast(*hash)); |
} |
} |
@@ -4754,6 +4751,12 @@ MaybeObject* JSObject::GetIdentityHash(CreationFlag flag) { |
} |
+Handle<Object> JSProxy::GetIdentityHash(Handle<JSProxy> proxy, |
+ CreationFlag flag) { |
+ CALL_HEAP_FUNCTION(proxy->GetIsolate(), proxy->GetIdentityHash(flag), Object); |
+} |
+ |
+ |
MaybeObject* JSProxy::GetIdentityHash(CreationFlag flag) { |
Object* hash = this->hash(); |
if (!hash->IsSmi() && flag == ALLOW_CREATION) { |