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=
R=weiliang.lin@intel.com

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

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22957 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2e411497
...@@ -567,60 +567,26 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition( ...@@ -567,60 +567,26 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
} }
// Both name_reg and receiver_reg are preserved on jumps to miss_label, void NamedStoreHandlerCompiler::GenerateStoreField(LookupResult* lookup,
// but may be destroyed if store is successful. Register value_reg,
void NamedStoreHandlerCompiler::GenerateStoreField( Label* miss_label) {
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();
DCHECK(lookup->representation().IsHeapObject()); DCHECK(lookup->representation().IsHeapObject());
__ JumpIfSmi(value_reg, miss_label); __ JumpIfSmi(value_reg, miss_label);
HeapType* field_type = lookup->GetFieldType(); HeapType::Iterator<Map> it = lookup->GetFieldType()->Classes();
HeapType::Iterator<Map> it = field_type->Classes(); Label do_store;
if (!it.Done()) { while (true) {
Label do_store; __ CompareMap(value_reg, it.Current());
while (true) { it.Advance();
__ CompareMap(value_reg, it.Current()); if (it.Done()) {
it.Advance(); __ j(not_equal, miss_label);
if (it.Done()) { break;
__ j(not_equal, miss_label);
break;
}
__ j(equal, &do_store, Label::kNear);
} }
__ bind(&do_store); __ j(equal, &do_store, Label::kNear);
} }
if (index.is_inobject()) { StoreFieldStub stub(isolate(), lookup->GetFieldIndex(),
// Set the property straight into the object. lookup->representation());
__ mov(FieldOperand(receiver_reg, index.offset()), value_reg); GenerateTailCall(masm(), stub.GetCode());
// 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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment