Commit ae5b624e authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Remove BytecodeArrayData's source_positions

We can bypass the data() and do a direct access read.

Bug: v8:7790
Change-Id: Id1d5b4ad9dcde1673fae07a076ad11322da4c724
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2358730Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69418}
parent aefbcbdd
......@@ -1599,9 +1599,6 @@ class BytecodeArrayData : public FixedArrayBaseData {
constant_pool_.push_back(broker->GetOrCreateData(constant_pool->get(i)));
}
source_positions_ = broker->CanonicalPersistentHandle(
bytecodes->SourcePositionTableIfCollected());
Handle<ByteArray> handlers(bytecodes->handler_table(), broker->isolate());
handler_table_.reserve(handlers->length());
for (int i = 0; i < handlers->length(); i++) {
......@@ -1611,8 +1608,6 @@ class BytecodeArrayData : public FixedArrayBaseData {
is_serialized_for_compilation_ = true;
}
Handle<ByteArray> source_positions() const { return source_positions_; }
Address handler_table_address() const {
CHECK(is_serialized_for_compilation_);
return reinterpret_cast<Address>(handler_table_.data());
......@@ -1639,7 +1634,6 @@ class BytecodeArrayData : public FixedArrayBaseData {
interpreter::Register const incoming_new_target_or_generator_register_;
bool is_serialized_for_compilation_ = false;
Handle<ByteArray> source_positions_;
ZoneVector<uint8_t> handler_table_;
ZoneVector<ObjectData*> constant_pool_;
};
......@@ -3270,14 +3264,8 @@ void BytecodeArrayRef::SerializeForCompilation() {
}
Handle<ByteArray> BytecodeArrayRef::source_positions() const {
if (data_->should_access_heap()) {
DCHECK(data_->kind() != ObjectDataKind::kUnserializedReadOnlyHeapObject);
AllowHandleDereferenceIf allow_handle_dereference(data()->kind(),
broker()->mode());
return handle(object()->SourcePositionTableIfCollected(),
broker()->isolate());
}
return data()->AsBytecodeArray()->source_positions();
return broker()->CanonicalPersistentHandle(
object()->SourcePositionTableIfCollected());
}
Address BytecodeArrayRef::handler_table_address() const {
......
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