bytecode-array-iterator.cc 926 Bytes
Newer Older
1 2 3 4 5
// Copyright 2015 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-array-iterator.h"
6
#include "src/objects/code-inl.h"
7
#include "src/objects/objects-inl.h"
8 9 10 11 12

namespace v8 {
namespace internal {
namespace interpreter {

13
BytecodeArrayIterator::BytecodeArrayIterator(
14 15
    std::unique_ptr<AbstractBytecodeArray> bytecode_array)
    : BytecodeArrayAccessor(std::move(bytecode_array), 0) {}
16

17 18
BytecodeArrayIterator::BytecodeArrayIterator(
    Handle<BytecodeArray> bytecode_array)
19
    : BytecodeArrayAccessor(bytecode_array, 0) {}
20 21

void BytecodeArrayIterator::Advance() {
22
  SetOffset(current_offset() + current_bytecode_size());
23
}
24 25

bool BytecodeArrayIterator::done() const {
26
  return current_offset() >= bytecode_length();
27 28
}

29 30 31
}  // namespace interpreter
}  // namespace internal
}  // namespace v8