OLD | NEW |
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 void TryCatchBuilder::BeginTry(Register context) { | 136 void TryCatchBuilder::BeginTry(Register context) { |
137 builder()->MarkTryBegin(handler_id_, context); | 137 builder()->MarkTryBegin(handler_id_, context); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 void TryCatchBuilder::EndTry() { | 141 void TryCatchBuilder::EndTry() { |
142 builder()->MarkTryEnd(handler_id_); | 142 builder()->MarkTryEnd(handler_id_); |
143 builder()->Jump(&exit_); | 143 builder()->Jump(&exit_); |
144 builder()->Bind(&handler_); | 144 builder()->Bind(&handler_); |
145 builder()->MarkHandler(handler_id_, true); | 145 builder()->MarkHandler(handler_id_, catch_predicted_); |
146 } | 146 } |
147 | 147 |
148 | 148 |
149 void TryCatchBuilder::EndCatch() { builder()->Bind(&exit_); } | 149 void TryCatchBuilder::EndCatch() { builder()->Bind(&exit_); } |
150 | 150 |
151 | 151 |
152 void TryFinallyBuilder::BeginTry(Register context) { | 152 void TryFinallyBuilder::BeginTry(Register context) { |
153 builder()->MarkTryBegin(handler_id_, context); | 153 builder()->MarkTryBegin(handler_id_, context); |
154 } | 154 } |
155 | 155 |
156 | 156 |
157 void TryFinallyBuilder::LeaveTry() { | 157 void TryFinallyBuilder::LeaveTry() { |
158 finalization_sites_.push_back(BytecodeLabel()); | 158 finalization_sites_.push_back(BytecodeLabel()); |
159 builder()->Jump(&finalization_sites_.back()); | 159 builder()->Jump(&finalization_sites_.back()); |
160 } | 160 } |
161 | 161 |
162 | 162 |
163 void TryFinallyBuilder::EndTry() { | 163 void TryFinallyBuilder::EndTry() { |
164 builder()->MarkTryEnd(handler_id_); | 164 builder()->MarkTryEnd(handler_id_); |
165 } | 165 } |
166 | 166 |
167 | 167 |
168 void TryFinallyBuilder::BeginHandler() { | 168 void TryFinallyBuilder::BeginHandler() { |
169 builder()->Bind(&handler_); | 169 builder()->Bind(&handler_); |
170 builder()->MarkHandler(handler_id_, will_catch_); | 170 builder()->MarkHandler(handler_id_, catch_predicted_); |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 void TryFinallyBuilder::BeginFinally() { | 174 void TryFinallyBuilder::BeginFinally() { |
175 for (size_t i = 0; i < finalization_sites_.size(); i++) { | 175 for (size_t i = 0; i < finalization_sites_.size(); i++) { |
176 BytecodeLabel& site = finalization_sites_.at(i); | 176 BytecodeLabel& site = finalization_sites_.at(i); |
177 builder()->Bind(&site); | 177 builder()->Bind(&site); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 | 181 |
182 void TryFinallyBuilder::EndFinally() { | 182 void TryFinallyBuilder::EndFinally() { |
183 // Nothing to be done here. | 183 // Nothing to be done here. |
184 } | 184 } |
185 | 185 |
186 } // namespace interpreter | 186 } // namespace interpreter |
187 } // namespace internal | 187 } // namespace internal |
188 } // namespace v8 | 188 } // namespace v8 |
OLD | NEW |