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

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

Issue 445313002: X87: Hydrogenize (and share) StoreField except heapobject (for now) (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/stub-cache-x87.cc
diff --git a/src/x87/stub-cache-x87.cc b/src/x87/stub-cache-x87.cc
index 58f059ffc0a09aef8f6b49d0396b3cf4b69c15e9..3f3e75a1de403a06ddb5359960bb84ef32023cb0 100644
--- a/src/x87/stub-cache-x87.cc
+++ b/src/x87/stub-cache-x87.cc
@@ -578,94 +578,44 @@ void NamedStoreHandlerCompiler::GenerateStoreField(
DCHECK(!object->IsJSGlobalProxy());
FieldIndex index = lookup->GetFieldIndex();
-
- Representation representation = lookup->representation();
- DCHECK(!representation.IsNone());
- if (representation.IsSmi()) {
- __ JumpIfNotSmi(value_reg, miss_label);
- } else if (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);
+ 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;
}
- __ bind(&do_store);
+ __ j(equal, &do_store, Label::kNear);
}
- } else if (representation.IsDouble()) {
- // Load the double storage.
- if (index.is_inobject()) {
- __ mov(scratch1, FieldOperand(receiver_reg, index.offset()));
- } else {
- __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
- __ mov(scratch1, FieldOperand(scratch1, index.offset()));
- }
-
- // Store the value into the storage.
- Label do_store, heap_number;
- __ JumpIfNotSmi(value_reg, &heap_number);
- __ SmiUntag(value_reg);
- __ push(value_reg);
- __ fild_s(Operand(esp, 0));
- __ pop(value_reg);
- __ SmiTag(value_reg);
- __ jmp(&do_store);
- __ bind(&heap_number);
- __ CheckMap(value_reg, isolate()->factory()->heap_number_map(), miss_label,
- DONT_DO_SMI_CHECK);
- __ fld_d(FieldOperand(value_reg, HeapNumber::kValueOffset));
__ bind(&do_store);
- __ fstp_d(FieldOperand(scratch1, HeapNumber::kValueOffset));
- // Return the value (register eax).
- DCHECK(value_reg.is(eax));
- __ ret(0);
- return;
}
- DCHECK(!representation.IsDouble());
- // TODO(verwaest): Share this code as a code stub.
- SmiCheck smi_check = representation.IsTagged()
- ? INLINE_SMI_CHECK : OMIT_SMI_CHECK;
if (index.is_inobject()) {
// Set the property straight into the object.
__ mov(FieldOperand(receiver_reg, index.offset()), value_reg);
- if (!representation.IsSmi()) {
- // 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,
- smi_check);
- }
+ // 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);
- if (!representation.IsSmi()) {
- // 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,
- smi_check);
- }
+ // 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).
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698