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

Unified Diff: src/x64/stub-cache-x64.cc

Issue 443963002: Always use the StoreFieldStub to do the actual storing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/stub-cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index 7d6dbd20b2befe3b1136449be424e7d0fc41019f..504482d9314e1ec407e86034dc08fc38bbc616dd 100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -516,61 +516,27 @@ 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);
}
+ __ bind(&do_store);
- if (index.is_inobject()) {
- // Set the property straight into the object.
- __ movp(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.
- __ movp(name_reg, value_reg);
- __ RecordWriteField(receiver_reg, index.offset(), name_reg, scratch1,
- kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
- } else {
- // Write to the properties array.
- // Get the properties array (optimistically).
- __ movp(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
- __ movp(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.
- __ movp(name_reg, value_reg);
- __ RecordWriteField(scratch1, index.offset(), name_reg, receiver_reg,
- kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
- }
-
- // Return the value (register rax).
- DCHECK(value_reg.is(rax));
- __ ret(0);
+ StoreFieldStub stub(isolate(), lookup->GetFieldIndex(),
+ lookup->representation());
+ GenerateTailCall(masm(), stub.GetCode());
}
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698