Commit a8070482 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[turbofan] Serialize bytecode array for concurrent graph building.

We also introduce a subclass of AbstractBytecodeArray to allow access
to the off-heap copy of bytecode array from the bytecode iterator.

Note that not all bytecode iterators have been converted to iterate
the off-heap copy; in particular, bytecode analysis still iterates
the on-heap bytecode array.

Bug: v8:7790
Change-Id: Icc1b0adb5f63d7cfe94286311f64f209067bbfd5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1672931
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62403}
parent fc8c4ef2
...@@ -32,7 +32,7 @@ namespace compiler { ...@@ -32,7 +32,7 @@ namespace compiler {
class BytecodeGraphBuilder { class BytecodeGraphBuilder {
public: public:
BytecodeGraphBuilder(JSHeapBroker* broker, Zone* local_zone, BytecodeGraphBuilder(JSHeapBroker* broker, Zone* local_zone,
Handle<BytecodeArray> bytecode_array, BytecodeArrayRef bytecode_array,
Handle<SharedFunctionInfo> shared, Handle<SharedFunctionInfo> shared,
Handle<FeedbackVector> feedback_vector, Handle<FeedbackVector> feedback_vector,
BailoutId osr_offset, JSGraph* jsgraph, BailoutId osr_offset, JSGraph* jsgraph,
...@@ -318,9 +318,7 @@ class BytecodeGraphBuilder { ...@@ -318,9 +318,7 @@ class BytecodeGraphBuilder {
return jsgraph_->simplified(); return jsgraph_->simplified();
} }
Zone* local_zone() const { return local_zone_; } Zone* local_zone() const { return local_zone_; }
const Handle<BytecodeArray>& bytecode_array() const { const BytecodeArrayRef bytecode_array() const { return bytecode_array_; }
return bytecode_array_;
}
const Handle<FeedbackVector>& feedback_vector() const { const Handle<FeedbackVector>& feedback_vector() const {
return feedback_vector_; return feedback_vector_;
} }
...@@ -382,7 +380,7 @@ class BytecodeGraphBuilder { ...@@ -382,7 +380,7 @@ class BytecodeGraphBuilder {
Zone* const local_zone_; Zone* const local_zone_;
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
CallFrequency const invocation_frequency_; CallFrequency const invocation_frequency_;
Handle<BytecodeArray> const bytecode_array_; BytecodeArrayRef const bytecode_array_;
Handle<FeedbackVector> const feedback_vector_; Handle<FeedbackVector> const feedback_vector_;
JSTypeHintLowering const type_hint_lowering_; JSTypeHintLowering const type_hint_lowering_;
const FrameStateFunctionInfo* const frame_state_function_info_; const FrameStateFunctionInfo* const frame_state_function_info_;
...@@ -938,8 +936,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint( ...@@ -938,8 +936,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint(
} }
BytecodeGraphBuilder::BytecodeGraphBuilder( BytecodeGraphBuilder::BytecodeGraphBuilder(
JSHeapBroker* broker, Zone* local_zone, JSHeapBroker* broker, Zone* local_zone, BytecodeArrayRef bytecode_array,
Handle<BytecodeArray> bytecode_array,
Handle<SharedFunctionInfo> shared_info, Handle<SharedFunctionInfo> shared_info,
Handle<FeedbackVector> feedback_vector, BailoutId osr_offset, Handle<FeedbackVector> feedback_vector, BailoutId osr_offset,
JSGraph* jsgraph, CallFrequency const& invocation_frequency, JSGraph* jsgraph, CallFrequency const& invocation_frequency,
...@@ -958,13 +955,15 @@ BytecodeGraphBuilder::BytecodeGraphBuilder( ...@@ -958,13 +955,15 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
: JSTypeHintLowering::kNoFlags), : JSTypeHintLowering::kNoFlags),
frame_state_function_info_(common()->CreateFrameStateFunctionInfo( frame_state_function_info_(common()->CreateFrameStateFunctionInfo(
FrameStateType::kInterpretedFunction, FrameStateType::kInterpretedFunction,
bytecode_array->parameter_count(), bytecode_array->register_count(), bytecode_array.parameter_count(), bytecode_array.register_count(),
shared_info)), shared_info)),
source_position_iterator_( source_position_iterator_(
handle(bytecode_array->SourcePositionTableIfCollected(), isolate())), handle(bytecode_array.object()->SourcePositionTableIfCollected(),
bytecode_iterator_(bytecode_array), isolate())),
bytecode_iterator_(
base::make_unique<OffHeapBytecodeArray>(bytecode_array)),
bytecode_analysis_( bytecode_analysis_(
bytecode_array, local_zone, bytecode_array.object(), local_zone,
flags & BytecodeGraphBuilderFlag::kAnalyzeEnvironmentLiveness), flags & BytecodeGraphBuilderFlag::kAnalyzeEnvironmentLiveness),
environment_(nullptr), environment_(nullptr),
osr_offset_(osr_offset), osr_offset_(osr_offset),
...@@ -1009,21 +1008,18 @@ VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { ...@@ -1009,21 +1008,18 @@ VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
} }
void BytecodeGraphBuilder::CreateGraph() { void BytecodeGraphBuilder::CreateGraph() {
BytecodeArrayRef bytecode_array_ref(broker(), bytecode_array());
SourcePositionTable::Scope pos_scope(source_positions_, start_position_); SourcePositionTable::Scope pos_scope(source_positions_, start_position_);
// Set up the basic structure of the graph. Outputs for {Start} are the formal // Set up the basic structure of the graph. Outputs for {Start} are the formal
// parameters (including the receiver) plus new target, number of arguments, // parameters (including the receiver) plus new target, number of arguments,
// context and closure. // context and closure.
int actual_parameter_count = bytecode_array_ref.parameter_count() + 4; int actual_parameter_count = bytecode_array().parameter_count() + 4;
graph()->SetStart(graph()->NewNode(common()->Start(actual_parameter_count))); graph()->SetStart(graph()->NewNode(common()->Start(actual_parameter_count)));
Environment env( Environment env(this, bytecode_array().register_count(),
this, bytecode_array_ref.register_count(), bytecode_array().parameter_count(),
bytecode_array_ref.parameter_count(), bytecode_array().incoming_new_target_or_generator_register(),
bytecode_array_ref.incoming_new_target_or_generator_register(), graph()->start());
graph()->start());
set_environment(&env); set_environment(&env);
VisitBytecodes(); VisitBytecodes();
...@@ -3289,8 +3285,7 @@ void BytecodeGraphBuilder::VisitSuspendGenerator() { ...@@ -3289,8 +3285,7 @@ void BytecodeGraphBuilder::VisitSuspendGenerator() {
CHECK_EQ(0, first_reg.index()); CHECK_EQ(0, first_reg.index());
int register_count = int register_count =
static_cast<int>(bytecode_iterator().GetRegisterCountOperand(2)); static_cast<int>(bytecode_iterator().GetRegisterCountOperand(2));
int parameter_count_without_receiver = int parameter_count_without_receiver = bytecode_array().parameter_count() - 1;
bytecode_array()->parameter_count() - 1;
Node* suspend_id = jsgraph()->SmiConstant( Node* suspend_id = jsgraph()->SmiConstant(
bytecode_iterator().GetUnsignedImmediateOperand(3)); bytecode_iterator().GetUnsignedImmediateOperand(3));
...@@ -3430,8 +3425,7 @@ void BytecodeGraphBuilder::VisitResumeGenerator() { ...@@ -3430,8 +3425,7 @@ void BytecodeGraphBuilder::VisitResumeGenerator() {
const BytecodeLivenessState* liveness = bytecode_analysis().GetOutLivenessFor( const BytecodeLivenessState* liveness = bytecode_analysis().GetOutLivenessFor(
bytecode_iterator().current_offset()); bytecode_iterator().current_offset());
int parameter_count_without_receiver = int parameter_count_without_receiver = bytecode_array().parameter_count() - 1;
bytecode_array()->parameter_count() - 1;
// Mapping between registers and array indices must match that used in // Mapping between registers and array indices must match that used in
// InterpreterAssembler::ExportParametersAndRegisterFile. // InterpreterAssembler::ExportParametersAndRegisterFile.
...@@ -3824,7 +3818,7 @@ Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) { ...@@ -3824,7 +3818,7 @@ Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) {
} }
void BytecodeGraphBuilder::ExitThenEnterExceptionHandlers(int current_offset) { void BytecodeGraphBuilder::ExitThenEnterExceptionHandlers(int current_offset) {
HandlerTable table(*bytecode_array()); HandlerTable table(*(bytecode_array().object()));
// Potentially exit exception handlers. // Potentially exit exception handlers.
while (!exception_handlers_.empty()) { while (!exception_handlers_.empty()) {
...@@ -4027,7 +4021,9 @@ void BuildGraphFromBytecode(JSHeapBroker* broker, Zone* local_zone, ...@@ -4027,7 +4021,9 @@ void BuildGraphFromBytecode(JSHeapBroker* broker, Zone* local_zone,
SourcePositionTable* source_positions, SourcePositionTable* source_positions,
Handle<Context> native_context, int inlining_id, Handle<Context> native_context, int inlining_id,
BytecodeGraphBuilderFlags flags) { BytecodeGraphBuilderFlags flags) {
BytecodeGraphBuilder builder(broker, local_zone, bytecode_array, shared, BytecodeArrayRef bytecode_array_ref(broker, bytecode_array);
DCHECK(bytecode_array_ref.IsSerializedForCompilation());
BytecodeGraphBuilder builder(broker, local_zone, bytecode_array_ref, shared,
feedback_vector, osr_offset, jsgraph, feedback_vector, osr_offset, jsgraph,
invocation_frequency, source_positions, invocation_frequency, source_positions,
native_context, inlining_id, flags); native_context, inlining_id, flags);
......
...@@ -1311,18 +1311,74 @@ class BytecodeArrayData : public FixedArrayBaseData { ...@@ -1311,18 +1311,74 @@ class BytecodeArrayData : public FixedArrayBaseData {
return incoming_new_target_or_generator_register_; return incoming_new_target_or_generator_register_;
} }
uint8_t get(int index) const {
DCHECK(is_serialized_for_compilation_);
return bytecodes_[index];
}
Address GetFirstBytecodeAddress() const {
return reinterpret_cast<Address>(bytecodes_.data());
}
Handle<Object> GetConstantAtIndex(int index, Isolate* isolate) const {
return constant_pool_[index]->object();
}
bool IsConstantAtIndexSmi(int index) const {
return constant_pool_[index]->is_smi();
}
Smi GetConstantAtIndexAsSmi(int index) const {
return *(Handle<Smi>::cast(constant_pool_[index]->object()));
}
bool IsSerializedForCompilation() const {
return is_serialized_for_compilation_;
}
void SerializeForCompilation(JSHeapBroker* broker) {
if (is_serialized_for_compilation_) return;
DCHECK(bytecodes_.empty());
DCHECK(constant_pool_.empty());
Handle<BytecodeArray> bytecode_array =
Handle<BytecodeArray>::cast(object());
bytecodes_.reserve(bytecode_array->length());
for (int i = 0; i < bytecode_array->length(); i++) {
bytecodes_.push_back(bytecode_array->get(i));
}
Handle<FixedArray> constant_pool(bytecode_array->constant_pool(),
broker->isolate());
constant_pool_.reserve(constant_pool->length());
for (int i = 0; i < constant_pool->length(); i++) {
constant_pool_.push_back(broker->GetOrCreateData(constant_pool->get(i)));
}
is_serialized_for_compilation_ = true;
}
BytecodeArrayData(JSHeapBroker* broker, ObjectData** storage, BytecodeArrayData(JSHeapBroker* broker, ObjectData** storage,
Handle<BytecodeArray> object) Handle<BytecodeArray> object)
: FixedArrayBaseData(broker, storage, object), : FixedArrayBaseData(broker, storage, object),
register_count_(object->register_count()), register_count_(object->register_count()),
parameter_count_(object->parameter_count()), parameter_count_(object->parameter_count()),
incoming_new_target_or_generator_register_( incoming_new_target_or_generator_register_(
object->incoming_new_target_or_generator_register()) {} object->incoming_new_target_or_generator_register()),
bytecodes_(broker->zone()),
constant_pool_(broker->zone()) {}
private: private:
int const register_count_; int const register_count_;
int const parameter_count_; int const parameter_count_;
interpreter::Register const incoming_new_target_or_generator_register_; interpreter::Register const incoming_new_target_or_generator_register_;
bool is_serialized_for_compilation_ = false;
ZoneVector<uint8_t> bytecodes_;
ZoneVector<ObjectData*> constant_pool_;
}; };
class JSArrayData : public JSObjectData { class JSArrayData : public JSObjectData {
...@@ -2639,6 +2695,62 @@ double FixedDoubleArrayRef::get_scalar(int i) const { ...@@ -2639,6 +2695,62 @@ double FixedDoubleArrayRef::get_scalar(int i) const {
return data()->AsFixedDoubleArray()->Get(i).get_scalar(); return data()->AsFixedDoubleArray()->Get(i).get_scalar();
} }
uint8_t BytecodeArrayRef::get(int index) const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return object()->get(index);
}
return data()->AsBytecodeArray()->get(index);
}
Address BytecodeArrayRef::GetFirstBytecodeAddress() const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return object()->GetFirstBytecodeAddress();
}
return data()->AsBytecodeArray()->GetFirstBytecodeAddress();
}
Handle<Object> BytecodeArrayRef::GetConstantAtIndex(int index) const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return handle(object()->constant_pool().get(index), broker()->isolate());
}
return data()->AsBytecodeArray()->GetConstantAtIndex(index,
broker()->isolate());
}
bool BytecodeArrayRef::IsConstantAtIndexSmi(int index) const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return object()->constant_pool().get(index).IsSmi();
}
return data()->AsBytecodeArray()->IsConstantAtIndexSmi(index);
}
Smi BytecodeArrayRef::GetConstantAtIndexAsSmi(int index) const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return Smi::cast(object()->constant_pool().get(index));
}
return data()->AsBytecodeArray()->GetConstantAtIndexAsSmi(index);
}
bool BytecodeArrayRef::IsSerializedForCompilation() const {
if (broker()->mode() == JSHeapBroker::kDisabled) return true;
return data()->AsBytecodeArray()->IsSerializedForCompilation();
}
void BytecodeArrayRef::SerializeForCompilation() {
if (broker()->mode() == JSHeapBroker::kDisabled) return;
data()->AsBytecodeArray()->SerializeForCompilation(broker());
}
#define IF_BROKER_DISABLED_ACCESS_HANDLE_C(holder, name) \ #define IF_BROKER_DISABLED_ACCESS_HANDLE_C(holder, name) \
if (broker()->mode() == JSHeapBroker::kDisabled) { \ if (broker()->mode() == JSHeapBroker::kDisabled) { \
AllowHandleAllocation handle_allocation; \ AllowHandleAllocation handle_allocation; \
...@@ -3773,6 +3885,36 @@ NamedAccessFeedback const* ProcessedFeedback::AsNamedAccess() const { ...@@ -3773,6 +3885,36 @@ NamedAccessFeedback const* ProcessedFeedback::AsNamedAccess() const {
return static_cast<NamedAccessFeedback const*>(this); return static_cast<NamedAccessFeedback const*>(this);
} }
OffHeapBytecodeArray::OffHeapBytecodeArray(BytecodeArrayRef bytecode_array)
: array_(bytecode_array) {}
int OffHeapBytecodeArray::length() const { return array_.length(); }
int OffHeapBytecodeArray::parameter_count() const {
return array_.parameter_count();
}
uint8_t OffHeapBytecodeArray::get(int index) const { return array_.get(index); }
void OffHeapBytecodeArray::set(int index, uint8_t value) { UNREACHABLE(); }
Address OffHeapBytecodeArray::GetFirstBytecodeAddress() const {
return array_.GetFirstBytecodeAddress();
}
Handle<Object> OffHeapBytecodeArray::GetConstantAtIndex(
int index, Isolate* isolate) const {
return array_.GetConstantAtIndex(index);
}
bool OffHeapBytecodeArray::IsConstantAtIndexSmi(int index) const {
return array_.IsConstantAtIndexSmi(index);
}
Smi OffHeapBytecodeArray::GetConstantAtIndexAsSmi(int index) const {
return array_.GetConstantAtIndexAsSmi(index);
}
#undef BIMODAL_ACCESSOR #undef BIMODAL_ACCESSOR
#undef BIMODAL_ACCESSOR_B #undef BIMODAL_ACCESSOR_B
#undef BIMODAL_ACCESSOR_C #undef BIMODAL_ACCESSOR_C
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "src/compiler/refs-map.h" #include "src/compiler/refs-map.h"
#include "src/handles/handles.h" #include "src/handles/handles.h"
#include "src/ic/call-optimization.h" #include "src/ic/call-optimization.h"
#include "src/interpreter/bytecode-array-accessor.h"
#include "src/objects/feedback-vector.h" #include "src/objects/feedback-vector.h"
#include "src/objects/function-kind.h" #include "src/objects/function-kind.h"
#include "src/objects/instance-type.h" #include "src/objects/instance-type.h"
...@@ -605,6 +606,18 @@ class BytecodeArrayRef : public FixedArrayBaseRef { ...@@ -605,6 +606,18 @@ class BytecodeArrayRef : public FixedArrayBaseRef {
int register_count() const; int register_count() const;
int parameter_count() const; int parameter_count() const;
interpreter::Register incoming_new_target_or_generator_register() const; interpreter::Register incoming_new_target_or_generator_register() const;
// Bytecode access methods.
uint8_t get(int index) const;
Address GetFirstBytecodeAddress() const;
// Constant pool access.
Handle<Object> GetConstantAtIndex(int index) const;
bool IsConstantAtIndexSmi(int index) const;
Smi GetConstantAtIndexAsSmi(int index) const;
bool IsSerializedForCompilation() const;
void SerializeForCompilation();
}; };
class JSArrayRef : public JSObjectRef { class JSArrayRef : public JSObjectRef {
...@@ -1008,6 +1021,23 @@ Reduction NoChangeBecauseOfMissingData(JSHeapBroker* broker, ...@@ -1008,6 +1021,23 @@ Reduction NoChangeBecauseOfMissingData(JSHeapBroker* broker,
// compilation is finished. // compilation is finished.
bool CanInlineElementAccess(MapRef const& map); bool CanInlineElementAccess(MapRef const& map);
class OffHeapBytecodeArray final : public interpreter::AbstractBytecodeArray {
public:
explicit OffHeapBytecodeArray(BytecodeArrayRef bytecode_array);
int length() const override;
int parameter_count() const override;
uint8_t get(int index) const override;
void set(int index, uint8_t value) override;
Address GetFirstBytecodeAddress() const override;
Handle<Object> GetConstantAtIndex(int index, Isolate* isolate) const override;
bool IsConstantAtIndexSmi(int index) const override;
Smi GetConstantAtIndexAsSmi(int index) const override;
private:
BytecodeArrayRef array_;
};
} // namespace compiler } // namespace compiler
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -482,6 +482,7 @@ void SerializerForBackgroundCompilation::TraverseBytecode() { ...@@ -482,6 +482,7 @@ void SerializerForBackgroundCompilation::TraverseBytecode() {
BytecodeArrayRef bytecode_array( BytecodeArrayRef bytecode_array(
broker(), handle(environment()->function().shared()->GetBytecodeArray(), broker(), handle(environment()->function().shared()->GetBytecodeArray(),
broker()->isolate())); broker()->isolate()));
bytecode_array.SerializeForCompilation();
BytecodeArrayIterator iterator(bytecode_array.object()); BytecodeArrayIterator iterator(bytecode_array.object());
ExceptionHandlerMatcher handler_matcher(iterator, bytecode_array.object()); ExceptionHandlerMatcher handler_matcher(iterator, bytecode_array.object());
......
...@@ -55,8 +55,8 @@ class OnHeapBytecodeArray final : public AbstractBytecodeArray { ...@@ -55,8 +55,8 @@ class OnHeapBytecodeArray final : public AbstractBytecodeArray {
} // namespace } // namespace
BytecodeArrayAccessor::BytecodeArrayAccessor( BytecodeArrayAccessor::BytecodeArrayAccessor(
AbstractBytecodeArray* bytecode_array, int initial_offset) std::unique_ptr<AbstractBytecodeArray> bytecode_array, int initial_offset)
: bytecode_array_(bytecode_array), : bytecode_array_(std::move(bytecode_array)),
bytecode_offset_(initial_offset), bytecode_offset_(initial_offset),
operand_scale_(OperandScale::kSingle), operand_scale_(OperandScale::kSingle),
prefix_offset_(0) { prefix_offset_(0) {
...@@ -65,8 +65,9 @@ BytecodeArrayAccessor::BytecodeArrayAccessor( ...@@ -65,8 +65,9 @@ BytecodeArrayAccessor::BytecodeArrayAccessor(
BytecodeArrayAccessor::BytecodeArrayAccessor( BytecodeArrayAccessor::BytecodeArrayAccessor(
Handle<BytecodeArray> bytecode_array, int initial_offset) Handle<BytecodeArray> bytecode_array, int initial_offset)
: BytecodeArrayAccessor(new OnHeapBytecodeArray(bytecode_array), : BytecodeArrayAccessor(
initial_offset) {} base::make_unique<OnHeapBytecodeArray>(bytecode_array),
initial_offset) {}
void BytecodeArrayAccessor::SetOffset(int offset) { void BytecodeArrayAccessor::SetOffset(int offset) {
bytecode_offset_ = offset; bytecode_offset_ = offset;
......
...@@ -83,7 +83,7 @@ class V8_EXPORT_PRIVATE AbstractBytecodeArray { ...@@ -83,7 +83,7 @@ class V8_EXPORT_PRIVATE AbstractBytecodeArray {
class V8_EXPORT_PRIVATE BytecodeArrayAccessor { class V8_EXPORT_PRIVATE BytecodeArrayAccessor {
public: public:
BytecodeArrayAccessor(AbstractBytecodeArray* bytecode_array, BytecodeArrayAccessor(std::unique_ptr<AbstractBytecodeArray> bytecode_array,
int initial_offset); int initial_offset);
BytecodeArrayAccessor(Handle<BytecodeArray> bytecode_array, BytecodeArrayAccessor(Handle<BytecodeArray> bytecode_array,
......
...@@ -11,8 +11,8 @@ namespace internal { ...@@ -11,8 +11,8 @@ namespace internal {
namespace interpreter { namespace interpreter {
BytecodeArrayIterator::BytecodeArrayIterator( BytecodeArrayIterator::BytecodeArrayIterator(
AbstractBytecodeArray* bytecode_array) std::unique_ptr<AbstractBytecodeArray> bytecode_array)
: BytecodeArrayAccessor(bytecode_array, 0) {} : BytecodeArrayAccessor(std::move(bytecode_array), 0) {}
BytecodeArrayIterator::BytecodeArrayIterator( BytecodeArrayIterator::BytecodeArrayIterator(
Handle<BytecodeArray> bytecode_array) Handle<BytecodeArray> bytecode_array)
......
...@@ -14,7 +14,8 @@ namespace interpreter { ...@@ -14,7 +14,8 @@ namespace interpreter {
class V8_EXPORT_PRIVATE BytecodeArrayIterator final class V8_EXPORT_PRIVATE BytecodeArrayIterator final
: public BytecodeArrayAccessor { : public BytecodeArrayAccessor {
public: public:
explicit BytecodeArrayIterator(AbstractBytecodeArray* array); explicit BytecodeArrayIterator(std::unique_ptr<AbstractBytecodeArray> array);
explicit BytecodeArrayIterator(Handle<BytecodeArray> array); explicit BytecodeArrayIterator(Handle<BytecodeArray> array);
void Advance(); void Advance();
......
...@@ -11,8 +11,8 @@ namespace internal { ...@@ -11,8 +11,8 @@ namespace internal {
namespace interpreter { namespace interpreter {
BytecodeArrayRandomIterator::BytecodeArrayRandomIterator( BytecodeArrayRandomIterator::BytecodeArrayRandomIterator(
AbstractBytecodeArray* bytecode_array, Zone* zone) std::unique_ptr<AbstractBytecodeArray> bytecode_array, Zone* zone)
: BytecodeArrayAccessor(bytecode_array, 0), offsets_(zone) { : BytecodeArrayAccessor(std::move(bytecode_array), 0), offsets_(zone) {
Initialize(); Initialize();
} }
......
...@@ -16,10 +16,10 @@ namespace interpreter { ...@@ -16,10 +16,10 @@ namespace interpreter {
class V8_EXPORT_PRIVATE BytecodeArrayRandomIterator final class V8_EXPORT_PRIVATE BytecodeArrayRandomIterator final
: public BytecodeArrayAccessor { : public BytecodeArrayAccessor {
public: public:
explicit BytecodeArrayRandomIterator(AbstractBytecodeArray* bytecode_array, BytecodeArrayRandomIterator(
Zone* zone); std::unique_ptr<AbstractBytecodeArray> bytecode_array, Zone* zone);
explicit BytecodeArrayRandomIterator(Handle<BytecodeArray> bytecode_array,
Zone* zone); BytecodeArrayRandomIterator(Handle<BytecodeArray> bytecode_array, Zone* zone);
BytecodeArrayRandomIterator& operator++() { BytecodeArrayRandomIterator& operator++() {
++current_index_; ++current_index_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment