Revision: 22741
Author:   [email protected]
Date:     Thu Jul 31 09:01:32 2014 UTC
Log:      X87: Encapsulate type in the PropertyHandlerCompiler

port r22700.

original commit message:
  Encapsulate type in the PropertyHandlerCompiler

BUG=
[email protected]

Review URL: https://codereview.chromium.org/425493005

Patch from Chunyang Dai <[email protected]>.
http://code.google.com/p/v8/source/detail?r=22741

Modified:
 /branches/bleeding_edge/src/x87/stub-cache-x87.cc

=======================================
--- /branches/bleeding_edge/src/x87/stub-cache-x87.cc Wed Jul 30 09:28:43 2014 UTC +++ /branches/bleeding_edge/src/x87/stub-cache-x87.cc Thu Jul 31 09:01:32 2014 UTC
@@ -692,10 +692,10 @@


 Register PropertyHandlerCompiler::CheckPrototypes(
-    Handle<HeapType> type, Register object_reg, Handle<JSObject> holder,
-    Register holder_reg, Register scratch1, Register scratch2,
-    Handle<Name> name, Label* miss, PrototypeCheckType check) {
-  Handle<Map> receiver_map(IC::TypeToMap(*type, isolate()));
+    Register object_reg, Handle<JSObject> holder, Register holder_reg,
+    Register scratch1, Register scratch2, Handle<Name> name, Label* miss,
+    PrototypeCheckType check) {
+  Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate()));

   // Make sure there's no overlap between holder and object registers.
   ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
@@ -707,8 +707,8 @@
   int depth = 0;

   Handle<JSObject> current = Handle<JSObject>::null();
-  if (type->IsConstant()) current =
-      Handle<JSObject>::cast(type->AsConstant()->Value());
+  if (type()->IsConstant())
+    current = Handle<JSObject>::cast(type()->AsConstant()->Value());
   Handle<JSObject> prototype = Handle<JSObject>::null();
   Handle<Map> current_map = receiver_map;
   Handle<Map> holder_map(holder->map());
@@ -823,14 +823,13 @@
 }


-Register NamedLoadHandlerCompiler::CallbackFrontend(Handle<HeapType> type,
-                                                    Register object_reg,
+Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
Handle<JSObject> holder,
                                                     Handle<Name> name,
Handle<Object> callback) {
   Label miss;

-  Register reg = FrontendHeader(type, object_reg, holder, name, &miss);
+  Register reg = FrontendHeader(object_reg, holder, name, &miss);

   if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
     ASSERT(!reg.is(scratch2()));
@@ -943,9 +942,8 @@


 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
-    Register holder_reg, Handle<Object> object,
-    Handle<JSObject> interceptor_holder, LookupResult* lookup,
-    Handle<Name> name) {
+    Register holder_reg, Handle<JSObject> interceptor_holder,
+    LookupResult* lookup, Handle<Name> name) {
   ASSERT(interceptor_holder->HasNamedInterceptor());
ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());

@@ -958,10 +956,12 @@
       compile_followup_inline = true;
     } else if (lookup->type() == CALLBACKS &&
                lookup->GetCallbackObject()->IsExecutableAccessorInfo()) {
-      ExecutableAccessorInfo* callback =
-          ExecutableAccessorInfo::cast(lookup->GetCallbackObject());
-      compile_followup_inline = callback->getter() != NULL &&
-          callback->IsCompatibleReceiver(*object);
+      Handle<ExecutableAccessorInfo> callback(
+          ExecutableAccessorInfo::cast(lookup->GetCallbackObject()));
+      compile_followup_inline =
+          callback->getter() != NULL &&
+ ExecutableAccessorInfo::IsCompatibleReceiverType(isolate(), callback,
+                                                           type());
     }
   }

@@ -1043,8 +1043,7 @@
 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
     Handle<JSObject> object, Handle<JSObject> holder, Handle<Name> name,
     Handle<ExecutableAccessorInfo> callback) {
-  Register holder_reg =
- Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name);
+  Register holder_reg = Frontend(receiver(), holder, name);

   __ pop(scratch1());  // remove the return address
   __ push(receiver());
@@ -1172,8 +1171,8 @@


 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
-    Handle<HeapType> type, Handle<JSObject> last, Handle<Name> name) {
-  NonexistentFrontend(type, last, name);
+    Handle<JSObject> last, Handle<Name> name) {
+  NonexistentFrontend(last, name);

   // Return undefined if maps of the full prototype chain are still the
   // same and no global property with this name contains a value.
@@ -1256,25 +1255,26 @@


 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
-    Handle<HeapType> type, Handle<GlobalObject> global,
-    Handle<PropertyCell> cell, Handle<Name> name, bool is_dont_delete) {
+ Handle<GlobalObject> global, Handle<PropertyCell> cell, Handle<Name> name,
+    bool is_dont_delete) {
   Label miss;

-  FrontendHeader(type, receiver(), global, name, &miss);
+  FrontendHeader(receiver(), global, name, &miss);
   // Get the value from the cell.
+  Register result = StoreIC::ValueRegister();
   if (masm()->serializer_enabled()) {
-    __ mov(eax, Immediate(cell));
-    __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset));
+    __ mov(result, Immediate(cell));
+    __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
   } else {
-    __ mov(eax, Operand::ForCell(cell));
+    __ mov(result, Operand::ForCell(cell));
   }

   // Check for deleted property if property can actually be deleted.
   if (!is_dont_delete) {
-    __ cmp(eax, factory()->the_hole_value());
+    __ cmp(result, factory()->the_hole_value());
     __ j(equal, &miss);
   } else if (FLAG_debug_code) {
-    __ cmp(eax, factory()->the_hole_value());
+    __ cmp(result, factory()->the_hole_value());
     __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
   }

--
--
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/d/optout.

Reply via email to