1 // Copyright 2015 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "src/interpreter/bytecode-array-iterator.h" 6 #include "src/objects/code-inl.h" 7 #include "src/objects/objects-inl.h" 8 9 namespace v8 { 10 namespace internal { 11 namespace interpreter { 12 BytecodeArrayIterator(std::unique_ptr<AbstractBytecodeArray> bytecode_array)13BytecodeArrayIterator::BytecodeArrayIterator( 14 std::unique_ptr<AbstractBytecodeArray> bytecode_array) 15 : BytecodeArrayAccessor(std::move(bytecode_array), 0) {} 16 BytecodeArrayIterator(Handle<BytecodeArray> bytecode_array)17BytecodeArrayIterator::BytecodeArrayIterator( 18 Handle<BytecodeArray> bytecode_array) 19 : BytecodeArrayAccessor(bytecode_array, 0) {} 20 Advance()21void BytecodeArrayIterator::Advance() { 22 SetOffset(current_offset() + current_bytecode_size()); 23 } 24 done() const25bool BytecodeArrayIterator::done() const { 26 return current_offset() >= bytecode_array()->length(); 27 } 28 29 } // namespace interpreter 30 } // namespace internal 31 } // namespace v8 32