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

Side by Side Diff: src/compiler/js-inlining.cc

Issue 1412223015: [turbofan] Fix receiver binding for inlined callees. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-intrinsic-lowering.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/compiler/js-inlining.h" 5 #include "src/compiler/js-inlining.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/compiler/all-nodes.h" 10 #include "src/compiler/all-nodes.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 // Insert argument adaptor frame if required. The callees formal parameter 414 // Insert argument adaptor frame if required. The callees formal parameter
415 // count (i.e. value outputs of start node minus target, receiver & context) 415 // count (i.e. value outputs of start node minus target, receiver & context)
416 // have to match the number of arguments passed to the call. 416 // have to match the number of arguments passed to the call.
417 DCHECK_EQ(static_cast<int>(parameter_count), 417 DCHECK_EQ(static_cast<int>(parameter_count),
418 start->op()->ValueOutputCount() - 3); 418 start->op()->ValueOutputCount() - 3);
419 if (call.formal_arguments() != parameter_count) { 419 if (call.formal_arguments() != parameter_count) {
420 frame_state = CreateArgumentsAdaptorFrameState(&call, info.shared_info()); 420 frame_state = CreateArgumentsAdaptorFrameState(&call, info.shared_info());
421 } 421 }
422 422
423 // Insert a JSConvertReceiver node for sloppy callees. Note that the context
424 // passed into this node has to be the callees context (loaded above).
425 if (is_sloppy(info.language_mode()) && !function->shared()->native()) {
426 const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
427 Node* effect = NodeProperties::GetEffectInput(node);
428 Node* convert = jsgraph_->graph()->NewNode(
429 jsgraph_->javascript()->ConvertReceiver(p.convert_mode()),
430 call.receiver(), context, frame_state, effect, start);
431 NodeProperties::ReplaceValueInput(node, convert, 1);
432 NodeProperties::ReplaceEffectInput(node, convert);
433 }
434
423 return InlineCall(node, context, frame_state, start, end); 435 return InlineCall(node, context, frame_state, start, end);
424 } 436 }
425 437
426 } // namespace compiler 438 } // namespace compiler
427 } // namespace internal 439 } // namespace internal
428 } // namespace v8 440 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698