bytecode-label.cc 735 Bytes
Newer Older
1 2 3 4 5 6 7
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/interpreter/bytecode-label.h"

#include "src/interpreter/bytecode-array-builder.h"
8
#include "src/objects/objects-inl.h"
9 10 11 12 13 14

namespace v8 {
namespace internal {
namespace interpreter {

BytecodeLabel* BytecodeLabels::New() {
15
  DCHECK(!is_bound());
16
  labels_.emplace_back(BytecodeLabel());
17 18 19 20
  return &labels_.back();
}

void BytecodeLabels::Bind(BytecodeArrayBuilder* builder) {
21 22
  DCHECK(!is_bound_);
  is_bound_ = true;
23
  for (auto& label : labels_) {
24 25 26 27 28 29 30
    builder->Bind(&label);
  }
}

}  // namespace interpreter
}  // namespace internal
}  // namespace v8