OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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-label.h" | 5 #include "src/interpreter/bytecode-label.h" |
6 | 6 |
7 #include "src/interpreter/bytecode-array-builder.h" | 7 #include "src/interpreter/bytecode-array-builder.h" |
| 8 #include "src/objects-inl.h" |
8 | 9 |
9 namespace v8 { | 10 namespace v8 { |
10 namespace internal { | 11 namespace internal { |
11 namespace interpreter { | 12 namespace interpreter { |
12 | 13 |
13 BytecodeLabel* BytecodeLabels::New() { | 14 BytecodeLabel* BytecodeLabels::New() { |
14 DCHECK(!is_bound()); | 15 DCHECK(!is_bound()); |
15 labels_.push_back(BytecodeLabel()); | 16 labels_.push_back(BytecodeLabel()); |
16 return &labels_.back(); | 17 return &labels_.back(); |
17 } | 18 } |
18 | 19 |
19 void BytecodeLabels::Bind(BytecodeArrayBuilder* builder) { | 20 void BytecodeLabels::Bind(BytecodeArrayBuilder* builder) { |
20 for (auto& label : labels_) { | 21 for (auto& label : labels_) { |
21 builder->Bind(&label); | 22 builder->Bind(&label); |
22 } | 23 } |
23 } | 24 } |
24 | 25 |
25 void BytecodeLabels::BindToLabel(BytecodeArrayBuilder* builder, | 26 void BytecodeLabels::BindToLabel(BytecodeArrayBuilder* builder, |
26 const BytecodeLabel& target) { | 27 const BytecodeLabel& target) { |
27 for (auto& label : labels_) { | 28 for (auto& label : labels_) { |
28 builder->Bind(target, &label); | 29 builder->Bind(target, &label); |
29 } | 30 } |
30 } | 31 } |
31 | 32 |
32 } // namespace interpreter | 33 } // namespace interpreter |
33 } // namespace internal | 34 } // namespace internal |
34 } // namespace v8 | 35 } // namespace v8 |
OLD | NEW |