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

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

Issue 1693513002: [runtime] Introduce FastNewStrictArgumentsStub to optimize strict arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips and mips64. 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
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 FastNewRestParameterStub stub(isolate()); 273 FastNewRestParameterStub stub(isolate());
274 __ CallStub(&stub); 274 __ CallStub(&stub);
275 function_in_register_a1 = false; 275 function_in_register_a1 = false;
276 SetVar(rest_param, v0, a1, a2); 276 SetVar(rest_param, v0, a1, a2);
277 } 277 }
278 278
279 Variable* arguments = scope()->arguments(); 279 Variable* arguments = scope()->arguments();
280 if (arguments != NULL) { 280 if (arguments != NULL) {
281 // Function uses arguments object. 281 // Function uses arguments object.
282 Comment cmnt(masm_, "[ Allocate arguments object"); 282 Comment cmnt(masm_, "[ Allocate arguments object");
283 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function()));
284 if (!function_in_register_a1) { 283 if (!function_in_register_a1) {
285 // Load this again, if it's used by the local context below. 284 // Load this again, if it's used by the local context below.
286 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 285 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
287 } 286 }
288 // Receiver is just before the parameters on the caller's stack. 287 if (is_strict(language_mode()) || !has_simple_parameters()) {
289 int num_parameters = info->scope()->num_parameters(); 288 FastNewStrictArgumentsStub stub(isolate());
290 int offset = num_parameters * kPointerSize; 289 __ CallStub(&stub);
291 __ li(ArgumentsAccessNewDescriptor::parameter_count(), 290 } else {
292 Operand(Smi::FromInt(num_parameters))); 291 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function()));
293 __ Addu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, 292 // Receiver is just before the parameters on the caller's stack.
294 Operand(StandardFrameConstants::kCallerSPOffset + offset)); 293 int num_parameters = info->scope()->num_parameters();
294 int offset = num_parameters * kPointerSize;
295 __ li(ArgumentsAccessNewDescriptor::parameter_count(),
296 Operand(Smi::FromInt(num_parameters)));
297 __ Addu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp,
298 Operand(StandardFrameConstants::kCallerSPOffset + offset));
295 299
296 // Arguments to ArgumentsAccessStub: 300 // Arguments to ArgumentsAccessStub:
297 // function, parameter pointer, parameter count. 301 // function, parameter pointer, parameter count.
298 // The stub will rewrite parameter pointer and parameter count if the 302 // The stub will rewrite parameter pointer and parameter count if the
299 // previous stack frame was an arguments adapter frame. 303 // previous stack frame was an arguments adapter frame.
300 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); 304 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
301 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( 305 literal()->has_duplicate_parameters());
302 is_unmapped, literal()->has_duplicate_parameters()); 306 ArgumentsAccessStub stub(isolate(), type);
303 ArgumentsAccessStub stub(isolate(), type); 307 __ CallStub(&stub);
304 __ CallStub(&stub); 308 }
305 309
306 SetVar(arguments, v0, a1, a2); 310 SetVar(arguments, v0, a1, a2);
307 } 311 }
308 312
309 if (FLAG_trace) { 313 if (FLAG_trace) {
310 __ CallRuntime(Runtime::kTraceEnter); 314 __ CallRuntime(Runtime::kTraceEnter);
311 } 315 }
312 316
313 // Visit the declarations and body unless there is an illegal 317 // Visit the declarations and body unless there is an illegal
314 // redeclaration. 318 // redeclaration.
(...skipping 4334 matching lines...) Expand 10 before | Expand all | Expand 10 after
4649 reinterpret_cast<uint32_t>( 4653 reinterpret_cast<uint32_t>(
4650 isolate->builtins()->OsrAfterStackCheck()->entry())); 4654 isolate->builtins()->OsrAfterStackCheck()->entry()));
4651 return OSR_AFTER_STACK_CHECK; 4655 return OSR_AFTER_STACK_CHECK;
4652 } 4656 }
4653 4657
4654 4658
4655 } // namespace internal 4659 } // namespace internal
4656 } // namespace v8 4660 } // namespace v8
4657 4661
4658 #endif // V8_TARGET_ARCH_MIPS 4662 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698