5 #ifndef V8_INTERPRETER_BYTECODE_LABEL_H_ 6 #define V8_INTERPRETER_BYTECODE_LABEL_H_ 10 #include "src/zone/zone-containers.h" 14 namespace interpreter {
16 class BytecodeArrayBuilder;
26 bool is_bound()
const {
return bound_; }
27 size_t offset()
const {
return offset_; }
30 static const size_t kInvalidOffset =
static_cast<size_t>(-1);
32 void bind_to(
size_t offset) {
33 DCHECK(!bound_ && offset != kInvalidOffset);
38 void set_referrer(
size_t offset) {
39 DCHECK(!bound_ && offset != kInvalidOffset && offset_ == kInvalidOffset);
43 bool is_forward_target()
const {
44 return offset() != kInvalidOffset && !is_bound();
69 bool is_bound()
const {
70 bool is_bound = !labels_.empty() && labels_.front().is_bound();
72 std::all_of(labels_.begin(), labels_.end(),
77 bool empty()
const {
return labels_.empty(); }
89 #endif // V8_INTERPRETER_BYTECODE_LABEL_H_