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

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

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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
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()));

Powered by Google App Engine
This is Rietveld 408576698