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

Unified Diff: src/arm64/full-codegen-arm64.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/arm/lithium-codegen-arm.cc ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
index 2b5dc6a1b561a2e938dae80e67afa10fd439aaeb..c41c05e0381f8fa9cb0b842aa846e003ecbd1cb4 100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -3618,6 +3618,26 @@ 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 = x0;
+ Register result = x0;
+
+ __ JumpIfSmi(object, &not_date_object);
+ __ JumpIfObjectType(object, x10, x10, JS_DATE_TYPE, &done);
+ __ 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);
@@ -3626,23 +3646,19 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
VisitForAccumulatorValue(args->at(0)); // Load the object.
- Label runtime, done, not_date_object;
Register object = x0;
Register result = x0;
Register stamp_addr = x10;
Register stamp_cache = x11;
- __ JumpIfSmi(object, &not_date_object);
- __ JumpIfNotObjectType(object, x10, x10, JS_DATE_TYPE, &not_date_object);
-
if (index->value() == 0) {
__ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
- __ B(&done);
} else {
+ Label runtime, done;
if (index->value() < JSDate::kFirstUncachedField) {
ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
- __ Mov(x10, stamp);
- __ Ldr(stamp_addr, MemOperand(x10));
+ __ Mov(stamp_addr, stamp);
+ __ Ldr(stamp_addr, MemOperand(stamp_addr));
__ Ldr(stamp_cache, FieldMemOperand(object, JSDate::kCacheStampOffset));
__ Cmp(stamp_addr, stamp_cache);
__ B(ne, &runtime);
@@ -3654,13 +3670,10 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
__ Bind(&runtime);
__ Mov(x1, index);
__ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
- __ B(&done);
+ __ Bind(&done);
}
- __ Bind(&not_date_object);
- __ CallRuntime(Runtime::kThrowNotDateError, 0);
- __ Bind(&done);
- context()->Plug(x0);
+ context()->Plug(result);
}
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698