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

Unified Diff: src/mips/lithium-codegen-mips.cc

Issue 14607009: MIPS: Use mutable heapnumbers to store doubles in fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/ic-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
index 3d3ef39d20870221b65b2fd51795570060b0cd5d..77e4216f1951d621906db0698358433ead998834 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -2688,31 +2688,20 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
+ int offset = instr->hydrogen()->offset();
Register object = ToRegister(instr->object());
- if (!FLAG_track_double_fields) {
- ASSERT(!instr->hydrogen()->representation().IsDouble());
+ if (instr->hydrogen()->representation().IsDouble()) {
+ DoubleRegister result = ToDoubleRegister(instr->result());
+ __ ldc1(result, FieldMemOperand(object, offset));
+ return;
}
- Register temp = instr->hydrogen()->representation().IsDouble()
- ? scratch0() : ToRegister(instr->result());
+
+ Register result = ToRegister(instr->result());
if (instr->hydrogen()->is_in_object()) {
- __ lw(temp, FieldMemOperand(object, instr->hydrogen()->offset()));
+ __ lw(result, FieldMemOperand(object, offset));
} else {
- __ lw(temp, FieldMemOperand(object, JSObject::kPropertiesOffset));
- __ lw(temp, FieldMemOperand(temp, instr->hydrogen()->offset()));
- }
-
- if (instr->hydrogen()->representation().IsDouble()) {
- Label load_from_heap_number, done;
- DoubleRegister result = ToDoubleRegister(instr->result());
- FPURegister flt_scratch = double_scratch0().low();
- __ JumpIfNotSmi(temp, &load_from_heap_number);
- __ SmiUntag(temp);
- __ mtc1(temp, flt_scratch);
- __ cvt_d_w(result, flt_scratch);
- __ Branch(&done);
- __ bind(&load_from_heap_number);
- __ ldc1(result, FieldMemOperand(temp, HeapNumber::kValueOffset));
- __ bind(&done);
+ __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
+ __ lw(result, FieldMemOperand(result, offset));
}
}
@@ -3911,29 +3900,26 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
Representation representation = instr->representation();
Register object = ToRegister(instr->object());
- Register value = ToRegister(instr->value());
- ASSERT(!object.is(value));
Register scratch = scratch0();
int offset = instr->offset();
+ Handle<Map> transition = instr->transition();
+
if (FLAG_track_fields && representation.IsSmi()) {
+ Register value = ToRegister(instr->value());
__ SmiTagCheckOverflow(value, value, scratch);
if (!instr->hydrogen()->value()->range()->IsInSmiRange()) {
DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
}
- } else if (FLAG_track_double_fields && representation.IsDouble() &&
- !instr->hydrogen()->value()->type().IsSmi() &&
- !instr->hydrogen()->value()->type().IsHeapNumber()) {
- Label do_store;
- __ JumpIfSmi(value, &do_store);
- Handle<Map> map(isolate()->factory()->heap_number_map());
-
- __ lw(scratch, FieldMemOperand(value, HeapObject::kMapOffset));
- DoCheckMapCommon(scratch, map, REQUIRE_EXACT_MAP, instr->environment());
- __ bind(&do_store);
+ } else if (FLAG_track_double_fields && representation.IsDouble()) {
+ ASSERT(transition.is_null());
+ ASSERT(instr->is_in_object());
+ ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
+ DoubleRegister value = ToDoubleRegister(instr->value());
+ __ sdc1(value, FieldMemOperand(object, offset));
+ return;
}
- Handle<Map> transition = instr->transition();
if (!transition.is_null()) {
if (transition->CanBeDeprecated()) {
transition_maps_.Add(transition, info()->zone());
@@ -3955,6 +3941,8 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
}
// Do the store.
+ Register value = ToRegister(instr->value());
+ ASSERT(!object.is(value));
HType type = instr->hydrogen()->value()->type();
SmiCheck check_needed =
type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
@@ -5266,7 +5254,8 @@ void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
// Pick the right runtime function or stub to call.
int properties_count = instr->hydrogen()->constant_properties_length() / 2;
- if (instr->hydrogen()->depth() > 1) {
+ if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles()) ||
+ instr->hydrogen()->depth() > 1) {
__ Push(a3, a2, a1, a0);
CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
} else if (flags != ObjectLiteral::kFastElements ||
« no previous file with comments | « src/mips/ic-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698