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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 builder()->SetStatementPosition(stmt); | 826 builder()->SetStatementPosition(stmt); |
827 VisitForEffect(stmt->expression()); | 827 VisitForEffect(stmt->expression()); |
828 } | 828 } |
829 | 829 |
830 | 830 |
831 void BytecodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) { | 831 void BytecodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) { |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 void BytecodeGenerator::VisitIfStatement(IfStatement* stmt) { | 835 void BytecodeGenerator::VisitIfStatement(IfStatement* stmt) { |
| 836 builder()->SetStatementPosition(stmt); |
836 BytecodeLabel else_label, end_label; | 837 BytecodeLabel else_label, end_label; |
837 if (stmt->condition()->ToBooleanIsTrue()) { | 838 if (stmt->condition()->ToBooleanIsTrue()) { |
838 // Generate then block unconditionally as always true. | 839 // Generate then block unconditionally as always true. |
839 Visit(stmt->then_statement()); | 840 Visit(stmt->then_statement()); |
840 } else if (stmt->condition()->ToBooleanIsFalse()) { | 841 } else if (stmt->condition()->ToBooleanIsFalse()) { |
841 // Generate else block unconditionally if it exists. | 842 // Generate else block unconditionally if it exists. |
842 if (stmt->HasElseStatement()) { | 843 if (stmt->HasElseStatement()) { |
843 Visit(stmt->else_statement()); | 844 Visit(stmt->else_statement()); |
844 } | 845 } |
845 } else { | 846 } else { |
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 } | 3139 } |
3139 | 3140 |
3140 | 3141 |
3141 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3142 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3142 return info()->feedback_vector()->GetIndex(slot); | 3143 return info()->feedback_vector()->GetIndex(slot); |
3143 } | 3144 } |
3144 | 3145 |
3145 } // namespace interpreter | 3146 } // namespace interpreter |
3146 } // namespace internal | 3147 } // namespace internal |
3147 } // namespace v8 | 3148 } // namespace v8 |
OLD | NEW |