PPC: [es6] Re-implement rest parameters via desugaring.

Port 510baeacba

Original commit message:
    Kills the kRestParameter bailout/disabled optimization, and fixes
    lazily parsed arrow functions with rest parameters.

    Supercedes https://crrev.com/1235153006/

R=caitpotter88@gmail.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, dstence@us.ibm.com
BUG=chromium:508074, v8:2160, v8:2700
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30574}
This commit is contained in:
mbrandy 2015-09-03 11:40:09 -07:00 committed by Commit bot
parent e1f38de76a
commit 9628d86085
2 changed files with 0 additions and 48 deletions

View File

@ -290,28 +290,6 @@ void FullCodeGenerator::Generate() {
SetVar(new_target_var, r3, r5, r6);
}
// Possibly allocate RestParameters
int rest_index;
Variable* rest_param = scope()->rest_parameter(&rest_index);
if (rest_param) {
Comment cmnt(masm_, "[ Allocate rest parameter array");
int num_parameters = info->scope()->num_parameters();
int offset = num_parameters * kPointerSize;
__ addi(r6, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset));
__ LoadSmiLiteral(r5, Smi::FromInt(num_parameters));
__ LoadSmiLiteral(r4, Smi::FromInt(rest_index));
__ LoadSmiLiteral(r3, Smi::FromInt(language_mode()));
__ Push(r6, r5, r4, r3);
function_in_register_r4 = false;
RestParamAccessStub stub(isolate());
__ CallStub(&stub);
SetVar(rest_param, r3, r4, r5);
}
Variable* arguments = scope()->arguments();
if (arguments != NULL) {
// Function uses arguments object.

View File

@ -1985,32 +1985,6 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
}
void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
// Stack layout on entry.
// sp[0] : language mode
// sp[4] : index of rest parameter
// sp[8] : number of parameters
// sp[12] : receiver displacement
Label runtime;
__ LoadP(r5, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ LoadP(r6, MemOperand(r5, StandardFrameConstants::kContextOffset));
__ CmpSmiLiteral(r6, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0);
__ bne(&runtime);
// Patch the arguments.length and the parameters pointer.
__ LoadP(r4, MemOperand(r5, ArgumentsAdaptorFrameConstants::kLengthOffset));
__ StoreP(r4, MemOperand(sp, 2 * kPointerSize));
__ SmiToPtrArrayOffset(r6, r4);
__ add(r6, r5, r6);
__ addi(r6, r6, Operand(StandardFrameConstants::kCallerSPOffset));
__ StoreP(r6, MemOperand(sp, 3 * kPointerSize));
__ bind(&runtime);
__ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
}
void RegExpExecStub::Generate(MacroAssembler* masm) {
// Just jump directly to runtime if native RegExp is not selected at compile
// time or if regexp entry in generated code is turned off runtime switch or