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

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

Issue 1460503008: [turbofan] Switch passing of new.target to register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-pass-new-target-6
Patch Set: Ported to MIPS64. Created 5 years, 1 month 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/ic/x64/handler-compiler-x64.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/builtins-mips.cc
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
index ef910db4b3f397226a66eebc3ef32cd153736717..6fed89cd566d4af1624b96b7c3535c24b7285787 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -307,14 +307,19 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
static void CallRuntimePassFunction(
MacroAssembler* masm, Runtime::FunctionId function_id) {
+ // ----------- S t a t e -------------
+ // -- a1 : target function (preserved for callee)
+ // -- a3 : new target (preserved for callee)
+ // -----------------------------------
+
FrameScope scope(masm, StackFrame::INTERNAL);
- // Push a copy of the function onto the stack.
- // Push call kind information and function as parameter to the runtime call.
- __ Push(a1, a1);
+ // Push a copy of the target function and the new target.
+ // Push function as parameter to the runtime call.
+ __ Push(a1, a3, a1);
__ CallRuntime(function_id, 1);
- // Restore call kind information and receiver.
- __ Pop(a1);
+ // Restore target function and new target.
+ __ Pop(a1, a3);
}
@@ -547,26 +552,28 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// a0: number of arguments
// a1: constructor function
// a2: address of last argument (caller sp)
- // a3: number of arguments (smi-tagged)
+ // a3: new target
+ // t4: number of arguments (smi-tagged)
// sp[0]: receiver
// sp[1]: receiver
// sp[2]: new.target
// sp[3]: number of arguments (smi-tagged)
Label loop, entry;
- __ SmiTag(a3, a0);
+ __ SmiTag(t4, a0);
__ jmp(&entry);
__ bind(&loop);
- __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize);
+ __ sll(t0, t4, kPointerSizeLog2 - kSmiTagSize);
__ Addu(t0, a2, Operand(t0));
__ lw(t1, MemOperand(t0));
__ push(t1);
__ bind(&entry);
- __ Addu(a3, a3, Operand(-2));
- __ Branch(&loop, greater_equal, a3, Operand(zero_reg));
+ __ Addu(t4, t4, Operand(-2));
+ __ Branch(&loop, greater_equal, t4, Operand(zero_reg));
// Call the function.
// a0: number of arguments
// a1: constructor function
+ // a3: new target
if (is_api_function) {
__ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
Handle<Code> code =
@@ -574,7 +581,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ Call(code, RelocInfo::CODE_TARGET);
} else {
ParameterCount actual(a0);
- __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper());
+ __ InvokeFunction(a1, a3, actual, CALL_FUNCTION, NullCallWrapper());
}
// Store offset of return address for deoptimizer.
@@ -997,8 +1004,9 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
// the runtime:
// a0 - contains return address (beginning of patch sequence)
// a1 - isolate
+ // a3 - new target
RegList saved_regs =
- (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
+ (a0.bit() | a1.bit() | a3.bit() | ra.bit() | fp.bit()) & ~sp.bit();
FrameScope scope(masm, StackFrame::MANUAL);
__ MultiPush(saved_regs);
__ PrepareCallCFunction(2, 0, a2);
@@ -1036,8 +1044,9 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// the runtime:
// a0 - contains return address (beginning of patch sequence)
// a1 - isolate
+ // a3 - new target
RegList saved_regs =
- (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
+ (a0.bit() | a1.bit() | a3.bit() | ra.bit() | fp.bit()) & ~sp.bit();
FrameScope scope(masm, StackFrame::MANUAL);
__ MultiPush(saved_regs);
__ PrepareCallCFunction(2, 0, a2);
@@ -1569,10 +1578,10 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
__ lw(a2,
FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
__ sra(a2, a2, kSmiTagSize); // Un-tag.
- __ lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
+ __ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
ParameterCount actual(a0);
ParameterCount expected(a2);
- __ InvokeCode(a3, expected, actual, JUMP_FUNCTION, NullCallWrapper());
+ __ InvokeCode(t0, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper());
// The function is a "classConstructor", need to raise an exception.
__ bind(&class_constructor);
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698