Index: src/crankshaft/mips/lithium-codegen-mips.cc |
diff --git a/src/crankshaft/mips/lithium-codegen-mips.cc b/src/crankshaft/mips/lithium-codegen-mips.cc |
index 512350f139f2574f7310cd0cbec2e1af9da6bfe7..c039d41fd7c2b2c40476b050bb4bd785a323ac4c 100644 |
--- a/src/crankshaft/mips/lithium-codegen-mips.cc |
+++ b/src/crankshaft/mips/lithium-codegen-mips.cc |
@@ -1659,6 +1659,39 @@ |
} |
+void LCodeGen::DoDateField(LDateField* instr) { |
+ Register object = ToRegister(instr->date()); |
+ Register result = ToRegister(instr->result()); |
+ Register scratch = ToRegister(instr->temp()); |
+ Smi* index = instr->index(); |
+ DCHECK(object.is(a0)); |
+ DCHECK(result.is(v0)); |
+ DCHECK(!scratch.is(scratch0())); |
+ DCHECK(!scratch.is(object)); |
+ |
+ if (index->value() == 0) { |
+ __ lw(result, FieldMemOperand(object, JSDate::kValueOffset)); |
+ } else { |
+ Label runtime, done; |
+ if (index->value() < JSDate::kFirstUncachedField) { |
+ ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
+ __ li(scratch, Operand(stamp)); |
+ __ lw(scratch, MemOperand(scratch)); |
+ __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
+ __ Branch(&runtime, ne, scratch, Operand(scratch0())); |
+ __ lw(result, FieldMemOperand(object, JSDate::kValueOffset + |
+ kPointerSize * index->value())); |
+ __ jmp(&done); |
+ } |
+ __ bind(&runtime); |
+ __ PrepareCallCFunction(2, scratch); |
+ __ li(a1, Operand(index)); |
+ __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
+ __ bind(&done); |
+ } |
+} |
+ |
+ |
MemOperand LCodeGen::BuildSeqStringOperand(Register string, |
LOperand* index, |
String::Encoding encoding) { |