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/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
891 } | 891 } |
892 | 892 |
893 | 893 |
894 void BytecodeGenerator::VisitBreakStatement(BreakStatement* stmt) { | 894 void BytecodeGenerator::VisitBreakStatement(BreakStatement* stmt) { |
895 execution_control()->Break(stmt->target()); | 895 execution_control()->Break(stmt->target()); |
896 } | 896 } |
897 | 897 |
898 | 898 |
899 void BytecodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { | 899 void BytecodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { |
900 VisitForAccumulatorValue(stmt->expression()); | 900 VisitForAccumulatorValue(stmt->expression()); |
901 builder()->SetReturnPosition(info_->literal()); | 901 builder()->SetStatementPosition(stmt); |
Yang
2016/02/16 09:22:20
Turns out I've been wrong about setting the return
rmcilroy
2016/02/16 10:46:38
Ack. Note: we will only get a SetReturnPosition no
Yang
2016/02/19 13:09:17
Done.
| |
902 execution_control()->ReturnAccumulator(); | 902 execution_control()->ReturnAccumulator(); |
903 } | 903 } |
904 | 904 |
905 | 905 |
906 void BytecodeGenerator::VisitWithStatement(WithStatement* stmt) { | 906 void BytecodeGenerator::VisitWithStatement(WithStatement* stmt) { |
907 VisitForAccumulatorValue(stmt->expression()); | 907 VisitForAccumulatorValue(stmt->expression()); |
908 builder()->CastAccumulatorToJSObject(); | 908 builder()->CastAccumulatorToJSObject(); |
909 VisitNewLocalWithContext(); | 909 VisitNewLocalWithContext(); |
910 VisitInScope(stmt->statement(), stmt->scope()); | 910 VisitInScope(stmt->statement(), stmt->scope()); |
911 } | 911 } |
(...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3126 } | 3126 } |
3127 | 3127 |
3128 | 3128 |
3129 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3129 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3130 return info()->feedback_vector()->GetIndex(slot); | 3130 return info()->feedback_vector()->GetIndex(slot); |
3131 } | 3131 } |
3132 | 3132 |
3133 } // namespace interpreter | 3133 } // namespace interpreter |
3134 } // namespace internal | 3134 } // namespace internal |
3135 } // namespace v8 | 3135 } // namespace v8 |
OLD | NEW |