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

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

Issue 1461973002: [turbofan] Make new.target explicit in JSCallDescriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/ast-graph-builder.cc ('k') | src/compiler/js-frame-specialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 5ec3e67e4220f8225e6532290848f7442da7f7ad..7a8b6049e8bc6b25442bc350d0b210402e9fbb47 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -113,9 +113,9 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(Zone* local_zone,
Node* BytecodeGraphBuilder::GetFunctionContext() {
if (!function_context_.is_set()) {
- // Parameter (arity + 1) is special for the outer context of the function
- const Operator* op = common()->Parameter(
- bytecode_array()->parameter_count() + 1, "%context");
+ int params = bytecode_array()->parameter_count();
+ int index = Linkage::GetJSCallContextParamIndex(params);
+ const Operator* op = common()->Parameter(index, "%context");
Node* node = NewNode(op, graph()->start());
function_context_.set(node);
}
@@ -125,8 +125,8 @@ Node* BytecodeGraphBuilder::GetFunctionContext() {
Node* BytecodeGraphBuilder::GetFunctionClosure() {
if (!function_closure_.is_set()) {
- const Operator* op = common()->Parameter(
- Linkage::kJSFunctionCallClosureParamIndex, "%closure");
+ int index = Linkage::kJSCallClosureParamIndex;
+ const Operator* op = common()->Parameter(index, "%closure");
Node* node = NewNode(op, graph()->start());
function_closure_.set(node);
}
@@ -180,9 +180,9 @@ bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
// closure.
// Set up the basic structure of the graph. Outputs for {Start} are the formal
- // parameters (including the receiver) plus number of arguments, context and
- // closure.
- int actual_parameter_count = bytecode_array()->parameter_count() + 3;
+ // parameters (including the receiver) plus new target, number of arguments,
+ // context and closure.
+ int actual_parameter_count = bytecode_array()->parameter_count() + 4;
graph()->SetStart(graph()->NewNode(common()->Start(actual_parameter_count)));
Environment env(this, bytecode_array()->register_count(),
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-frame-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698