Revision: 16452
Author:   [email protected]
Date:     Fri Aug 30 12:52:25 2013 UTC
Log:      Handlify JSProxy::Fix

[email protected]

Review URL: https://chromiumcodereview.appspot.com/23707007
http://code.google.com/p/v8/source/detail?r=16452

Modified:
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/objects.cc      Fri Aug 30 11:44:39 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc      Fri Aug 30 12:52:25 2013 UTC
@@ -3656,27 +3656,24 @@
 }


-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));
   }
 }

@@ -4752,6 +4749,12 @@
   }
   return hash;
 }
+
+
+Handle<Object> JSProxy::GetIdentityHash(Handle<JSProxy> proxy,
+                                        CreationFlag flag) {
+ CALL_HEAP_FUNCTION(proxy->GetIsolate(), proxy->GetIdentityHash(flag), Object);
+}


 MaybeObject* JSProxy::GetIdentityHash(CreationFlag flag) {
=======================================
--- /branches/bleeding_edge/src/objects.h       Fri Aug 30 11:44:39 2013 UTC
+++ /branches/bleeding_edge/src/objects.h       Fri Aug 30 12:52:25 2013 UTC
@@ -9106,9 +9106,11 @@
       uint32_t index);

   MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag);
+  static Handle<Object> GetIdentityHash(Handle<JSProxy> proxy,
+                                        CreationFlag flag);

   // Turn this into an (empty) JSObject.
-  void Fix();
+  static void Fix(Handle<JSProxy> proxy);

   // Initializes the body after the handler slot.
   inline void InitializeBody(int object_size, Object* value);
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Thu Aug 29 13:06:04 2013 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Fri Aug 30 12:52:25 2013 UTC
@@ -685,10 +685,10 @@


 RUNTIME_FUNCTION(MaybeObject*, Runtime_Fix) {
-  SealHandleScope shs(isolate);
+  HandleScope scope(isolate);
   ASSERT(args.length() == 1);
-  CONVERT_ARG_CHECKED(JSProxy, proxy, 0);
-  proxy->Fix();
+  CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0);
+  JSProxy::Fix(proxy);
   return isolate->heap()->undefined_value();
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to