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

Unified Diff: src/full-codegen/arm64/full-codegen-arm64.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/arm64/full-codegen-arm64.cc
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc
index 96fd06a7666fecb77f6849ccf371f087bf6e0cb0..48fe3124c328082fcdd3cfaccc9fc50f0aa7b71d 100644
--- a/src/full-codegen/arm64/full-codegen-arm64.cc
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc
@@ -274,28 +274,32 @@ void FullCodeGenerator::Generate() {
if (arguments != NULL) {
// Function uses arguments object.
Comment cmnt(masm_, "[ Allocate arguments object");
- DCHECK(x1.is(ArgumentsAccessNewDescriptor::function()));
if (!function_in_register_x1) {
// Load this again, if it's used by the local context below.
__ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
}
- // Receiver is just before the parameters on the caller's stack.
- int num_parameters = info->scope()->num_parameters();
- int offset = num_parameters * kPointerSize;
- __ Mov(ArgumentsAccessNewDescriptor::parameter_count(),
- Smi::FromInt(num_parameters));
- __ Add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp,
- StandardFrameConstants::kCallerSPOffset + offset);
-
- // Arguments to ArgumentsAccessStub:
- // function, parameter pointer, parameter count.
- // The stub will rewrite parameter pointer and parameter count if the
- // previous stack frame was an arguments adapter frame.
- bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters();
- ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
- is_unmapped, literal()->has_duplicate_parameters());
- ArgumentsAccessStub stub(isolate(), type);
- __ CallStub(&stub);
+ if (is_strict(language_mode()) || !has_simple_parameters()) {
+ FastNewStrictArgumentsStub stub(isolate());
+ __ CallStub(&stub);
+ } else {
+ DCHECK(x1.is(ArgumentsAccessNewDescriptor::function()));
+ // Receiver is just before the parameters on the caller's stack.
+ int num_parameters = info->scope()->num_parameters();
+ int offset = num_parameters * kPointerSize;
+ __ Mov(ArgumentsAccessNewDescriptor::parameter_count(),
+ Smi::FromInt(num_parameters));
+ __ Add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp,
+ StandardFrameConstants::kCallerSPOffset + offset);
+
+ // Arguments to ArgumentsAccessStub:
+ // function, parameter pointer, parameter count.
+ // The stub will rewrite parameter pointer and parameter count if the
+ // previous stack frame was an arguments adapter frame.
+ ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
+ literal()->has_duplicate_parameters());
+ ArgumentsAccessStub stub(isolate(), type);
+ __ CallStub(&stub);
+ }
SetVar(arguments, x0, x1, x2);
}
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698