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

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

Issue 1447443002: [turbofan] Ensure inlined constructor calls still throw. (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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/js-typed-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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 447
448 // Insert nodes around the call that model the behavior required for a 448 // Insert nodes around the call that model the behavior required for a
449 // constructor dispatch and turn the constructor call into a regular call. 449 // constructor dispatch and turn the constructor call into a regular call.
450 // This models the behavior usually accomplished by our {JSConstructStub}. 450 // This models the behavior usually accomplished by our {JSConstructStub}.
451 // Note that the context has to be the callers context (input to call node). 451 // Note that the context has to be the callers context (input to call node).
452 if (node->opcode() == IrOpcode::kJSCallConstruct) { 452 if (node->opcode() == IrOpcode::kJSCallConstruct) {
453 Node* effect = NodeProperties::GetEffectInput(node); 453 Node* effect = NodeProperties::GetEffectInput(node);
454 Node* context = NodeProperties::GetContextInput(node); 454 Node* context = NodeProperties::GetContextInput(node);
455 Node* create = jsgraph_->graph()->NewNode(jsgraph_->javascript()->Create(), 455 Node* create = jsgraph_->graph()->NewNode(jsgraph_->javascript()->Create(),
456 call.target(), call.new_target(), 456 call.target(), call.new_target(),
457 context, effect); 457 context, frame_state, effect);
458 NodeProperties::ReplaceEffectInput(node, create); 458 NodeProperties::ReplaceEffectInput(node, create);
459 // TODO(4544): For now Runtime_GetNewTarget depends on the actual target to 459 // TODO(4544): For now Runtime_GetNewTarget depends on the actual target to
460 // coincide with the new target. Fix this! 460 // coincide with the new target. Fix this!
461 CHECK_EQ(call.target(), call.new_target()); 461 CHECK_EQ(call.target(), call.new_target());
462 // TODO(4544): For derived constructors we should not allocate an implicit 462 // TODO(4544): For derived constructors we should not allocate an implicit
463 // receiver and also the return value should not be checked afterwards. 463 // receiver and also the return value should not be checked afterwards.
464 CHECK(!IsClassConstructor(function->shared()->kind())); 464 CHECK(!IsClassConstructor(function->shared()->kind()));
465 // Swizzle the inputs of the {JSCallConstruct} node to look like inputs to 465 // Swizzle the inputs of the {JSCallConstruct} node to look like inputs to
466 // any {JSCallFunction} node so that the rest of the inlining machinery 466 // any {JSCallFunction} node so that the rest of the inlining machinery
467 // behaves as if we were dealing with a regular function invocation. 467 // behaves as if we were dealing with a regular function invocation.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 node, frame_state, call.formal_arguments(), 517 node, frame_state, call.formal_arguments(),
518 FrameStateType::kArgumentsAdaptor, info.shared_info()); 518 FrameStateType::kArgumentsAdaptor, info.shared_info());
519 } 519 }
520 520
521 return InlineCall(node, context, frame_state, start, end); 521 return InlineCall(node, context, frame_state, start, end);
522 } 522 }
523 523
524 } // namespace compiler 524 } // namespace compiler
525 } // namespace internal 525 } // namespace internal
526 } // namespace v8 526 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698