Commit acf3baf4 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Rename original constructor to new target

Port 07c1d181

R=verwaest@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1452213003

Cr-Commit-Position: refs/heads/master@{#32055}
parent d4044588
......@@ -3120,7 +3120,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
// constructor invocation.
SetConstructCallPosition(expr);
// Load original constructor into r7.
// Load new target into r7.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mr(r7, result_register());
......@@ -3858,7 +3858,7 @@ void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
__ push(result_register());
__ mr(r4, result_register());
// Load original constructor into r6.
// Load new target into r6.
__ LoadP(r6, MemOperand(sp, 1 * kPointerSize));
// Check if the calling frame is an arguments adaptor frame.
......
......@@ -222,7 +222,7 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : number of arguments
// -- r4 : constructor function
// -- r6 : original constructor
// -- r6 : new target
// -- lr : return address
// -- sp[(argc - n - 1) * 4] : arg[n] (zero based)
// -- sp[argc * 4] : receiver
......@@ -264,7 +264,7 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ bind(&done_convert);
}
// 3. Check if original constructor and constructor differ.
// 3. Check if new target and constructor differ.
Label new_object;
__ cmp(r4, r6);
__ bne(&new_object);
......@@ -274,7 +274,7 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r5 : the first argument
// -- r4 : constructor function
// -- r6 : original constructor
// -- r6 : new target
// -- lr : return address
// -----------------------------------
__ Allocate(JSValue::kSize, r3, r7, r8, &new_object, TAG_OBJECT);
......@@ -294,7 +294,7 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ bind(&new_object);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r5, r4, r6); // first argument, constructor, original constructor
__ Push(r5, r4, r6); // first argument, constructor, new target
__ CallRuntime(Runtime::kNewObject, 2);
__ Pop(r5);
}
......@@ -355,7 +355,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// -- r3 : number of arguments
// -- r4 : constructor function
// -- r5 : allocation site or undefined
// -- r6 : original constructor
// -- r6 : new target
// -- lr : return address
// -- sp[...]: constructor arguments
// -----------------------------------
......@@ -382,12 +382,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ cmpi(r5, Operand::Zero());
__ bne(&rt_call);
// Verify that the original constructor is a JSFunction.
// Verify that the new target is a JSFunction.
__ CompareObjectType(r6, r8, r7, JS_FUNCTION_TYPE);
__ bne(&rt_call);
// Load the initial map and verify that it is in fact a map.
// r6: original constructor
// r6: new target
__ LoadP(r5,
FieldMemOperand(r6, JSFunction::kPrototypeOrInitialMapOffset));
__ JumpIfSmi(r5, &rt_call);
......@@ -509,16 +509,16 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// r7: JSObject
__ b(&allocated);
// Reload the original constructor and fall-through.
// Reload the new target and fall-through.
__ bind(&rt_call_reload_new_target);
__ LoadP(r6, MemOperand(sp, 0 * kPointerSize));
}
// Allocate the new receiver object using the runtime call.
// r4: constructor function
// r6: original constructor
// r6: new target
__ bind(&rt_call);
__ Push(r4, r6); // constructor function, original constructor
__ Push(r4, r6); // constructor function, new target
__ CallRuntime(Runtime::kNewObject, 2);
__ mr(r7, r3);
......@@ -611,7 +611,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ bind(&exit);
// r3: result
// sp[0]: receiver (newly allocated object)
// sp[1]: new.target (original constructor)
// sp[1]: new.target (new target)
// sp[2]: number of arguments (smi-tagged)
__ LoadP(r4, MemOperand(sp, 2 * kPointerSize));
......@@ -641,7 +641,7 @@ void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) {
// -- r3 : number of arguments
// -- r4 : constructor function
// -- r5 : allocation site or undefined
// -- r6 : original constructor
// -- r6 : new target
// -- lr : return address
// -- sp[...]: constructor arguments
// -----------------------------------
......@@ -1011,7 +1011,7 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argument count (not including receiver)
// -- r6 : original constructor
// -- r6 : new target
// -- r4 : constructor to call
// -- r5 : address of the first argument
// -----------------------------------
......@@ -1732,7 +1732,7 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : the number of arguments (not including the receiver)
// -- r4 : the constructor to call (checked to be a JSFunction)
// -- r6 : the original constructor (checked to be a JSFunction)
// -- r6 : the new target (checked to be a JSFunction)
// -----------------------------------
__ AssertFunction(r4);
__ AssertFunction(r6);
......@@ -1755,7 +1755,7 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : the number of arguments (not including the receiver)
// -- r4 : the constructor to call (checked to be a JSFunctionProxy)
// -- r6 : the original constructor (either the same as the constructor or
// -- r6 : the new target (either the same as the constructor or
// the JSFunction on which new was invoked initially)
// -----------------------------------
......@@ -1770,7 +1770,7 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : the number of arguments (not including the receiver)
// -- r4 : the constructor to call (can be any Object)
// -- r6 : the original constructor (either the same as the constructor or
// -- r6 : the new target (either the same as the constructor or
// the JSFunction on which new was invoked initially)
// -----------------------------------
......
......@@ -2414,7 +2414,7 @@ static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub,
// r4 : the function to call
// r5 : feedback vector
// r6 : slot in feedback vector (Smi)
// r7 : original constructor (for IsSuperConstructorCall)
// r7 : new target (for IsSuperConstructorCall)
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
// Number-of-arguments register must be smi-tagged to call out.
......@@ -2444,7 +2444,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, bool is_super) {
// r4 : the function to call
// r5 : feedback vector
// r6 : slot in feedback vector (Smi)
// r7 : original constructor (for IsSuperConstructorCall)
// r7 : new target (for IsSuperConstructorCall)
Label initialize, done, miss, megamorphic, not_array_function;
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
......@@ -2534,7 +2534,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// r4 : the function to call
// r5 : feedback vector
// r6 : slot in feedback vector (Smi, for RecordCallTarget)
// r7 : original constructor (for IsSuperConstructorCall)
// r7 : new target (for IsSuperConstructorCall)
Label non_function;
// Check that the function is not a smi.
......@@ -2565,7 +2565,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
__ AssertUndefinedOrAllocationSite(r5, r8);
}
// Pass function as original constructor.
// Pass function as new target.
if (IsSuperConstructorCall()) {
__ mr(r6, r7);
} else {
......@@ -5074,7 +5074,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
// -- r3 : argc (only if argument_count() == ANY)
// -- r4 : constructor
// -- r5 : AllocationSite or undefined
// -- r6 : original constructor
// -- r6 : new target
// -- sp[0] : return address
// -- sp[4] : last argument
// -----------------------------------
......
......@@ -187,7 +187,7 @@ void CallConstructDescriptor::InitializePlatformSpecific(
// r4 : the function to call
// r5 : feedback vector
// r6 : slot in feedback vector (Smi, for RecordCallTarget)
// r7 : original constructor (for IsSuperConstructorCall)
// r7 : new target (for IsSuperConstructorCall)
// TODO(turbofan): So far we don't gather type feedback and hence skip the
// slot parameter, but ArrayConstructStub needs the vector to be undefined.
Register registers[] = {r3, r4, r7, r5};
......@@ -409,7 +409,7 @@ void InterpreterPushArgsAndConstructDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {
r3, // argument count (not including receiver)
r6, // original constructor
r6, // new target
r4, // constructor to call
r5 // address of the first argument
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment