Skip to content

Commit e5ee42f

Browse files
cdai2Commit bot
authored andcommitted
X87: [es6] Re-implement rest parameters via desugaring.
port 510baea (r30550) original commit message: Kills the kRestParameter bailout/disabled optimization, and fixes lazily parsed arrow functions with rest parameters. Supercedes https://crrev.com/1235153006/ BUG= Review URL: https://codereview.chromium.org/1305943008 Cr-Commit-Position: refs/heads/master@{#30608}
1 parent ce1059f commit e5ee42f

2 files changed

Lines changed: 0 additions & 49 deletions

File tree

src/full-codegen/x87/full-codegen-x87.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -276,29 +276,6 @@ void FullCodeGenerator::Generate() {
276276
SetVar(new_target_var, eax, ebx, edx);
277277
}
278278

279-
280-
// Possibly allocate RestParameters
281-
int rest_index;
282-
Variable* rest_param = scope()->rest_parameter(&rest_index);
283-
if (rest_param) {
284-
Comment cmnt(masm_, "[ Allocate rest parameter array");
285-
286-
int num_parameters = info->scope()->num_parameters();
287-
int offset = num_parameters * kPointerSize;
288-
289-
__ lea(edx,
290-
Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset));
291-
__ push(edx);
292-
__ push(Immediate(Smi::FromInt(num_parameters)));
293-
__ push(Immediate(Smi::FromInt(rest_index)));
294-
__ push(Immediate(Smi::FromInt(language_mode())));
295-
296-
RestParamAccessStub stub(isolate());
297-
__ CallStub(&stub);
298-
299-
SetVar(rest_param, eax, ebx, edx);
300-
}
301-
302279
Variable* arguments = scope()->arguments();
303280
if (arguments != NULL) {
304281
// Function uses arguments object.

src/x87/code-stubs-x87.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -842,32 +842,6 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
842842
}
843843

844844

845-
void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
846-
// esp[0] : return address
847-
// esp[4] : language mode
848-
// esp[8] : index of rest parameter
849-
// esp[12] : number of parameters
850-
// esp[16] : receiver displacement
851-
852-
// Check if the calling frame is an arguments adaptor frame.
853-
Label runtime;
854-
__ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
855-
__ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
856-
__ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
857-
__ j(not_equal, &runtime);
858-
859-
// Patch the arguments.length and the parameters pointer.
860-
__ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
861-
__ mov(Operand(esp, 3 * kPointerSize), ecx);
862-
__ lea(edx, Operand(edx, ecx, times_2,
863-
StandardFrameConstants::kCallerSPOffset));
864-
__ mov(Operand(esp, 4 * kPointerSize), edx);
865-
866-
__ bind(&runtime);
867-
__ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
868-
}
869-
870-
871845
void RegExpExecStub::Generate(MacroAssembler* masm) {
872846
// Just jump directly to runtime if native RegExp is not selected at compile
873847
// time or if regexp entry in generated code is turned off runtime switch or

0 commit comments

Comments
 (0)