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 1134973006: [turbofan] Carefully update frame states during inlining. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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/all-nodes.h" 9 #include "src/compiler/all-nodes.h"
10 #include "src/compiler/ast-graph-builder.h" 10 #include "src/compiler/ast-graph-builder.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (call.formal_arguments() != inlinee.formal_parameters()) { 344 if (call.formal_arguments() != inlinee.formal_parameters()) {
345 // In strong mode, in case of too few arguments we need to throw a 345 // In strong mode, in case of too few arguments we need to throw a
346 // TypeError so we must not inline this call. 346 // TypeError so we must not inline this call.
347 if (is_strong(info.language_mode()) && 347 if (is_strong(info.language_mode()) &&
348 call.formal_arguments() < inlinee.formal_parameters()) { 348 call.formal_arguments() < inlinee.formal_parameters()) {
349 return NoChange(); 349 return NoChange();
350 } 350 }
351 outer_frame_state = CreateArgumentsAdaptorFrameState(&call, info.zone()); 351 outer_frame_state = CreateArgumentsAdaptorFrameState(&call, info.zone());
352 } 352 }
353 353
354 for (Node* node : visitor.copies()) { 354 // Fix up all outer frame states from the inlinee.
355 if (node && node->opcode() == IrOpcode::kFrameState) { 355 for (Node* const node : visitor.copies()) {
356 if (node->opcode() == IrOpcode::kFrameState) {
356 DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op())); 357 DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op()));
357 NodeProperties::ReplaceFrameStateInput(node, 0, outer_frame_state); 358 // Don't touch this frame state, if it already has an "outer frame state".
359 if (NodeProperties::GetFrameStateInput(node, 0)->opcode() !=
360 IrOpcode::kFrameState) {
361 NodeProperties::ReplaceFrameStateInput(node, 0, outer_frame_state);
362 }
358 } 363 }
359 } 364 }
360 365
361 return InlineCall(node, inlinee); 366 return InlineCall(node, inlinee);
362 } 367 }
363 368
364 } // namespace compiler 369 } // namespace compiler
365 } // namespace internal 370 } // namespace internal
366 } // namespace v8 371 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698