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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 } | 893 } |
894 | 894 |
895 | 895 |
896 void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { | 896 void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
897 UNIMPLEMENTED(); | 897 UNIMPLEMENTED(); |
898 } | 898 } |
899 | 899 |
900 | 900 |
901 void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { | 901 void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { |
902 TryCatchBuilder try_control_builder(builder()); | 902 TryCatchBuilder try_control_builder(builder()); |
903 if (!FLAG_ignition_fake_try_catch) UNIMPLEMENTED(); | |
904 | 903 |
905 // Preserve the context in a dedicated register, so that it can be restored | 904 // Preserve the context in a dedicated register, so that it can be restored |
906 // when the handler is entered by the stack-unwinding machinery. | 905 // when the handler is entered by the stack-unwinding machinery. |
907 // TODO(mstarzinger): Be smarter about register allocation. | 906 // TODO(mstarzinger): Be smarter about register allocation. |
908 Register context = register_allocator()->NewRegister(); | 907 Register context = register_allocator()->NewRegister(); |
909 | 908 |
910 // Evaluate the try-block inside a control scope. This simulates a handler | 909 // Evaluate the try-block inside a control scope. This simulates a handler |
911 // that is intercepting 'throw' control commands. | 910 // that is intercepting 'throw' control commands. |
912 try_control_builder.BeginTry(context); | 911 try_control_builder.BeginTry(context); |
913 // TODO(mstarzinger): Control scope is missing! | 912 // TODO(mstarzinger): Control scope is missing! |
(...skipping 17 matching lines...) Expand all Loading... |
931 Runtime::kPushCatchContext, name, 3); | 930 Runtime::kPushCatchContext, name, 3); |
932 | 931 |
933 // Evaluate the catch-block. | 932 // Evaluate the catch-block. |
934 Visit(stmt->catch_block()); | 933 Visit(stmt->catch_block()); |
935 try_control_builder.EndCatch(); | 934 try_control_builder.EndCatch(); |
936 } | 935 } |
937 | 936 |
938 | 937 |
939 void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) { | 938 void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) { |
940 TryFinallyBuilder try_control_builder(builder()); | 939 TryFinallyBuilder try_control_builder(builder()); |
941 if (!FLAG_ignition_fake_try_catch) UNIMPLEMENTED(); | |
942 | 940 |
943 // Preserve the context in a dedicated register, so that it can be restored | 941 // Preserve the context in a dedicated register, so that it can be restored |
944 // when the handler is entered by the stack-unwinding machinery. | 942 // when the handler is entered by the stack-unwinding machinery. |
945 // TODO(mstarzinger): Be smarter about register allocation. | 943 // TODO(mstarzinger): Be smarter about register allocation. |
946 Register context = register_allocator()->NewRegister(); | 944 Register context = register_allocator()->NewRegister(); |
947 | 945 |
948 // Evaluate the try-block inside a control scope. This simulates a handler | 946 // Evaluate the try-block inside a control scope. This simulates a handler |
949 // that is intercepting all control commands. | 947 // that is intercepting all control commands. |
950 try_control_builder.BeginTry(context); | 948 try_control_builder.BeginTry(context); |
951 // TODO(mstarzinger): Control scope is missing! | 949 // TODO(mstarzinger): Control scope is missing! |
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 } | 2255 } |
2258 | 2256 |
2259 | 2257 |
2260 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2258 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2261 return info()->feedback_vector()->GetIndex(slot); | 2259 return info()->feedback_vector()->GetIndex(slot); |
2262 } | 2260 } |
2263 | 2261 |
2264 } // namespace interpreter | 2262 } // namespace interpreter |
2265 } // namespace internal | 2263 } // namespace internal |
2266 } // namespace v8 | 2264 } // namespace v8 |
OLD | NEW |