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

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

Issue 2263533002: [builtins] Migrate DatePrototype_GetField to TurboFan builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix C call return type Created 4 years, 3 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/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/x64/builtins-x64.cc
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc
index fa2f562feed76e3e660d4773b5cab7130bb36d0d..7c3df945a5d0fe15aa5c76dd09a2231ed961f3dc 100644
--- a/src/builtins/x64/builtins-x64.cc
+++ b/src/builtins/x64/builtins-x64.cc
@@ -1330,70 +1330,6 @@ void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
}
// static
-void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
- int field_index) {
- // ----------- S t a t e -------------
- // -- rax : number of arguments
- // -- rdi : function
- // -- rsi : context
- // -- rsp[0] : return address
- // -- rsp[8] : receiver
- // -----------------------------------
-
- // 1. Load receiver into rax and check that it's actually a JSDate object.
- Label receiver_not_date;
- {
- StackArgumentsAccessor args(rsp, 0);
- __ movp(rax, args.GetReceiverOperand());
- __ JumpIfSmi(rax, &receiver_not_date);
- __ CmpObjectType(rax, JS_DATE_TYPE, rbx);
- __ j(not_equal, &receiver_not_date);
- }
-
- // 2. Load the specified date field, falling back to the runtime as necessary.
- if (field_index == JSDate::kDateValue) {
- __ movp(rax, FieldOperand(rax, JSDate::kValueOffset));
- } else {
- if (field_index < JSDate::kFirstUncachedField) {
- Label stamp_mismatch;
- __ Load(rdx, ExternalReference::date_cache_stamp(masm->isolate()));
- __ cmpp(rdx, FieldOperand(rax, JSDate::kCacheStampOffset));
- __ j(not_equal, &stamp_mismatch, Label::kNear);
- __ movp(rax, FieldOperand(
- rax, JSDate::kValueOffset + field_index * kPointerSize));
- __ ret(1 * kPointerSize);
- __ bind(&stamp_mismatch);
- }
- FrameScope scope(masm, StackFrame::INTERNAL);
- __ PrepareCallCFunction(2);
- __ Move(arg_reg_1, rax);
- __ Move(arg_reg_2, Smi::FromInt(field_index));
- __ CallCFunction(
- ExternalReference::get_date_field_function(masm->isolate()), 2);
- }
- __ ret(1 * kPointerSize);
-
- // 3. Raise a TypeError if the receiver is not a date.
- __ bind(&receiver_not_date);
- {
- FrameScope scope(masm, StackFrame::MANUAL);
- __ Move(rbx, Smi::FromInt(0));
- __ EnterBuiltinFrame(rsi, rdi, rbx);
- __ CallRuntime(Runtime::kThrowNotDateError);
-
- // It's far from obvious, but this final trailing instruction after the call
- // is required for StackFrame::LookupCode to work correctly. To illustrate
- // why: if call were the final instruction in the code object, then the pc
- // (== return address) would point beyond the code object when the stack is
- // traversed. When we then try to look up the code object through
- // StackFrame::LookupCode, we actually return the next code object that
- // happens to be on the same page in memory.
- // TODO(jgruber): A proper fix for this would be nice.
- __ int3();
- }
-}
-
-// static
void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : argc
« no previous file with comments | « src/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698