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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1137703002: Add a MathFloor stub generated with TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ARM + co. Created 5 years, 7 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/compiler/access-builder.cc ('k') | src/compiler/js-intrinsic-lowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 88422886edeea86ac4d6e8ab9d48cee772484d04..e52b8576c4822e4c5ea561870439aa8d32fc1c52 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -429,7 +429,7 @@ void AstGraphBuilder::CreateFunctionContext(bool constant_context) {
Node* AstGraphBuilder::NewOuterContextParam() {
// Parameter (arity + 1) is special for the outer context of the function
const Operator* op =
- common()->Parameter(info()->num_parameters() + 1, "%context");
+ common()->Parameter(info()->num_parameters_including_this(), "%context");
return NewNode(op, graph()->start());
}
@@ -437,8 +437,8 @@ Node* AstGraphBuilder::NewOuterContextParam() {
Node* AstGraphBuilder::NewCurrentContextOsrValue() {
// TODO(titzer): use a real OSR value here; a parameter works by accident.
// Parameter (arity + 1) is special for the outer context of the function
- const Operator* op =
- common()->Parameter(info()->num_parameters() + 1, "%osr-context");
+ const Operator* op = common()->Parameter(
+ info()->num_parameters_including_this(), "%osr-context");
return NewNode(op, graph()->start());
}
@@ -615,16 +615,22 @@ AstGraphBuilder::Environment::Environment(AstGraphBuilder* builder,
DCHECK_EQ(scope->num_parameters() + 1, parameters_count());
// Bind the receiver variable.
- Node* receiver = builder->graph()->NewNode(common()->Parameter(0, "%this"),
- builder->graph()->start());
- values()->push_back(receiver);
+ int param_num = 0;
+ if (builder->info()->is_this_defined()) {
+ Node* receiver = builder->graph()->NewNode(
+ common()->Parameter(param_num++, "%this"), builder->graph()->start());
+ values()->push_back(receiver);
+ } else {
+ values()->push_back(builder->jsgraph()->UndefinedConstant());
+ }
// Bind all parameter variables. The parameter indices are shifted by 1
// (receiver is parameter index -1 but environment index 0).
for (int i = 0; i < scope->num_parameters(); ++i) {
const char* debug_name = GetDebugParameterName(graph()->zone(), scope, i);
- Node* parameter = builder->graph()->NewNode(
- common()->Parameter(i + 1, debug_name), builder->graph()->start());
+ Node* parameter =
+ builder->graph()->NewNode(common()->Parameter(param_num++, debug_name),
+ builder->graph()->start());
values()->push_back(parameter);
}
« no previous file with comments | « src/compiler/access-builder.cc ('k') | src/compiler/js-intrinsic-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698