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

Side by Side Diff: src/mips64/builtins-mips64.cc

Issue 1698273003: [es6] [interpreter] Add tail calls support to Ignition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-turbo-2
Patch Set: Decreased number of iterations to fix timeouts Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 1061
1062 // Drop receiver + arguments and return. 1062 // Drop receiver + arguments and return.
1063 __ lw(at, FieldMemOperand(kInterpreterBytecodeArrayRegister, 1063 __ lw(at, FieldMemOperand(kInterpreterBytecodeArrayRegister,
1064 BytecodeArray::kParameterSizeOffset)); 1064 BytecodeArray::kParameterSizeOffset));
1065 __ Daddu(sp, sp, at); 1065 __ Daddu(sp, sp, at);
1066 __ Jump(ra); 1066 __ Jump(ra);
1067 } 1067 }
1068 1068
1069 1069
1070 // static 1070 // static
1071 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { 1071 void Builtins::Generate_InterpreterPushArgsAndCallImpl(
1072 MacroAssembler* masm, TailCallMode tail_call_mode) {
1072 // ----------- S t a t e ------------- 1073 // ----------- S t a t e -------------
1073 // -- a0 : the number of arguments (not including the receiver) 1074 // -- a0 : the number of arguments (not including the receiver)
1074 // -- a2 : the address of the first argument to be pushed. Subsequent 1075 // -- a2 : the address of the first argument to be pushed. Subsequent
1075 // arguments should be consecutive above this, in the same order as 1076 // arguments should be consecutive above this, in the same order as
1076 // they are to be pushed onto the stack. 1077 // they are to be pushed onto the stack.
1077 // -- a1 : the target to call (can be any Object). 1078 // -- a1 : the target to call (can be any Object).
1078 // ----------------------------------- 1079 // -----------------------------------
1079 1080
1080 // Find the address of the last argument. 1081 // Find the address of the last argument.
1081 __ Daddu(a3, a0, Operand(1)); // Add one for receiver. 1082 __ Daddu(a3, a0, Operand(1)); // Add one for receiver.
1082 __ dsll(a3, a3, kPointerSizeLog2); 1083 __ dsll(a3, a3, kPointerSizeLog2);
1083 __ Dsubu(a3, a2, Operand(a3)); 1084 __ Dsubu(a3, a2, Operand(a3));
1084 1085
1085 // Push the arguments. 1086 // Push the arguments.
1086 Label loop_header, loop_check; 1087 Label loop_header, loop_check;
1087 __ Branch(&loop_check); 1088 __ Branch(&loop_check);
1088 __ bind(&loop_header); 1089 __ bind(&loop_header);
1089 __ ld(t0, MemOperand(a2)); 1090 __ ld(t0, MemOperand(a2));
1090 __ Daddu(a2, a2, Operand(-kPointerSize)); 1091 __ Daddu(a2, a2, Operand(-kPointerSize));
1091 __ push(t0); 1092 __ push(t0);
1092 __ bind(&loop_check); 1093 __ bind(&loop_check);
1093 __ Branch(&loop_header, gt, a2, Operand(a3)); 1094 __ Branch(&loop_header, gt, a2, Operand(a3));
1094 1095
1095 // Call the target. 1096 // Call the target.
1096 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 1097 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny,
1098 tail_call_mode),
1099 RelocInfo::CODE_TARGET);
1097 } 1100 }
1098 1101
1099 1102
1100 // static 1103 // static
1101 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { 1104 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
1102 // ----------- S t a t e ------------- 1105 // ----------- S t a t e -------------
1103 // -- a0 : argument count (not including receiver) 1106 // -- a0 : argument count (not including receiver)
1104 // -- a3 : new target 1107 // -- a3 : new target
1105 // -- a1 : constructor to call 1108 // -- a1 : constructor to call
1106 // -- a2 : address of the first argument 1109 // -- a2 : address of the first argument
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 Comment cmnt(masm, "[ PrepareForTailCall"); 2073 Comment cmnt(masm, "[ PrepareForTailCall");
2071 2074
2072 // Prepare for tail call only if the debugger is not active. 2075 // Prepare for tail call only if the debugger is not active.
2073 Label done; 2076 Label done;
2074 ExternalReference debug_is_active = 2077 ExternalReference debug_is_active =
2075 ExternalReference::debug_is_active_address(masm->isolate()); 2078 ExternalReference::debug_is_active_address(masm->isolate());
2076 __ li(at, Operand(debug_is_active)); 2079 __ li(at, Operand(debug_is_active));
2077 __ lb(scratch1, MemOperand(at)); 2080 __ lb(scratch1, MemOperand(at));
2078 __ Branch(&done, ne, scratch1, Operand(zero_reg)); 2081 __ Branch(&done, ne, scratch1, Operand(zero_reg));
2079 2082
2083 // Drop possible interpreter handler/stub frame.
2084 {
2085 Label no_interpreter_frame;
2086 __ ld(scratch3, MemOperand(fp, StandardFrameConstants::kMarkerOffset));
2087 __ Branch(&no_interpreter_frame, ne, scratch3,
2088 Operand(Smi::FromInt(StackFrame::STUB)));
2089 __ ld(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2090 __ bind(&no_interpreter_frame);
2091 }
2092
2080 // Check if next frame is an arguments adaptor frame. 2093 // Check if next frame is an arguments adaptor frame.
2081 Label no_arguments_adaptor, formal_parameter_count_loaded; 2094 Label no_arguments_adaptor, formal_parameter_count_loaded;
2082 __ ld(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2095 __ ld(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2083 __ ld(scratch3, MemOperand(scratch2, StandardFrameConstants::kContextOffset)); 2096 __ ld(scratch3, MemOperand(scratch2, StandardFrameConstants::kContextOffset));
2084 __ Branch(&no_arguments_adaptor, ne, scratch3, 2097 __ Branch(&no_arguments_adaptor, ne, scratch3,
2085 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 2098 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
2086 2099
2087 // Drop arguments adaptor frame and load arguments count. 2100 // Drop arguments adaptor frame and load arguments count.
2088 __ mov(fp, scratch2); 2101 __ mov(fp, scratch2);
2089 __ ld(scratch1, 2102 __ ld(scratch1,
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2750 } 2763 }
2751 } 2764 }
2752 2765
2753 2766
2754 #undef __ 2767 #undef __
2755 2768
2756 } // namespace internal 2769 } // namespace internal
2757 } // namespace v8 2770 } // namespace v8
2758 2771
2759 #endif // V8_TARGET_ARCH_MIPS64 2772 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698