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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.cc

Issue 1696063002: X87: [runtime] Optimize and unify rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 if (new_target_var != nullptr) { 242 if (new_target_var != nullptr) {
243 Comment cmnt(masm_, "[ new.target"); 243 Comment cmnt(masm_, "[ new.target");
244 SetVar(new_target_var, edx, ebx, ecx); 244 SetVar(new_target_var, edx, ebx, ecx);
245 } 245 }
246 246
247 // Possibly allocate RestParameters 247 // Possibly allocate RestParameters
248 int rest_index; 248 int rest_index;
249 Variable* rest_param = scope()->rest_parameter(&rest_index); 249 Variable* rest_param = scope()->rest_parameter(&rest_index);
250 if (rest_param) { 250 if (rest_param) {
251 Comment cmnt(masm_, "[ Allocate rest parameter array"); 251 Comment cmnt(masm_, "[ Allocate rest parameter array");
252 252 if (!function_in_register) {
253 int num_parameters = info->scope()->num_parameters(); 253 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
254 int offset = num_parameters * kPointerSize; 254 }
255 255 FastNewRestParameterStub stub(isolate());
256 __ mov(RestParamAccessDescriptor::parameter_count(), 256 __ CallStub(&stub);
257 Immediate(Smi::FromInt(num_parameters)));
258 __ lea(RestParamAccessDescriptor::parameter_pointer(),
259 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset));
260 __ mov(RestParamAccessDescriptor::rest_parameter_index(),
261 Immediate(Smi::FromInt(rest_index)));
262 function_in_register = false; 257 function_in_register = false;
263
264 RestParamAccessStub stub(isolate());
265 __ CallStub(&stub);
266 SetVar(rest_param, eax, ebx, edx); 258 SetVar(rest_param, eax, ebx, edx);
267 } 259 }
268 260
269 Variable* arguments = scope()->arguments(); 261 Variable* arguments = scope()->arguments();
270 if (arguments != NULL) { 262 if (arguments != NULL) {
271 // Function uses arguments object. 263 // Function uses arguments object.
272 Comment cmnt(masm_, "[ Allocate arguments object"); 264 Comment cmnt(masm_, "[ Allocate arguments object");
273 DCHECK(edi.is(ArgumentsAccessNewDescriptor::function())); 265 DCHECK(edi.is(ArgumentsAccessNewDescriptor::function()));
274 if (!function_in_register) { 266 if (!function_in_register) {
275 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 267 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
(...skipping 4222 matching lines...) Expand 10 before | Expand all | Expand 10 after
4498 Assembler::target_address_at(call_target_address, 4490 Assembler::target_address_at(call_target_address,
4499 unoptimized_code)); 4491 unoptimized_code));
4500 return OSR_AFTER_STACK_CHECK; 4492 return OSR_AFTER_STACK_CHECK;
4501 } 4493 }
4502 4494
4503 4495
4504 } // namespace internal 4496 } // namespace internal
4505 } // namespace v8 4497 } // namespace v8
4506 4498
4507 #endif // V8_TARGET_ARCH_X87 4499 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698