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/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 explicit ControlScopeForTopLevel(BytecodeGenerator* generator) | 211 explicit ControlScopeForTopLevel(BytecodeGenerator* generator) |
212 : ControlScope(generator) {} | 212 : ControlScope(generator) {} |
213 | 213 |
214 protected: | 214 protected: |
215 bool Execute(Command command, Statement* statement) override { | 215 bool Execute(Command command, Statement* statement) override { |
216 switch (command) { | 216 switch (command) { |
217 case CMD_BREAK: // We should never see break/continue in top-level. | 217 case CMD_BREAK: // We should never see break/continue in top-level. |
218 case CMD_CONTINUE: | 218 case CMD_CONTINUE: |
219 UNREACHABLE(); | 219 UNREACHABLE(); |
220 case CMD_RETURN: | 220 case CMD_RETURN: |
| 221 generator()->builder()->SetReturnPosition(); |
221 generator()->builder()->Return(); | 222 generator()->builder()->Return(); |
222 return true; | 223 return true; |
223 case CMD_RETHROW: | 224 case CMD_RETHROW: |
224 generator()->builder()->ReThrow(); | 225 generator()->builder()->ReThrow(); |
225 return true; | 226 return true; |
226 } | 227 } |
227 return false; | 228 return false; |
228 } | 229 } |
229 }; | 230 }; |
230 | 231 |
(...skipping 3043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3274 } | 3275 } |
3275 | 3276 |
3276 | 3277 |
3277 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3278 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3278 return info()->shared_info()->feedback_vector()->GetIndex(slot); | 3279 return info()->shared_info()->feedback_vector()->GetIndex(slot); |
3279 } | 3280 } |
3280 | 3281 |
3281 } // namespace interpreter | 3282 } // namespace interpreter |
3282 } // namespace internal | 3283 } // namespace internal |
3283 } // namespace v8 | 3284 } // namespace v8 |
OLD | NEW |