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

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

Issue 1167813003: [date] Refactor the %_DateField intrinsic to be optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 5 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/macros.py ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index ef8f981008fd5d9575009f4997f7eab1f5d2c5e8..47975c1d8b1b5c413fa9fe6f9c0f20c1badf3cf4 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -3894,6 +3894,28 @@ void FullCodeGenerator::EmitValueOf(CallRuntime* expr) {
}
+void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) {
+ ZoneList<Expression*>* args = expr->arguments();
+ DCHECK_EQ(1, args->length());
+
+ VisitForAccumulatorValue(args->at(0)); // Load the object.
+
+ Label done, not_date_object;
+ Register object = v0;
+ Register result = v0;
+ Register scratch1 = a1;
+
+ __ JumpIfSmi(object, &not_date_object);
+ __ GetObjectType(object, scratch1, scratch1);
+ __ Branch(&done, eq, scratch1, Operand(JS_DATE_TYPE));
+ __ bind(&not_date_object);
+ __ CallRuntime(Runtime::kThrowNotDateError, 0);
+
+ __ bind(&done);
+ context()->Plug(result);
+}
+
+
void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 2);
@@ -3902,20 +3924,15 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
VisitForAccumulatorValue(args->at(0)); // Load the object.
- Label runtime, done, not_date_object;
Register object = v0;
Register result = v0;
Register scratch0 = t5;
Register scratch1 = a1;
- __ JumpIfSmi(object, &not_date_object);
- __ GetObjectType(object, scratch1, scratch1);
- __ Branch(&not_date_object, ne, scratch1, Operand(JS_DATE_TYPE));
-
if (index->value() == 0) {
__ lw(result, FieldMemOperand(object, JSDate::kValueOffset));
- __ jmp(&done);
} else {
+ Label runtime, done;
if (index->value() < JSDate::kFirstUncachedField) {
ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
__ li(scratch1, Operand(stamp));
@@ -3931,13 +3948,10 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
__ li(a1, Operand(index));
__ Move(a0, object);
__ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
- __ jmp(&done);
+ __ bind(&done);
}
- __ bind(&not_date_object);
- __ CallRuntime(Runtime::kThrowNotDateError, 0);
- __ bind(&done);
- context()->Plug(v0);
+ context()->Plug(result);
}
« no previous file with comments | « src/macros.py ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698