Reviewers: Weiliang, Toon Verwaest,

Message:
weiliang.
please review this patch.
thanks.

Description:
X87: Always use the StoreFieldStub to do the actual storing.

port r22931.

original commit message:

  Always use the StoreFieldStub to do the actual storing.

BUG=

Please review this at https://codereview.chromium.org/445343002/

SVN Base: https://chromium.googlesource.com/external/v8.git@bleeding_edge

Affected files (+15, -49 lines):
  M src/x87/stub-cache-x87.cc


Index: src/x87/stub-cache-x87.cc
diff --git a/src/x87/stub-cache-x87.cc b/src/x87/stub-cache-x87.cc
index 3f3e75a1de403a06ddb5359960bb84ef32023cb0..f17f1de2b5c24f6d34556cf2227e6561c58ab253 100644
--- a/src/x87/stub-cache-x87.cc
+++ b/src/x87/stub-cache-x87.cc
@@ -567,60 +567,26 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
 }


-// Both name_reg and receiver_reg are preserved on jumps to miss_label,
-// but may be destroyed if store is successful.
-void NamedStoreHandlerCompiler::GenerateStoreField(
-    Handle<JSObject> object, LookupResult* lookup, Register receiver_reg,
- Register name_reg, Register value_reg, Register scratch1, Register scratch2,
-    Label* miss_label) {
-  // Stub never generated for objects that require access checks.
-  DCHECK(!object->IsAccessCheckNeeded());
-  DCHECK(!object->IsJSGlobalProxy());
-
-  FieldIndex index = lookup->GetFieldIndex();
+void NamedStoreHandlerCompiler::GenerateStoreField(LookupResult* lookup,
+                                                   Register value_reg,
+                                                   Label* miss_label) {
   DCHECK(lookup->representation().IsHeapObject());
   __ JumpIfSmi(value_reg, miss_label);
-  HeapType* field_type = lookup->GetFieldType();
-  HeapType::Iterator<Map> it = field_type->Classes();
-  if (!it.Done()) {
-    Label do_store;
-    while (true) {
-      __ CompareMap(value_reg, it.Current());
-      it.Advance();
-      if (it.Done()) {
-        __ j(not_equal, miss_label);
-        break;
-      }
-      __ j(equal, &do_store, Label::kNear);
+  HeapType::Iterator<Map> it = lookup->GetFieldType()->Classes();
+  Label do_store;
+  while (true) {
+    __ CompareMap(value_reg, it.Current());
+    it.Advance();
+    if (it.Done()) {
+      __ j(not_equal, miss_label);
+      break;
     }
-    __ bind(&do_store);
+    __ j(equal, &do_store, Label::kNear);
   }

-  if (index.is_inobject()) {
-    // Set the property straight into the object.
-    __ mov(FieldOperand(receiver_reg, index.offset()), value_reg);
-
-    // Update the write barrier for the array address.
-    // Pass the value being stored in the now unused name_reg.
-    __ mov(name_reg, value_reg);
-    __ RecordWriteField(receiver_reg, index.offset(), name_reg, scratch1,
-                        EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
-  } else {
-    // Write to the properties array.
-    // Get the properties array (optimistically).
- __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
-    __ mov(FieldOperand(scratch1, index.offset()), value_reg);
-
-    // Update the write barrier for the array address.
-    // Pass the value being stored in the now unused name_reg.
-    __ mov(name_reg, value_reg);
-    __ RecordWriteField(scratch1, index.offset(), name_reg, receiver_reg,
-                        EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
-  }
-
-  // Return the value (register eax).
-  DCHECK(value_reg.is(eax));
-  __ ret(0);
+  StoreFieldStub stub(isolate(), lookup->GetFieldIndex(),
+                      lookup->representation());
+  GenerateTailCall(masm(), stub.GetCode());
 }




--
--
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