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

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

Issue 1469283004: PPC: [turbofan] Switch passing of new.target to register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index 7942a54e21742f63590db8d8eed795efb7849cac..388f72d074c246d34d96be7711ec71388679e6ee 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -305,14 +305,19 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
static void CallRuntimePassFunction(MacroAssembler* masm,
Runtime::FunctionId function_id) {
+ // ----------- S t a t e -------------
+ // -- r4 : target function (preserved for callee)
+ // -- r6 : new target (preserved for callee)
+ // -----------------------------------
+
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
- // Push a copy of the function onto the stack.
+ // Push a copy of the target function and the new target.
// Push function as parameter to the runtime call.
- __ Push(r4, r4);
+ __ Push(r4, r6, r4);
__ CallRuntime(function_id, 1);
- // Restore reciever.
- __ Pop(r4);
+ // Restore target function and new target.
+ __ Pop(r4, r6);
}
@@ -534,6 +539,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// r3: number of arguments
// r4: constructor function
// r5: address of last argument (caller sp)
+ // r6: new target
// cr0: condition indicating whether r3 is zero
// sp[0]: receiver
// sp[1]: receiver
@@ -554,13 +560,14 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// Call the function.
// r3: number of arguments
// r4: constructor function
+ // r6: new target
if (is_api_function) {
__ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
Handle<Code> code = masm->isolate()->builtins()->HandleApiCallConstruct();
__ Call(code, RelocInfo::CODE_TARGET);
} else {
ParameterCount actual(r3);
- __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper());
+ __ InvokeFunction(r4, r6, actual, CALL_FUNCTION, NullCallWrapper());
}
// Store offset of return address for deoptimizer.
@@ -979,15 +986,16 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
// the runtime:
// r3 - contains return address (beginning of patch sequence)
// r4 - isolate
+ // r6 - new target
// lr - return address
FrameScope scope(masm, StackFrame::MANUAL);
__ mflr(r0);
- __ MultiPush(r0.bit() | r3.bit() | r4.bit() | fp.bit());
+ __ MultiPush(r0.bit() | r3.bit() | r4.bit() | r6.bit() | fp.bit());
__ PrepareCallCFunction(2, 0, r5);
__ mov(r4, Operand(ExternalReference::isolate_address(masm->isolate())));
__ CallCFunction(
ExternalReference::get_make_code_young_function(masm->isolate()), 2);
- __ MultiPop(r0.bit() | r3.bit() | r4.bit() | fp.bit());
+ __ MultiPop(r0.bit() | r3.bit() | r4.bit() | r6.bit() | fp.bit());
__ mtlr(r0);
__ mr(ip, r3);
__ Jump(ip);
@@ -1020,16 +1028,17 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// the runtime:
// r3 - contains return address (beginning of patch sequence)
// r4 - isolate
+ // r6 - new target
// lr - return address
FrameScope scope(masm, StackFrame::MANUAL);
__ mflr(r0);
- __ MultiPush(r0.bit() | r3.bit() | r4.bit() | fp.bit());
+ __ MultiPush(r0.bit() | r3.bit() | r4.bit() | r6.bit() | fp.bit());
__ PrepareCallCFunction(2, 0, r5);
__ mov(r4, Operand(ExternalReference::isolate_address(masm->isolate())));
__ CallCFunction(
ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
2);
- __ MultiPop(r0.bit() | r3.bit() | r4.bit() | fp.bit());
+ __ MultiPop(r0.bit() | r3.bit() | r4.bit() | r6.bit() | fp.bit());
__ mtlr(r0);
__ mr(ip, r3);
@@ -1688,10 +1697,10 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
#if !V8_TARGET_ARCH_PPC64
__ SmiUntag(r5);
#endif
- __ LoadP(r6, FieldMemOperand(r4, JSFunction::kCodeEntryOffset));
+ __ LoadP(r7, FieldMemOperand(r4, JSFunction::kCodeEntryOffset));
ParameterCount actual(r3);
ParameterCount expected(r5);
- __ InvokeCode(r6, expected, actual, JUMP_FUNCTION, NullCallWrapper());
+ __ InvokeCode(r7, 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/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698