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

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

Issue 447673003: MIPS: Hydrogenize (and share) StoreField except heapobject (for now). (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/mips/stub-cache-mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/stub-cache-mips64.cc
diff --git a/src/mips64/stub-cache-mips64.cc b/src/mips64/stub-cache-mips64.cc
index 94d62bc9dae0976869c2b6fbe28decf72ca4bf4f..aa51a32c7cf6c9fa4c9750284da979133db2c1d3 100644
--- a/src/mips64/stub-cache-mips64.cc
+++ b/src/mips64/stub-cache-mips64.cc
@@ -597,85 +597,40 @@ void NamedStoreHandlerCompiler::GenerateStoreField(
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()) {
- __ ld(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset));
- Label do_store;
- Handle<Map> current;
- while (true) {
- // Do the CompareMap() directly within the Branch() functions.
- current = it.Current();
- it.Advance();
- if (it.Done()) {
- __ Branch(miss_label, ne, scratch1, Operand(current));
- break;
- }
- __ Branch(&do_store, eq, scratch1, Operand(current));
+ DCHECK(lookup->representation().IsHeapObject());
+ __ JumpIfSmi(value_reg, miss_label);
+ HeapType* field_type = lookup->GetFieldType();
+ HeapType::Iterator<Map> it = field_type->Classes();
+ if (!it.Done()) {
+ __ ld(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset));
+ Label do_store;
+ Handle<Map> current;
+ while (true) {
+ // Do the CompareMap() directly within the Branch() functions.
+ current = it.Current();
+ it.Advance();
+ if (it.Done()) {
+ __ Branch(miss_label, ne, scratch1, Operand(current));
+ break;
}
- __ bind(&do_store);
- }
- } else if (representation.IsDouble()) {
- // Load the double storage.
- if (index.is_inobject()) {
- __ ld(scratch1, FieldMemOperand(receiver_reg, index.offset()));
- } else {
- __ ld(scratch1,
- FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
- __ ld(scratch1, FieldMemOperand(scratch1, index.offset()));
+ __ Branch(&do_store, eq, scratch1, Operand(current));
}
-
- // Store the value into the storage.
- Label do_store, heap_number;
- __ JumpIfNotSmi(value_reg, &heap_number);
- __ SmiUntag(scratch2, value_reg);
- __ mtc1(scratch2, f6);
- __ cvt_d_w(f4, f6);
- __ jmp(&do_store);
-
- __ bind(&heap_number);
- __ CheckMap(value_reg, scratch2, Heap::kHeapNumberMapRootIndex,
- miss_label, DONT_DO_SMI_CHECK);
- __ ldc1(f4, FieldMemOperand(value_reg, HeapNumber::kValueOffset));
-
__ bind(&do_store);
- __ sdc1(f4, FieldMemOperand(scratch1, HeapNumber::kValueOffset));
- // Return the value (register v0).
- DCHECK(value_reg.is(a0));
- __ Ret(USE_DELAY_SLOT);
- __ mov(v0, a0);
- return;
}
- // 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.
__ sd(value_reg, FieldMemOperand(receiver_reg, index.offset()));
- if (!representation.IsSmi()) {
- // Skip updating write barrier if storing a smi.
- __ JumpIfSmi(value_reg, &exit);
+ // Skip updating write barrier if storing a smi.
+ __ JumpIfSmi(value_reg, &exit);
- // Update the write barrier for the array address.
- // Pass the now unused name_reg as a scratch register.
- __ mov(name_reg, value_reg);
- __ RecordWriteField(receiver_reg,
- index.offset(),
- name_reg,
- scratch1,
- kRAHasNotBeenSaved,
- kDontSaveFPRegs,
- EMIT_REMEMBERED_SET,
- smi_check);
- }
+ // Update the write barrier for the array address.
+ // Pass the now unused name_reg as a scratch register.
+ __ mov(name_reg, value_reg);
+ __ RecordWriteField(receiver_reg, index.offset(), name_reg, scratch1,
+ kRAHasNotBeenSaved, kDontSaveFPRegs,
+ EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
} else {
// Write to the properties array.
// Get the properties array.
@@ -683,22 +638,15 @@ void NamedStoreHandlerCompiler::GenerateStoreField(
FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
__ sd(value_reg, FieldMemOperand(scratch1, index.offset()));
- if (!representation.IsSmi()) {
- // Skip updating write barrier if storing a smi.
- __ JumpIfSmi(value_reg, &exit);
+ // Skip updating write barrier if storing a smi.
+ __ JumpIfSmi(value_reg, &exit);
- // Update the write barrier for the array address.
- // Ok to clobber receiver_reg and name_reg, since we return.
- __ mov(name_reg, value_reg);
- __ RecordWriteField(scratch1,
- index.offset(),
- name_reg,
- receiver_reg,
- kRAHasNotBeenSaved,
- kDontSaveFPRegs,
- EMIT_REMEMBERED_SET,
- smi_check);
- }
+ // Update the write barrier for the array address.
+ // Ok to clobber receiver_reg and name_reg, since we return.
+ __ mov(name_reg, value_reg);
+ __ RecordWriteField(scratch1, index.offset(), name_reg, receiver_reg,
+ kRAHasNotBeenSaved, kDontSaveFPRegs,
+ EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
}
// Return the value (register v0).
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698