Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index a594c6628eb7b075e30e979f8ea903e8fc40d323..5ba7154e51ab56a3d8a2f57030421819a74be0d0 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -1279,6 +1279,25 @@ void LCodeGen::DoValueOf(LValueOf* instr) { |
} |
+void LCodeGen::DoDateField(LDateField* instr) { |
+ Register input = ToRegister(instr->InputAt(0)); |
+ Register result = ToRegister(instr->result()); |
+ Register map = ToRegister(instr->TempAt(0)); |
+ ASSERT(input.is(result)); |
+ Label done; |
+ // If the object is a smi return the object. |
+ __ JumpIfSmi(input, &done, Label::kNear); |
ulan
2012/01/25 13:08:48
See comments in full-codegen-ia32.cc
rossberg
2012/01/25 15:48:37
Done.
|
+ |
+ // If the object is not a value type, return the object. |
+ __ CmpObjectType(input, JS_DATE_TYPE, map); |
+ __ j(not_equal, &done, Label::kNear); |
+ __ mov(result, |
+ FieldOperand(input, JSDate::kYearOffset + kPointerSize * instr->index())); |
+ |
+ __ bind(&done); |
+} |
+ |
+ |
void LCodeGen::DoBitNotI(LBitNotI* instr) { |
LOperand* input = instr->InputAt(0); |
ASSERT(input->Equals(instr->result())); |