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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 VisitForRegisterValue(property->key(), key); | 1105 VisitForRegisterValue(property->key(), key); |
1106 BuildKeyedSuperPropertyStore(receiver, home_object, key, value); | 1106 BuildKeyedSuperPropertyStore(receiver, home_object, key, value); |
1107 break; | 1107 break; |
1108 } | 1108 } |
1109 } | 1109 } |
1110 } | 1110 } |
1111 | 1111 |
1112 | 1112 |
1113 void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 1113 void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
1114 if (stmt->subject()->IsNullLiteral() || | 1114 if (stmt->subject()->IsNullLiteral() || |
1115 stmt->subject()->IsUndefinedLiteral(isolate())) { | 1115 stmt->subject()->IsUndefinedLiteral()) { |
1116 // ForIn generates lots of code, skip if it wouldn't produce any effects. | 1116 // ForIn generates lots of code, skip if it wouldn't produce any effects. |
1117 return; | 1117 return; |
1118 } | 1118 } |
1119 | 1119 |
1120 LoopBuilder loop_builder(builder()); | 1120 LoopBuilder loop_builder(builder()); |
1121 BytecodeLabel subject_null_label, subject_undefined_label; | 1121 BytecodeLabel subject_null_label, subject_undefined_label; |
1122 | 1122 |
1123 // Prepare the state for executing ForIn. | 1123 // Prepare the state for executing ForIn. |
1124 builder()->SetExpressionAsStatementPosition(stmt->subject()); | 1124 builder()->SetExpressionAsStatementPosition(stmt->subject()); |
1125 VisitForAccumulatorValue(stmt->subject()); | 1125 VisitForAccumulatorValue(stmt->subject()); |
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3155 } | 3155 } |
3156 | 3156 |
3157 | 3157 |
3158 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3158 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3159 return info()->feedback_vector()->GetIndex(slot); | 3159 return info()->feedback_vector()->GetIndex(slot); |
3160 } | 3160 } |
3161 | 3161 |
3162 } // namespace interpreter | 3162 } // namespace interpreter |
3163 } // namespace internal | 3163 } // namespace internal |
3164 } // namespace v8 | 3164 } // namespace v8 |
OLD | NEW |