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

Unified Diff: src/arm64/builtins-arm64.cc

Issue 1567353002: [date] Migrate Date field accessors to native builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar work. ports. Created 4 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
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/builtins-arm64.cc
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc
index d1ad6f9c918ae32183a1c6dccb5d825e9b333288..898c7ba331af76081bb3aeab87547396f8f6dc31 100644
--- a/src/arm64/builtins-arm64.cc
+++ b/src/arm64/builtins-arm64.cc
@@ -1355,6 +1355,52 @@ void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) {
// static
+void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
+ int field_index) {
+ // ----------- S t a t e -------------
+ // -- lr : return address
+ // -- jssp[0] : receiver
+ // -----------------------------------
+ ASM_LOCATION("Builtins::Generate_DatePrototype_GetField");
+
+ // 1. Pop receiver into x0 and check that it's actually a JSDate object.
+ Label receiver_not_date;
+ {
+ __ Pop(x0);
+ __ JumpIfSmi(x0, &receiver_not_date);
+ __ JumpIfNotObjectType(x0, x1, x2, JS_DATE_TYPE, &receiver_not_date);
+ }
+
+ // 2. Load the specified date field, falling back to the runtime as necessary.
+ if (field_index == JSDate::kDateValue) {
+ __ Ldr(x0, FieldMemOperand(x0, JSDate::kValueOffset));
+ } else {
+ if (field_index < JSDate::kFirstUncachedField) {
+ Label stamp_mismatch;
+ __ Mov(x1, ExternalReference::date_cache_stamp(masm->isolate()));
+ __ Ldr(x1, MemOperand(x1));
+ __ Ldr(x2, FieldMemOperand(x0, JSDate::kCacheStampOffset));
+ __ Cmp(x1, x2);
+ __ B(ne, &stamp_mismatch);
+ __ Ldr(x0, FieldMemOperand(
+ x0, JSDate::kValueOffset + field_index * kPointerSize));
+ __ Ret();
+ __ Bind(&stamp_mismatch);
+ }
+ FrameScope scope(masm, StackFrame::INTERNAL);
+ __ Mov(x1, Smi::FromInt(field_index));
+ __ CallCFunction(
+ ExternalReference::get_date_field_function(masm->isolate()), 2);
+ }
+ __ Ret();
+
+ // 3. Raise a TypeError if the receiver is not a date.
+ __ Bind(&receiver_not_date);
+ __ TailCallRuntime(Runtime::kThrowNotDateError);
+}
+
+
+// static
void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : argc
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698