Commit baecc0cb authored by Ross McIlroy's avatar Ross McIlroy Committed by V8 LUCI CQ

[compiler] Avoid repeated calls to GetBytecodeArray.

Calling SharedFunctionInfoRef::GetBytecodeArray is expensive as it
needs to call HeapBroker::GetOrCreateData each time. Instead have
bytecode graph builder save the bytecode_array and use it instead.

BUG=v8:9684,v8:7790

Change-Id: I1e847a8e371142f0108fbfbb1e151edf1c55beb8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2892667Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74564}
parent 679ccde0
...@@ -433,9 +433,7 @@ class BytecodeGraphBuilder { ...@@ -433,9 +433,7 @@ class BytecodeGraphBuilder {
return jsgraph_->simplified(); return jsgraph_->simplified();
} }
Zone* local_zone() const { return local_zone_; } Zone* local_zone() const { return local_zone_; }
BytecodeArrayRef bytecode_array() const { BytecodeArrayRef bytecode_array() const { return bytecode_array_; }
return shared_info().GetBytecodeArray();
}
FeedbackVectorRef const& feedback_vector() const { return feedback_vector_; } FeedbackVectorRef const& feedback_vector() const { return feedback_vector_; }
const JSTypeHintLowering& type_hint_lowering() const { const JSTypeHintLowering& type_hint_lowering() const {
return type_hint_lowering_; return type_hint_lowering_;
...@@ -485,6 +483,7 @@ class BytecodeGraphBuilder { ...@@ -485,6 +483,7 @@ class BytecodeGraphBuilder {
// The native context for which we optimize. // The native context for which we optimize.
NativeContextRef const native_context_; NativeContextRef const native_context_;
SharedFunctionInfoRef const shared_info_; SharedFunctionInfoRef const shared_info_;
BytecodeArrayRef const bytecode_array_;
FeedbackCellRef const feedback_cell_; FeedbackCellRef const feedback_cell_;
FeedbackVectorRef const feedback_vector_; FeedbackVectorRef const feedback_vector_;
CallFrequency const invocation_frequency_; CallFrequency const invocation_frequency_;
...@@ -1070,6 +1069,7 @@ BytecodeGraphBuilder::BytecodeGraphBuilder( ...@@ -1070,6 +1069,7 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
jsgraph_(jsgraph), jsgraph_(jsgraph),
native_context_(native_context), native_context_(native_context),
shared_info_(shared_info), shared_info_(shared_info),
bytecode_array_(shared_info.GetBytecodeArray()),
feedback_cell_(feedback_cell), feedback_cell_(feedback_cell),
feedback_vector_(feedback_cell.value()->AsFeedbackVector()), feedback_vector_(feedback_cell.value()->AsFeedbackVector()),
invocation_frequency_(invocation_frequency), invocation_frequency_(invocation_frequency),
......
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