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

Side by Side Diff: src/interpreter/control-flow-builders.cc

Issue 1531693002: [Interpreter] Implement ForIn in bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0009-phi
Patch Set: Minor clean-up/simplication in Runtime_InterpreterForInPrepare. Created 4 years, 12 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 | « src/interpreter/control-flow-builders.h ('k') | src/interpreter/interpreter.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 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/interpreter/control-flow-builders.h" 5 #include "src/interpreter/control-flow-builders.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 void BlockBuilder::EndBlock() { 84 void BlockBuilder::EndBlock() {
85 builder()->Bind(&block_end_); 85 builder()->Bind(&block_end_);
86 SetBreakTarget(block_end_); 86 SetBreakTarget(block_end_);
87 } 87 }
88 88
89 89
90 LoopBuilder::~LoopBuilder() { DCHECK(continue_sites_.empty()); } 90 LoopBuilder::~LoopBuilder() { DCHECK(continue_sites_.empty()); }
91 91
92 92
93 void LoopBuilder::LoopHeader() {
94 // Jumps from before the loop header into the loop violate ordering
95 // requirements of bytecode basic blocks. The only entry into a loop
96 // must be the loop header. Surely breaks is okay? Not if nested
97 // and misplaced between the headers.
98 DCHECK(break_sites_.empty() && continue_sites_.empty());
99 builder()->Bind(&loop_header_);
100 }
101
102
93 void LoopBuilder::EndLoop() { 103 void LoopBuilder::EndLoop() {
94 // Loop must have closed form, i.e. all loop elements are within the loop, 104 // Loop must have closed form, i.e. all loop elements are within the loop,
95 // the loop header precedes the body and next elements in the loop. 105 // the loop header precedes the body and next elements in the loop.
96 DCHECK(loop_header_.is_bound()); 106 DCHECK(loop_header_.is_bound());
97 builder()->Bind(&loop_end_); 107 builder()->Bind(&loop_end_);
98 SetBreakTarget(loop_end_); 108 SetBreakTarget(loop_end_);
99 if (next_.is_bound()) { 109 if (next_.is_bound()) {
100 DCHECK(!condition_.is_bound() || next_.offset() >= condition_.offset()); 110 DCHECK(!condition_.is_bound() || next_.offset() >= condition_.offset());
101 SetContinueTarget(next_); 111 SetContinueTarget(next_);
102 } else { 112 } else {
(...skipping 20 matching lines...) Expand all
123 133
124 134
125 void SwitchBuilder::SetCaseTarget(int index) { 135 void SwitchBuilder::SetCaseTarget(int index) {
126 BytecodeLabel& site = case_sites_.at(index); 136 BytecodeLabel& site = case_sites_.at(index);
127 builder()->Bind(&site); 137 builder()->Bind(&site);
128 } 138 }
129 139
130 } // namespace interpreter 140 } // namespace interpreter
131 } // namespace internal 141 } // namespace internal
132 } // namespace v8 142 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/control-flow-builders.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698