Index: src/interpreter/bytecode-label.cc |
diff --git a/src/interpreter/bytecode-label.cc b/src/interpreter/bytecode-label.cc |
index c5c36f90ec4a9d5286b827e64053b62930354799..a12e8ab4cc8ae077c7fa4fdb0c47466b115d5518 100644 |
--- a/src/interpreter/bytecode-label.cc |
+++ b/src/interpreter/bytecode-label.cc |
@@ -11,16 +11,24 @@ namespace internal { |
namespace interpreter { |
BytecodeLabel* BytecodeLabels::New() { |
+ DCHECK(!is_bound()); |
labels_.push_back(BytecodeLabel()); |
return &labels_.back(); |
} |
void BytecodeLabels::Bind(BytecodeArrayBuilder* builder) { |
- for (auto label : labels_) { |
+ for (auto& label : labels_) { |
builder->Bind(&label); |
} |
} |
+void BytecodeLabels::BindToLabel(BytecodeArrayBuilder* builder, |
+ const BytecodeLabel& target) { |
+ for (auto& label : labels_) { |
+ builder->Bind(target, &label); |
+ } |
+} |
+ |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |