Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 452c1d62d5ec673f30d6e9cb4549c80ce80fba4e..9584954a8918b621bba05331119f77dabcdab1cd 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -3652,15 +3652,13 @@ MUST_USE_RESULT PropertyAttributes JSProxy::GetElementAttributeWithHandler( |
| } |
| -void JSProxy::Fix() { |
| - Isolate* isolate = GetIsolate(); |
| - HandleScope scope(isolate); |
| - Handle<JSProxy> self(this); |
| +void JSProxy::Fix(Handle<JSProxy> self) { |
|
Michael Starzinger
2013/08/30 10:56:31
nit: s/self/proxy here for consistency.
|
| + Isolate* isolate = self->GetIsolate(); |
| // Save identity hash. |
| - MaybeObject* maybe_hash = GetIdentityHash(OMIT_CREATION); |
| + Handle<Object> hash = JSProxy::GetIdentityHash(self, OMIT_CREATION); |
| - if (IsJSFunctionProxy()) { |
| + if (self->IsJSFunctionProxy()) { |
| isolate->factory()->BecomeJSFunction(self); |
| // Code will be set on the JavaScript side. |
| } else { |
| @@ -3669,10 +3667,9 @@ void JSProxy::Fix() { |
| ASSERT(self->IsJSObject()); |
| // Inherit identity, if it was present. |
| - Object* hash; |
| - if (maybe_hash->To<Object>(&hash) && hash->IsSmi()) { |
| + if (hash->IsSmi()) { |
| Handle<JSObject> new_self(JSObject::cast(*self)); |
|
Michael Starzinger
2013/08/30 10:56:31
This re-handlification of "self" makes no sense to
|
| - isolate->factory()->SetIdentityHash(new_self, Smi::cast(hash)); |
| + isolate->factory()->SetIdentityHash(new_self, Smi::cast(*hash)); |
| } |
| } |
| @@ -4747,6 +4744,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) { |