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

Unified Diff: src/objects.cc

Issue 23707007: Handlify JSProxy::Fix (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | « src/objects.h ('k') | src/runtime.cc » ('j') | 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 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) {
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698