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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 1645293003: [interpreter] Reachability is implied by live environment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-cleanup-graph-builder-control-flow
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/compiler/bytecode-branch-analysis.h" 7 #include "src/compiler/bytecode-branch-analysis.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/operator-properties.h" 9 #include "src/compiler/operator-properties.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 608
609 609
610 void BytecodeGraphBuilder::VisitBytecodes() { 610 void BytecodeGraphBuilder::VisitBytecodes() {
611 BytecodeBranchAnalysis analysis(bytecode_array(), local_zone()); 611 BytecodeBranchAnalysis analysis(bytecode_array(), local_zone());
612 analysis.Analyze(); 612 analysis.Analyze();
613 set_branch_analysis(&analysis); 613 set_branch_analysis(&analysis);
614 interpreter::BytecodeArrayIterator iterator(bytecode_array()); 614 interpreter::BytecodeArrayIterator iterator(bytecode_array());
615 set_bytecode_iterator(&iterator); 615 set_bytecode_iterator(&iterator);
616 while (!iterator.done()) { 616 while (!iterator.done()) {
617 int current_offset = iterator.current_offset(); 617 int current_offset = iterator.current_offset();
618 if (analysis.is_reachable(current_offset)) { 618 EnterAndExitExceptionHandlers(current_offset);
619 EnterAndExitExceptionHandlers(current_offset); 619 SwitchToMergeEnvironment(current_offset);
620 SwitchToMergeEnvironment(current_offset); 620 if (environment() != nullptr) {
621 BuildLoopHeaderEnvironment(current_offset); 621 BuildLoopHeaderEnvironment(current_offset);
622 622
623 switch (iterator.current_bytecode()) { 623 switch (iterator.current_bytecode()) {
624 #define BYTECODE_CASE(name, ...) \ 624 #define BYTECODE_CASE(name, ...) \
625 case interpreter::Bytecode::k##name: \ 625 case interpreter::Bytecode::k##name: \
626 Visit##name(); \ 626 Visit##name(); \
627 break; 627 break;
628 BYTECODE_LIST(BYTECODE_CASE) 628 BYTECODE_LIST(BYTECODE_CASE)
629 #undef BYTECODE_CODE 629 #undef BYTECODE_CODE
630 } 630 }
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 1862
1863 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { 1863 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) {
1864 if (environment()->IsMarkedAsUnreachable()) return; 1864 if (environment()->IsMarkedAsUnreachable()) return;
1865 environment()->MarkAsUnreachable(); 1865 environment()->MarkAsUnreachable();
1866 exit_controls_.push_back(exit); 1866 exit_controls_.push_back(exit);
1867 } 1867 }
1868 1868
1869 } // namespace compiler 1869 } // namespace compiler
1870 } // namespace internal 1870 } // namespace internal
1871 } // namespace v8 1871 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-branch-analysis.cc ('k') | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698