[turbofan] Disable concurrent inlining for OSR

Bug: v8:7790
Change-Id: Idf066adcd5c3dca3004e2eaa0d8fa389755720af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1991490
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65671}
This commit is contained in:
Maya Lekova 2020-01-09 16:50:55 +01:00 committed by Commit Bot
parent 382237a394
commit 3a961ad72e
28 changed files with 229 additions and 138 deletions

View File

@ -865,7 +865,9 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
// tolerate the lack of a script without bytecode. // tolerate the lack of a script without bytecode.
DCHECK_IMPLIES(!has_script, shared->HasBytecodeArray()); DCHECK_IMPLIES(!has_script, shared->HasBytecodeArray());
std::unique_ptr<OptimizedCompilationJob> job( std::unique_ptr<OptimizedCompilationJob> job(
compiler::Pipeline::NewCompilationJob(isolate, function, has_script)); compiler::Pipeline::NewCompilationJob(
isolate, function, has_script,
FLAG_concurrent_inlining && osr_offset.IsNone()));
OptimizedCompilationInfo* compilation_info = job->compilation_info(); OptimizedCompilationInfo* compilation_info = job->compilation_info();
compilation_info->SetOptimizingForOsr(osr_offset, osr_frame); compilation_info->SetOptimizingForOsr(osr_offset, osr_frame);

View File

@ -64,7 +64,8 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
kTraceHeapBroker = 1 << 17, kTraceHeapBroker = 1 << 17,
kWasmRuntimeExceptionSupport = 1 << 18, kWasmRuntimeExceptionSupport = 1 << 18,
kTurboControlFlowAwareAllocation = 1 << 19, kTurboControlFlowAwareAllocation = 1 << 19,
kTurboPreprocessRanges = 1 << 20 kTurboPreprocessRanges = 1 << 20,
kConcurrentInlining = 1 << 21,
}; };
// Construct a compilation info for optimized compilation. // Construct a compilation info for optimized compilation.
@ -93,6 +94,9 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
// Flags used by optimized compilation. // Flags used by optimized compilation.
void MarkAsConcurrentInlining() { SetFlag(kConcurrentInlining); }
bool is_concurrent_inlining() const { return GetFlag(kConcurrentInlining); }
void MarkAsTurboControlFlowAwareAllocation() { void MarkAsTurboControlFlowAwareAllocation() {
SetFlag(kTurboControlFlowAwareAllocation); SetFlag(kTurboControlFlowAwareAllocation);
} }

View File

@ -40,6 +40,7 @@ class BytecodeGraphBuilder {
CallFrequency const& invocation_frequency, CallFrequency const& invocation_frequency,
SourcePositionTable* source_positions, int inlining_id, SourcePositionTable* source_positions, int inlining_id,
BytecodeGraphBuilderFlags flags, BytecodeGraphBuilderFlags flags,
JSTypeHintLowering::Flags type_hint_lowering_flags,
TickCounter* tick_counter); TickCounter* tick_counter);
// Creates a graph by visiting bytecodes. // Creates a graph by visiting bytecodes.
@ -369,6 +370,10 @@ class BytecodeGraphBuilder {
NativeContextRef native_context() const { return native_context_; } NativeContextRef native_context() const { return native_context_; }
SharedFunctionInfoRef shared_info() const { return shared_info_; } SharedFunctionInfoRef shared_info() const { return shared_info_; }
bool should_disallow_heap_access() const {
return flags_ & BytecodeGraphBuilderFlag::kConcurrentInlining;
}
#define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name(); #define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name();
BYTECODE_LIST(DECLARE_VISIT_BYTECODE) BYTECODE_LIST(DECLARE_VISIT_BYTECODE)
#undef DECLARE_VISIT_BYTECODE #undef DECLARE_VISIT_BYTECODE
@ -433,6 +438,8 @@ class BytecodeGraphBuilder {
SourcePosition const start_position_; SourcePosition const start_position_;
BytecodeGraphBuilderFlags const flags_;
TickCounter* const tick_counter_; TickCounter* const tick_counter_;
static int const kBinaryOperationHintIndex = 1; static int const kBinaryOperationHintIndex = 1;
@ -940,7 +947,9 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
FeedbackVectorRef const& feedback_vector, BailoutId osr_offset, FeedbackVectorRef const& feedback_vector, BailoutId osr_offset,
JSGraph* jsgraph, CallFrequency const& invocation_frequency, JSGraph* jsgraph, CallFrequency const& invocation_frequency,
SourcePositionTable* source_positions, int inlining_id, SourcePositionTable* source_positions, int inlining_id,
BytecodeGraphBuilderFlags flags, TickCounter* tick_counter) BytecodeGraphBuilderFlags flags,
JSTypeHintLowering::Flags type_hint_lowering_flags,
TickCounter* tick_counter)
: broker_(broker), : broker_(broker),
local_zone_(local_zone), local_zone_(local_zone),
jsgraph_(jsgraph), jsgraph_(jsgraph),
@ -948,11 +957,8 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
shared_info_(shared_info), shared_info_(shared_info),
feedback_vector_(feedback_vector), feedback_vector_(feedback_vector),
invocation_frequency_(invocation_frequency), invocation_frequency_(invocation_frequency),
type_hint_lowering_( type_hint_lowering_(broker, jsgraph, feedback_vector,
broker, jsgraph, feedback_vector, type_hint_lowering_flags),
(flags & BytecodeGraphBuilderFlag::kBailoutOnUninitialized)
? JSTypeHintLowering::kBailoutOnUninitialized
: 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(),
@ -962,8 +968,9 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
bytecode_analysis_(broker_->GetBytecodeAnalysis( bytecode_analysis_(broker_->GetBytecodeAnalysis(
bytecode_array().object(), osr_offset, bytecode_array().object(), osr_offset,
flags & BytecodeGraphBuilderFlag::kAnalyzeEnvironmentLiveness, flags & BytecodeGraphBuilderFlag::kAnalyzeEnvironmentLiveness,
FLAG_concurrent_inlining ? SerializationPolicy::kAssumeSerialized (flags & BytecodeGraphBuilderFlag::kConcurrentInlining)
: SerializationPolicy::kSerializeIfNeeded)), ? SerializationPolicy::kAssumeSerialized
: SerializationPolicy::kSerializeIfNeeded)),
environment_(nullptr), environment_(nullptr),
osr_(!osr_offset.IsNone()), osr_(!osr_offset.IsNone()),
currently_peeled_loop_offset_(-1), currently_peeled_loop_offset_(-1),
@ -980,8 +987,9 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
state_values_cache_(jsgraph), state_values_cache_(jsgraph),
source_positions_(source_positions), source_positions_(source_positions),
start_position_(shared_info.StartPosition(), inlining_id), start_position_(shared_info.StartPosition(), inlining_id),
flags_(flags),
tick_counter_(tick_counter) { tick_counter_(tick_counter) {
if (FLAG_concurrent_inlining) { if (flags & BytecodeGraphBuilderFlag::kConcurrentInlining) {
// With concurrent inlining on, the source position address doesn't change // With concurrent inlining on, the source position address doesn't change
// because it's been copied from the heap. // because it's been copied from the heap.
source_position_iterator_ = std::make_unique<SourcePositionTableIterator>( source_position_iterator_ = std::make_unique<SourcePositionTableIterator>(
@ -1018,7 +1026,7 @@ FeedbackSource BytecodeGraphBuilder::CreateFeedbackSource(int slot_id) {
} }
void BytecodeGraphBuilder::CreateGraph() { void BytecodeGraphBuilder::CreateGraph() {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
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
@ -1313,7 +1321,7 @@ void BytecodeGraphBuilder::VisitBytecodes() {
VisitSingleBytecode(); VisitSingleBytecode();
} }
if (!FLAG_concurrent_inlining && has_one_shot_bytecode) { if (!should_disallow_heap_access() && has_one_shot_bytecode) {
// (For concurrent inlining this is done in the serializer instead.) // (For concurrent inlining this is done in the serializer instead.)
isolate()->CountUsage( isolate()->CountUsage(
v8::Isolate::UseCounterFeature::kOptimizedFunctionWithOneShotBytecode); v8::Isolate::UseCounterFeature::kOptimizedFunctionWithOneShotBytecode);
@ -2007,7 +2015,7 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
} }
void BytecodeGraphBuilder::VisitCreateBlockContext() { void BytecodeGraphBuilder::VisitCreateBlockContext() {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
ScopeInfoRef scope_info( ScopeInfoRef scope_info(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
const Operator* op = javascript()->CreateBlockContext(scope_info.object()); const Operator* op = javascript()->CreateBlockContext(scope_info.object());
@ -2016,7 +2024,7 @@ void BytecodeGraphBuilder::VisitCreateBlockContext() {
} }
void BytecodeGraphBuilder::VisitCreateFunctionContext() { void BytecodeGraphBuilder::VisitCreateFunctionContext() {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
ScopeInfoRef scope_info( ScopeInfoRef scope_info(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1); uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1);
@ -2027,7 +2035,7 @@ void BytecodeGraphBuilder::VisitCreateFunctionContext() {
} }
void BytecodeGraphBuilder::VisitCreateEvalContext() { void BytecodeGraphBuilder::VisitCreateEvalContext() {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
ScopeInfoRef scope_info( ScopeInfoRef scope_info(
broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1); uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1);
@ -2038,7 +2046,7 @@ void BytecodeGraphBuilder::VisitCreateEvalContext() {
} }
void BytecodeGraphBuilder::VisitCreateCatchContext() { void BytecodeGraphBuilder::VisitCreateCatchContext() {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0);
Node* exception = environment()->LookupRegister(reg); Node* exception = environment()->LookupRegister(reg);
ScopeInfoRef scope_info( ScopeInfoRef scope_info(
@ -2050,7 +2058,7 @@ void BytecodeGraphBuilder::VisitCreateCatchContext() {
} }
void BytecodeGraphBuilder::VisitCreateWithContext() { void BytecodeGraphBuilder::VisitCreateWithContext() {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
Node* object = Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
ScopeInfoRef scope_info( ScopeInfoRef scope_info(
@ -2157,7 +2165,7 @@ void BytecodeGraphBuilder::VisitCloneObject() {
} }
void BytecodeGraphBuilder::VisitGetTemplateObject() { void BytecodeGraphBuilder::VisitGetTemplateObject() {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
FeedbackSource source = FeedbackSource source =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(1)); CreateFeedbackSource(bytecode_iterator().GetIndexOperand(1));
TemplateObjectDescriptionRef description( TemplateObjectDescriptionRef description(
@ -4160,10 +4168,17 @@ void BuildGraphFromBytecode(JSHeapBroker* broker, Zone* local_zone,
int inlining_id, BytecodeGraphBuilderFlags flags, int inlining_id, BytecodeGraphBuilderFlags flags,
TickCounter* tick_counter) { TickCounter* tick_counter) {
DCHECK(broker->IsSerializedForCompilation(shared_info, feedback_vector)); DCHECK(broker->IsSerializedForCompilation(shared_info, feedback_vector));
JSTypeHintLowering::Flags type_hint_lowering_flags =
JSTypeHintLowering::kNoFlags;
if (flags & BytecodeGraphBuilderFlag::kBailoutOnUninitialized) {
type_hint_lowering_flags |= JSTypeHintLowering::kBailoutOnUninitialized;
}
BytecodeGraphBuilder builder( BytecodeGraphBuilder builder(
broker, local_zone, broker->target_native_context(), shared_info, broker, local_zone, broker->target_native_context(), shared_info,
feedback_vector, osr_offset, jsgraph, invocation_frequency, feedback_vector, osr_offset, jsgraph, invocation_frequency,
source_positions, inlining_id, flags, tick_counter); source_positions, inlining_id, flags, type_hint_lowering_flags,
tick_counter);
builder.CreateGraph(); builder.CreateGraph();
} }

View File

@ -33,6 +33,7 @@ enum class BytecodeGraphBuilderFlag : uint8_t {
// bytecode analysis. // bytecode analysis.
kAnalyzeEnvironmentLiveness = 1 << 1, kAnalyzeEnvironmentLiveness = 1 << 1,
kBailoutOnUninitialized = 1 << 2, kBailoutOnUninitialized = 1 << 2,
kConcurrentInlining = 1 << 3,
}; };
using BytecodeGraphBuilderFlags = base::Flags<BytecodeGraphBuilderFlag>; using BytecodeGraphBuilderFlags = base::Flags<BytecodeGraphBuilderFlag>;

View File

@ -1822,7 +1822,7 @@ Reduction JSCallReducer::ReduceMathMinMax(Node* node, const Operator* op,
} }
Reduction JSCallReducer::Reduce(Node* node) { Reduction JSCallReducer::Reduce(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kJSConstruct: case IrOpcode::kJSConstruct:
@ -1863,7 +1863,7 @@ void JSCallReducer::Finalize() {
// ES6 section 22.1.1 The Array Constructor // ES6 section 22.1.1 The Array Constructor
Reduction JSCallReducer::ReduceArrayConstructor(Node* node) { Reduction JSCallReducer::ReduceArrayConstructor(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
Node* target = NodeProperties::GetValueInput(node, 0); Node* target = NodeProperties::GetValueInput(node, 0);
@ -1920,7 +1920,7 @@ Reduction JSCallReducer::ReduceObjectConstructor(Node* node) {
// ES6 section 19.2.3.1 Function.prototype.apply ( thisArg, argArray ) // ES6 section 19.2.3.1 Function.prototype.apply ( thisArg, argArray )
Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) { Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) {
DisallowHeapAccessIf no_heap_acess(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_acess(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -2045,7 +2045,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) {
// ES section #sec-function.prototype.bind // ES section #sec-function.prototype.bind
Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) { Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) {
DisallowHeapAccessIf no_heap_acess(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_acess(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -2078,7 +2078,8 @@ Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) {
MapRef first_receiver_map(broker(), receiver_maps[0]); MapRef first_receiver_map(broker(), receiver_maps[0]);
bool const is_constructor = first_receiver_map.is_constructor(); bool const is_constructor = first_receiver_map.is_constructor();
if (FLAG_concurrent_inlining && !first_receiver_map.serialized_prototype()) { if (should_disallow_heap_access() &&
!first_receiver_map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), TRACE_BROKER_MISSING(broker(),
"serialized prototype on map " << first_receiver_map); "serialized prototype on map " << first_receiver_map);
return inference.NoChange(); return inference.NoChange();
@ -2087,7 +2088,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) {
for (Handle<Map> const map : receiver_maps) { for (Handle<Map> const map : receiver_maps) {
MapRef receiver_map(broker(), map); MapRef receiver_map(broker(), map);
if (FLAG_concurrent_inlining && !receiver_map.serialized_prototype()) { if (should_disallow_heap_access() && !receiver_map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), TRACE_BROKER_MISSING(broker(),
"serialized prototype on map " << receiver_map); "serialized prototype on map " << receiver_map);
return inference.NoChange(); return inference.NoChange();
@ -2176,7 +2177,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) {
// ES6 section 19.2.3.3 Function.prototype.call (thisArg, ...args) // ES6 section 19.2.3.3 Function.prototype.call (thisArg, ...args)
Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) { Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) {
DisallowHeapAccessIf no_heap_acess(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_acess(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -2190,7 +2191,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeCall(Node* node) {
HeapObjectMatcher m(target); HeapObjectMatcher m(target);
if (m.HasValue()) { if (m.HasValue()) {
JSFunctionRef function = m.Ref(broker()).AsJSFunction(); JSFunctionRef function = m.Ref(broker()).AsJSFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), "Serialize call on function " << function); TRACE_BROKER_MISSING(broker(), "Serialize call on function " << function);
return NoChange(); return NoChange();
} }
@ -2267,7 +2268,7 @@ Reduction JSCallReducer::ReduceObjectGetPrototype(Node* node, Node* object) {
MapHandles const& object_maps = inference.GetMaps(); MapHandles const& object_maps = inference.GetMaps();
MapRef candidate_map(broker(), object_maps[0]); MapRef candidate_map(broker(), object_maps[0]);
if (FLAG_concurrent_inlining && !candidate_map.serialized_prototype()) { if (should_disallow_heap_access() && !candidate_map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), "prototype for map " << candidate_map); TRACE_BROKER_MISSING(broker(), "prototype for map " << candidate_map);
return inference.NoChange(); return inference.NoChange();
} }
@ -2276,7 +2277,7 @@ Reduction JSCallReducer::ReduceObjectGetPrototype(Node* node, Node* object) {
// Check if we can constant-fold the {candidate_prototype}. // Check if we can constant-fold the {candidate_prototype}.
for (size_t i = 0; i < object_maps.size(); ++i) { for (size_t i = 0; i < object_maps.size(); ++i) {
MapRef object_map(broker(), object_maps[i]); MapRef object_map(broker(), object_maps[i]);
if (FLAG_concurrent_inlining && !object_map.serialized_prototype()) { if (should_disallow_heap_access() && !object_map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), "prototype for map " << object_map); TRACE_BROKER_MISSING(broker(), "prototype for map " << object_map);
return inference.NoChange(); return inference.NoChange();
} }
@ -2410,7 +2411,7 @@ Reduction JSCallReducer::ReduceObjectPrototypeHasOwnProperty(Node* node) {
// ES #sec-object.prototype.isprototypeof // ES #sec-object.prototype.isprototypeof
Reduction JSCallReducer::ReduceObjectPrototypeIsPrototypeOf(Node* node) { Reduction JSCallReducer::ReduceObjectPrototypeIsPrototypeOf(Node* node) {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
Node* receiver = NodeProperties::GetValueInput(node, 1); Node* receiver = NodeProperties::GetValueInput(node, 1);
@ -2712,8 +2713,7 @@ class IteratingArrayBuiltinHelper {
IteratingArrayBuiltinHelper(Node* node, JSHeapBroker* broker, IteratingArrayBuiltinHelper(Node* node, JSHeapBroker* broker,
JSGraph* jsgraph, JSGraph* jsgraph,
CompilationDependencies* dependencies) CompilationDependencies* dependencies)
: disallow_heap_access_(FLAG_concurrent_inlining), : receiver_(NodeProperties::GetValueInput(node, 1)),
receiver_(NodeProperties::GetValueInput(node, 1)),
effect_(NodeProperties::GetEffectInput(node)), effect_(NodeProperties::GetEffectInput(node)),
control_(NodeProperties::GetControlInput(node)), control_(NodeProperties::GetControlInput(node)),
inference_(broker, receiver_, effect_) { inference_(broker, receiver_, effect_) {
@ -2750,7 +2750,6 @@ class IteratingArrayBuiltinHelper {
ElementsKind elements_kind() const { return elements_kind_; } ElementsKind elements_kind() const { return elements_kind_; }
private: private:
DisallowHeapAccessIf disallow_heap_access_;
bool can_reduce_ = false; bool can_reduce_ = false;
bool has_stability_dependency_ = false; bool has_stability_dependency_ = false;
Node* receiver_; Node* receiver_;
@ -2764,6 +2763,7 @@ class IteratingArrayBuiltinHelper {
Reduction JSCallReducer::ReduceArrayForEach( Reduction JSCallReducer::ReduceArrayForEach(
Node* node, const SharedFunctionInfoRef& shared) { Node* node, const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2776,6 +2776,7 @@ Reduction JSCallReducer::ReduceArrayForEach(
Reduction JSCallReducer::ReduceArrayReduce( Reduction JSCallReducer::ReduceArrayReduce(
Node* node, const SharedFunctionInfoRef& shared) { Node* node, const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2789,6 +2790,7 @@ Reduction JSCallReducer::ReduceArrayReduce(
Reduction JSCallReducer::ReduceArrayReduceRight( Reduction JSCallReducer::ReduceArrayReduceRight(
Node* node, const SharedFunctionInfoRef& shared) { Node* node, const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2802,7 +2804,7 @@ Reduction JSCallReducer::ReduceArrayReduceRight(
Reduction JSCallReducer::ReduceArrayMap(Node* node, Reduction JSCallReducer::ReduceArrayMap(Node* node,
const SharedFunctionInfoRef& shared) { const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2822,7 +2824,7 @@ Reduction JSCallReducer::ReduceArrayMap(Node* node,
Reduction JSCallReducer::ReduceArrayFilter( Reduction JSCallReducer::ReduceArrayFilter(
Node* node, const SharedFunctionInfoRef& shared) { Node* node, const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2842,7 +2844,7 @@ Reduction JSCallReducer::ReduceArrayFilter(
Reduction JSCallReducer::ReduceArrayFind(Node* node, Reduction JSCallReducer::ReduceArrayFind(Node* node,
const SharedFunctionInfoRef& shared) { const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2857,7 +2859,7 @@ Reduction JSCallReducer::ReduceArrayFind(Node* node,
Reduction JSCallReducer::ReduceArrayFindIndex( Reduction JSCallReducer::ReduceArrayFindIndex(
Node* node, const SharedFunctionInfoRef& shared) { Node* node, const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2910,7 +2912,7 @@ void JSCallReducer::RewirePostCallbackExceptionEdges(Node* check_throw,
Reduction JSCallReducer::ReduceArrayEvery(Node* node, Reduction JSCallReducer::ReduceArrayEvery(Node* node,
const SharedFunctionInfoRef& shared) { const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2926,7 +2928,7 @@ Reduction JSCallReducer::ReduceArrayEvery(Node* node,
// ES7 Array.prototype.inludes(searchElement[, fromIndex]) // ES7 Array.prototype.inludes(searchElement[, fromIndex])
// #sec-array.prototype.includes // #sec-array.prototype.includes
Reduction JSCallReducer::ReduceArrayIncludes(Node* node) { Reduction JSCallReducer::ReduceArrayIncludes(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2941,7 +2943,7 @@ Reduction JSCallReducer::ReduceArrayIncludes(Node* node) {
// ES6 Array.prototype.indexOf(searchElement[, fromIndex]) // ES6 Array.prototype.indexOf(searchElement[, fromIndex])
// #sec-array.prototype.indexof // #sec-array.prototype.indexof
Reduction JSCallReducer::ReduceArrayIndexOf(Node* node) { Reduction JSCallReducer::ReduceArrayIndexOf(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2955,7 +2957,7 @@ Reduction JSCallReducer::ReduceArrayIndexOf(Node* node) {
Reduction JSCallReducer::ReduceArraySome(Node* node, Reduction JSCallReducer::ReduceArraySome(Node* node,
const SharedFunctionInfoRef& shared) { const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies()); IteratingArrayBuiltinHelper h(node, broker(), jsgraph(), dependencies());
if (!h.can_reduce()) return h.inference()->NoChange(); if (!h.can_reduce()) return h.inference()->NoChange();
@ -2970,7 +2972,7 @@ Reduction JSCallReducer::ReduceArraySome(Node* node,
Reduction JSCallReducer::ReduceCallApiFunction( Reduction JSCallReducer::ReduceCallApiFunction(
Node* node, const SharedFunctionInfoRef& shared) { Node* node, const SharedFunctionInfoRef& shared) {
DisallowHeapAccessIf no_heap_acess(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_acess(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -3431,7 +3433,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) {
ObjectRef target_ref = m.Ref(broker()); ObjectRef target_ref = m.Ref(broker());
if (target_ref.IsJSFunction()) { if (target_ref.IsJSFunction()) {
JSFunctionRef function = target_ref.AsJSFunction(); JSFunctionRef function = target_ref.AsJSFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), "data for function " << function); TRACE_BROKER_MISSING(broker(), "data for function " << function);
return NoChange(); return NoChange();
} }
@ -3444,7 +3446,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) {
return ReduceJSCall(node, function.shared()); return ReduceJSCall(node, function.shared());
} else if (target_ref.IsJSBoundFunction()) { } else if (target_ref.IsJSBoundFunction()) {
JSBoundFunctionRef function = target_ref.AsJSBoundFunction(); JSBoundFunctionRef function = target_ref.AsJSBoundFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), "data for function " << function); TRACE_BROKER_MISSING(broker(), "data for function " << function);
return NoChange(); return NoChange();
} }
@ -4025,7 +4027,7 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
if (target_ref.IsJSFunction()) { if (target_ref.IsJSFunction()) {
JSFunctionRef function = target_ref.AsJSFunction(); JSFunctionRef function = target_ref.AsJSFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), TRACE_BROKER_MISSING(broker(),
"function, not serialized: " << function); "function, not serialized: " << function);
return NoChange(); return NoChange();
@ -4086,7 +4088,7 @@ Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
} }
} else if (target_ref.IsJSBoundFunction()) { } else if (target_ref.IsJSBoundFunction()) {
JSBoundFunctionRef function = target_ref.AsJSBoundFunction(); JSBoundFunctionRef function = target_ref.AsJSBoundFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), TRACE_BROKER_MISSING(broker(),
"function, not serialized: " << function); "function, not serialized: " << function);
return NoChange(); return NoChange();
@ -4433,7 +4435,7 @@ void JSCallReducer::CheckIfElementsKind(Node* receiver_elements_kind,
// ES6 section 22.1.3.18 Array.prototype.push ( ) // ES6 section 22.1.3.18 Array.prototype.push ( )
Reduction JSCallReducer::ReduceArrayPrototypePush(Node* node) { Reduction JSCallReducer::ReduceArrayPrototypePush(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -4569,7 +4571,7 @@ Reduction JSCallReducer::ReduceArrayPrototypePush(Node* node) {
// ES6 section 22.1.3.17 Array.prototype.pop ( ) // ES6 section 22.1.3.17 Array.prototype.pop ( )
Reduction JSCallReducer::ReduceArrayPrototypePop(Node* node) { Reduction JSCallReducer::ReduceArrayPrototypePop(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -4704,7 +4706,7 @@ Reduction JSCallReducer::ReduceArrayPrototypePop(Node* node) {
// ES6 section 22.1.3.22 Array.prototype.shift ( ) // ES6 section 22.1.3.22 Array.prototype.shift ( )
Reduction JSCallReducer::ReduceArrayPrototypeShift(Node* node) { Reduction JSCallReducer::ReduceArrayPrototypeShift(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -4922,7 +4924,7 @@ Reduction JSCallReducer::ReduceArrayPrototypeShift(Node* node) {
// ES6 section 22.1.3.23 Array.prototype.slice ( ) // ES6 section 22.1.3.23 Array.prototype.slice ( )
Reduction JSCallReducer::ReduceArrayPrototypeSlice(Node* node) { Reduction JSCallReducer::ReduceArrayPrototypeSlice(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
if (!FLAG_turbo_inline_array_builtins) return NoChange(); if (!FLAG_turbo_inline_array_builtins) return NoChange();
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
@ -5000,7 +5002,7 @@ Reduction JSCallReducer::ReduceArrayPrototypeSlice(Node* node) {
// ES6 section 22.1.2.2 Array.isArray ( arg ) // ES6 section 22.1.2.2 Array.isArray ( arg )
Reduction JSCallReducer::ReduceArrayIsArray(Node* node) { Reduction JSCallReducer::ReduceArrayIsArray(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
// We certainly know that undefined is not an array. // We certainly know that undefined is not an array.
if (node->op()->ValueInputCount() < 3) { if (node->op()->ValueInputCount() < 3) {
@ -5025,7 +5027,7 @@ Reduction JSCallReducer::ReduceArrayIsArray(Node* node) {
} }
Reduction JSCallReducer::ReduceArrayIterator(Node* node, IterationKind kind) { Reduction JSCallReducer::ReduceArrayIterator(Node* node, IterationKind kind) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
Node* receiver = NodeProperties::GetValueInput(node, 1); Node* receiver = NodeProperties::GetValueInput(node, 1);
@ -5052,7 +5054,7 @@ Reduction JSCallReducer::ReduceArrayIterator(Node* node, IterationKind kind) {
// ES #sec-%arrayiteratorprototype%.next // ES #sec-%arrayiteratorprototype%.next
Reduction JSCallReducer::ReduceArrayIteratorPrototypeNext(Node* node) { Reduction JSCallReducer::ReduceArrayIteratorPrototypeNext(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -5707,7 +5709,7 @@ Node* JSCallReducer::CreateArtificialFrameState(
} }
Reduction JSCallReducer::ReducePromiseConstructor(Node* node) { Reduction JSCallReducer::ReducePromiseConstructor(Node* node) {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode()); DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode());
ConstructParameters const& p = ConstructParametersOf(node->op()); ConstructParameters const& p = ConstructParametersOf(node->op());
@ -5869,7 +5871,7 @@ bool JSCallReducer::DoPromiseChecks(MapInference* inference) {
for (Handle<Map> map : receiver_maps) { for (Handle<Map> map : receiver_maps) {
MapRef receiver_map(broker(), map); MapRef receiver_map(broker(), map);
if (!receiver_map.IsJSPromiseMap()) return false; if (!receiver_map.IsJSPromiseMap()) return false;
if (FLAG_concurrent_inlining && !receiver_map.serialized_prototype()) { if (should_disallow_heap_access() && !receiver_map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), "prototype for map " << receiver_map); TRACE_BROKER_MISSING(broker(), "prototype for map " << receiver_map);
return false; return false;
} }
@ -5934,7 +5936,7 @@ Node* JSCallReducer::CreateClosureFromBuiltinSharedFunctionInfo(
// ES section #sec-promise.prototype.finally // ES section #sec-promise.prototype.finally
Reduction JSCallReducer::ReducePromisePrototypeFinally(Node* node) { Reduction JSCallReducer::ReducePromisePrototypeFinally(Node* node) {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -6050,7 +6052,7 @@ Reduction JSCallReducer::ReducePromisePrototypeFinally(Node* node) {
} }
Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) { Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
CallParameters const& p = CallParametersOf(node->op()); CallParameters const& p = CallParametersOf(node->op());
@ -6118,7 +6120,7 @@ Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) {
// ES section #sec-promise.resolve // ES section #sec-promise.resolve
Reduction JSCallReducer::ReducePromiseResolveTrampoline(Node* node) { Reduction JSCallReducer::ReducePromiseResolveTrampoline(Node* node) {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(should_disallow_heap_access());
DCHECK_EQ(IrOpcode::kJSCall, node->opcode()); DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
Node* receiver = NodeProperties::GetValueInput(node, 1); Node* receiver = NodeProperties::GetValueInput(node, 1);
@ -6234,7 +6236,7 @@ Reduction JSCallReducer::ReduceTypedArrayPrototypeToStringTag(Node* node) {
jsgraph()->Constant(TYPE##_ELEMENTS - \ jsgraph()->Constant(TYPE##_ELEMENTS - \
FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND)); \ FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND)); \
control = graph()->NewNode(common()->Branch(), check, control); \ control = graph()->NewNode(common()->Branch(), check, control); \
if (FLAG_concurrent_inlining) { \ if (should_disallow_heap_access()) { \
values.push_back(jsgraph()->Constant( \ values.push_back(jsgraph()->Constant( \
broker()->GetTypedArrayStringTag(TYPE##_ELEMENTS))); \ broker()->GetTypedArrayStringTag(TYPE##_ELEMENTS))); \
} else { \ } else { \
@ -6746,7 +6748,7 @@ Reduction JSCallReducer::ReduceCollectionIteratorPrototypeNext(
} }
Reduction JSCallReducer::ReduceArrayBufferIsView(Node* node) { Reduction JSCallReducer::ReduceArrayBufferIsView(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
Node* value = node->op()->ValueInputCount() >= 3 Node* value = node->op()->ValueInputCount() >= 3
? NodeProperties::GetValueInput(node, 2) ? NodeProperties::GetValueInput(node, 2)
@ -6760,7 +6762,7 @@ Reduction JSCallReducer::ReduceArrayBufferIsView(Node* node) {
Reduction JSCallReducer::ReduceArrayBufferViewAccessor( Reduction JSCallReducer::ReduceArrayBufferViewAccessor(
Node* node, InstanceType instance_type, FieldAccess const& access) { Node* node, InstanceType instance_type, FieldAccess const& access) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
Node* receiver = NodeProperties::GetValueInput(node, 1); Node* receiver = NodeProperties::GetValueInput(node, 1);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
@ -7069,7 +7071,7 @@ Reduction JSCallReducer::ReduceNumberParseInt(Node* node) {
} }
Reduction JSCallReducer::ReduceRegExpPrototypeTest(Node* node) { Reduction JSCallReducer::ReduceRegExpPrototypeTest(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
if (FLAG_force_slow_path) return NoChange(); if (FLAG_force_slow_path) return NoChange();
if (node->op()->ValueInputCount() < 3) return NoChange(); if (node->op()->ValueInputCount() < 3) return NoChange();
@ -7096,7 +7098,7 @@ Reduction JSCallReducer::ReduceRegExpPrototypeTest(Node* node) {
ZoneVector<PropertyAccessInfo> access_infos(graph()->zone()); ZoneVector<PropertyAccessInfo> access_infos(graph()->zone());
AccessInfoFactory access_info_factory(broker(), dependencies(), AccessInfoFactory access_info_factory(broker(), dependencies(),
graph()->zone()); graph()->zone());
if (FLAG_concurrent_inlining) { if (should_disallow_heap_access()) {
// Obtain precomputed access infos from the broker. // Obtain precomputed access infos from the broker.
for (auto map : regexp_maps) { for (auto map : regexp_maps) {
MapRef map_ref(broker(), map); MapRef map_ref(broker(), map);

View File

@ -40,7 +40,11 @@ class SimplifiedOperatorBuilder;
class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer { class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
public: public:
// Flags that control the mode of operation. // Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kBailoutOnUninitialized = 1u << 0 }; enum Flag {
kNoFlags = 0u,
kBailoutOnUninitialized = 1u << 0,
kConcurrentInlining = 1u << 1
};
using Flags = base::Flags<Flag>; using Flags = base::Flags<Flag>;
JSCallReducer(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker, JSCallReducer(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker,
@ -246,6 +250,10 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
Flags flags() const { return flags_; } Flags flags() const { return flags_; }
CompilationDependencies* dependencies() const { return dependencies_; } CompilationDependencies* dependencies() const { return dependencies_; }
bool should_disallow_heap_access() const {
return flags() & kConcurrentInlining;
}
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
JSHeapBroker* const broker_; JSHeapBroker* const broker_;
Zone* const temp_zone_; Zone* const temp_zone_;

View File

@ -2343,7 +2343,7 @@ base::Optional<ObjectRef> ContextRef::get(int index,
} }
JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* broker_zone, JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* broker_zone,
bool tracing_enabled) bool tracing_enabled, bool is_concurrent_inlining)
: isolate_(isolate), : isolate_(isolate),
zone_(broker_zone), zone_(broker_zone),
refs_(new (zone()) refs_(new (zone())
@ -2351,6 +2351,7 @@ JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* broker_zone,
root_index_map_(isolate), root_index_map_(isolate),
array_and_object_prototypes_(zone()), array_and_object_prototypes_(zone()),
tracing_enabled_(tracing_enabled), tracing_enabled_(tracing_enabled),
is_concurrent_inlining_(is_concurrent_inlining),
feedback_(zone()), feedback_(zone()),
bytecode_analyses_(zone()), bytecode_analyses_(zone()),
property_access_infos_(zone()), property_access_infos_(zone()),
@ -4598,7 +4599,7 @@ ProcessedFeedback const& JSHeapBroker::GetFeedback(
FeedbackSlotKind JSHeapBroker::GetFeedbackSlotKind( FeedbackSlotKind JSHeapBroker::GetFeedbackSlotKind(
FeedbackSource const& source) const { FeedbackSource const& source) const {
if (FLAG_concurrent_inlining) { if (is_concurrent_inlining_) {
ProcessedFeedback const& processed = GetFeedback(source); ProcessedFeedback const& processed = GetFeedback(source);
return processed.slot_kind(); return processed.slot_kind();
} }
@ -4607,7 +4608,7 @@ FeedbackSlotKind JSHeapBroker::GetFeedbackSlotKind(
} }
bool JSHeapBroker::FeedbackIsInsufficient(FeedbackSource const& source) const { bool JSHeapBroker::FeedbackIsInsufficient(FeedbackSource const& source) const {
return FLAG_concurrent_inlining return (is_concurrent_inlining_)
? GetFeedback(source).IsInsufficient() ? GetFeedback(source).IsInsufficient()
: FeedbackNexus(source.vector, source.slot).IsUninitialized(); : FeedbackNexus(source.vector, source.slot).IsUninitialized();
} }
@ -4806,8 +4807,8 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall(
BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation( BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation(
FeedbackSource const& source) { FeedbackSource const& source) {
ProcessedFeedback const& feedback = ProcessedFeedback const& feedback =
FLAG_concurrent_inlining ? GetFeedback(source) (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForBinaryOperation(source); : ProcessFeedbackForBinaryOperation(source);
return feedback.IsInsufficient() ? BinaryOperationHint::kNone return feedback.IsInsufficient() ? BinaryOperationHint::kNone
: feedback.AsBinaryOperation().value(); : feedback.AsBinaryOperation().value();
} }
@ -4815,14 +4816,14 @@ BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation(
CompareOperationHint JSHeapBroker::GetFeedbackForCompareOperation( CompareOperationHint JSHeapBroker::GetFeedbackForCompareOperation(
FeedbackSource const& source) { FeedbackSource const& source) {
ProcessedFeedback const& feedback = ProcessedFeedback const& feedback =
FLAG_concurrent_inlining ? GetFeedback(source) (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForCompareOperation(source); : ProcessFeedbackForCompareOperation(source);
return feedback.IsInsufficient() ? CompareOperationHint::kNone return feedback.IsInsufficient() ? CompareOperationHint::kNone
: feedback.AsCompareOperation().value(); : feedback.AsCompareOperation().value();
} }
ForInHint JSHeapBroker::GetFeedbackForForIn(FeedbackSource const& source) { ForInHint JSHeapBroker::GetFeedbackForForIn(FeedbackSource const& source) {
ProcessedFeedback const& feedback = FLAG_concurrent_inlining ProcessedFeedback const& feedback = (is_concurrent_inlining_)
? GetFeedback(source) ? GetFeedback(source)
: ProcessFeedbackForForIn(source); : ProcessFeedbackForForIn(source);
return feedback.IsInsufficient() ? ForInHint::kNone return feedback.IsInsufficient() ? ForInHint::kNone
@ -4832,46 +4833,46 @@ ForInHint JSHeapBroker::GetFeedbackForForIn(FeedbackSource const& source) {
ProcessedFeedback const& JSHeapBroker::GetFeedbackForPropertyAccess( ProcessedFeedback const& JSHeapBroker::GetFeedbackForPropertyAccess(
FeedbackSource const& source, AccessMode mode, FeedbackSource const& source, AccessMode mode,
base::Optional<NameRef> static_name) { base::Optional<NameRef> static_name) {
return FLAG_concurrent_inlining return (is_concurrent_inlining_)
? GetFeedback(source) ? GetFeedback(source)
: ProcessFeedbackForPropertyAccess(source, mode, static_name); : ProcessFeedbackForPropertyAccess(source, mode, static_name);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForInstanceOf( ProcessedFeedback const& JSHeapBroker::GetFeedbackForInstanceOf(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForInstanceOf(source); : ProcessFeedbackForInstanceOf(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForCall( ProcessedFeedback const& JSHeapBroker::GetFeedbackForCall(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForCall(source); : ProcessFeedbackForCall(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForGlobalAccess( ProcessedFeedback const& JSHeapBroker::GetFeedbackForGlobalAccess(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForGlobalAccess(source); : ProcessFeedbackForGlobalAccess(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForArrayOrObjectLiteral( ProcessedFeedback const& JSHeapBroker::GetFeedbackForArrayOrObjectLiteral(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining return (is_concurrent_inlining_)
? GetFeedback(source) ? GetFeedback(source)
: ProcessFeedbackForArrayOrObjectLiteral(source); : ProcessFeedbackForArrayOrObjectLiteral(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForRegExpLiteral( ProcessedFeedback const& JSHeapBroker::GetFeedbackForRegExpLiteral(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForRegExpLiteral(source); : ProcessFeedbackForRegExpLiteral(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForTemplateObject( ProcessedFeedback const& JSHeapBroker::GetFeedbackForTemplateObject(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return (is_concurrent_inlining_) ? GetFeedback(source)
: ProcessFeedbackForTemplateObject(source); : ProcessFeedbackForTemplateObject(source);
} }
ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForArrayOrObjectLiteral( ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForArrayOrObjectLiteral(
@ -5094,7 +5095,7 @@ PropertyAccessInfo JSHeapBroker::GetPropertyAccessInfo(
AccessInfoFactory factory(this, dependencies, zone()); AccessInfoFactory factory(this, dependencies, zone());
PropertyAccessInfo access_info = factory.ComputePropertyAccessInfo( PropertyAccessInfo access_info = factory.ComputePropertyAccessInfo(
map.object(), name.object(), access_mode); map.object(), name.object(), access_mode);
if (FLAG_concurrent_inlining) { if (is_concurrent_inlining_) {
CHECK(SerializingAllowed()); CHECK(SerializingAllowed());
TRACE(this, "Storing PropertyAccessInfo for " TRACE(this, "Storing PropertyAccessInfo for "
<< access_mode << " of property " << name << " on map " << access_mode << " of property " << name << " on map "

View File

@ -73,7 +73,8 @@ struct PropertyAccessTarget {
class V8_EXPORT_PRIVATE JSHeapBroker { class V8_EXPORT_PRIVATE JSHeapBroker {
public: public:
JSHeapBroker(Isolate* isolate, Zone* broker_zone, bool tracing_enabled); JSHeapBroker(Isolate* isolate, Zone* broker_zone, bool tracing_enabled,
bool is_concurrent_inlining);
// The compilation target's native context. We need the setter because at // The compilation target's native context. We need the setter because at
// broker construction time we don't yet have the canonical handle. // broker construction time we don't yet have the canonical handle.
@ -242,6 +243,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
array_and_object_prototypes_; array_and_object_prototypes_;
BrokerMode mode_ = kDisabled; BrokerMode mode_ = kDisabled;
bool const tracing_enabled_; bool const tracing_enabled_;
bool const is_concurrent_inlining_;
mutable StdoutStream trace_out_; mutable StdoutStream trace_out_;
unsigned trace_indentation_ = 0; unsigned trace_indentation_ = 0;
PerIsolateCompilerCache* compiler_cache_ = nullptr; PerIsolateCompilerCache* compiler_cache_ = nullptr;

View File

@ -127,7 +127,7 @@ JSInliningHeuristic::Candidate JSInliningHeuristic::CollectFunctions(
} }
Reduction JSInliningHeuristic::Reduce(Node* node) { Reduction JSInliningHeuristic::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_acess(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_acess(info_->is_concurrent_inlining());
if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange(); if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange();
@ -222,7 +222,7 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
} }
void JSInliningHeuristic::Finalize() { void JSInliningHeuristic::Finalize() {
DisallowHeapAccessIf no_heap_acess(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_acess(info_->is_concurrent_inlining());
if (candidates_.empty()) return; // Nothing to do without candidates. if (candidates_.empty()) return; // Nothing to do without candidates.
if (FLAG_trace_turbo_inlining) PrintCandidates(); if (FLAG_trace_turbo_inlining) PrintCandidates();

View File

@ -22,6 +22,7 @@ class JSInliningHeuristic final : public AdvancedReducer {
candidates_(local_zone), candidates_(local_zone),
seen_(local_zone), seen_(local_zone),
source_positions_(source_positions), source_positions_(source_positions),
info_(info),
jsgraph_(jsgraph), jsgraph_(jsgraph),
broker_(broker) {} broker_(broker) {}
@ -92,6 +93,7 @@ class JSInliningHeuristic final : public AdvancedReducer {
Candidates candidates_; Candidates candidates_;
ZoneSet<NodeId> seen_; ZoneSet<NodeId> seen_;
SourcePositionTable* source_positions_; SourcePositionTable* source_positions_;
OptimizedCompilationInfo* info_;
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
JSHeapBroker* const broker_; JSHeapBroker* const broker_;
int total_inlined_bytecode_size_ = 0; int total_inlined_bytecode_size_ = 0;

View File

@ -419,7 +419,8 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
// always hold true. // always hold true.
CHECK(shared_info->is_compiled()); CHECK(shared_info->is_compiled());
if (!FLAG_concurrent_inlining && info_->is_source_positions_enabled()) { if (!info_->is_concurrent_inlining() &&
info_->is_source_positions_enabled()) {
SharedFunctionInfo::EnsureSourcePositionsAvailable(isolate(), SharedFunctionInfo::EnsureSourcePositionsAvailable(isolate(),
shared_info->object()); shared_info->object());
} }
@ -457,6 +458,9 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
if (info_->is_bailout_on_uninitialized()) { if (info_->is_bailout_on_uninitialized()) {
flags |= BytecodeGraphBuilderFlag::kBailoutOnUninitialized; flags |= BytecodeGraphBuilderFlag::kBailoutOnUninitialized;
} }
if (info_->is_concurrent_inlining()) {
flags |= BytecodeGraphBuilderFlag::kConcurrentInlining;
}
{ {
CallFrequency frequency = call.frequency(); CallFrequency frequency = call.frequency();
BuildGraphFromBytecode(broker(), zone(), *shared_info, feedback_vector, BuildGraphFromBytecode(broker(), zone(), *shared_info, feedback_vector,

View File

@ -22,11 +22,14 @@ namespace internal {
namespace compiler { namespace compiler {
JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph,
JSHeapBroker* broker) JSHeapBroker* broker, Flags flags)
: AdvancedReducer(editor), jsgraph_(jsgraph), broker_(broker) {} : AdvancedReducer(editor),
jsgraph_(jsgraph),
broker_(broker),
flags_(flags) {}
Reduction JSIntrinsicLowering::Reduce(Node* node) { Reduction JSIntrinsicLowering::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf no_heap_access(flags_ & kConcurrentInlining);
if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange(); if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange();
const Runtime::Function* const f = const Runtime::Function* const f =

View File

@ -31,7 +31,12 @@ class SimplifiedOperatorBuilder;
class V8_EXPORT_PRIVATE JSIntrinsicLowering final class V8_EXPORT_PRIVATE JSIntrinsicLowering final
: public NON_EXPORTED_BASE(AdvancedReducer) { : public NON_EXPORTED_BASE(AdvancedReducer) {
public: public:
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker); // Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kConcurrentInlining = 1u << 0 };
using Flags = base::Flags<Flag>;
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker,
Flags flags);
~JSIntrinsicLowering() final = default; ~JSIntrinsicLowering() final = default;
const char* reducer_name() const override { return "JSIntrinsicLowering"; } const char* reducer_name() const override { return "JSIntrinsicLowering"; }
@ -90,6 +95,7 @@ class V8_EXPORT_PRIVATE JSIntrinsicLowering final
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
JSHeapBroker* const broker_; JSHeapBroker* const broker_;
Flags const flags_;
}; };
} // namespace compiler } // namespace compiler

View File

@ -69,7 +69,7 @@ JSNativeContextSpecialization::JSNativeContextSpecialization(
type_cache_(TypeCache::Get()) {} type_cache_(TypeCache::Get()) {}
Reduction JSNativeContextSpecialization::Reduce(Node* node) { Reduction JSNativeContextSpecialization::Reduce(Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kJSAdd: case IrOpcode::kJSAdd:
@ -351,7 +351,7 @@ Reduction JSNativeContextSpecialization::ReduceJSGetSuperConstructor(
if (!m.HasValue()) return NoChange(); if (!m.HasValue()) return NoChange();
JSFunctionRef function = m.Ref(broker()).AsJSFunction(); JSFunctionRef function = m.Ref(broker()).AsJSFunction();
MapRef function_map = function.map(); MapRef function_map = function.map();
if (FLAG_concurrent_inlining && !function_map.serialized_prototype()) { if (should_disallow_heap_access() && !function_map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), "data for map " << function_map); TRACE_BROKER_MISSING(broker(), "data for map " << function_map);
return NoChange(); return NoChange();
} }
@ -403,7 +403,7 @@ Reduction JSNativeContextSpecialization::ReduceJSInstanceOf(Node* node) {
MapRef receiver_map = receiver_ref.map(); MapRef receiver_map = receiver_ref.map();
PropertyAccessInfo access_info = PropertyAccessInfo::Invalid(graph()->zone()); PropertyAccessInfo access_info = PropertyAccessInfo::Invalid(graph()->zone());
if (FLAG_concurrent_inlining) { if (should_disallow_heap_access()) {
access_info = broker()->GetPropertyAccessInfo( access_info = broker()->GetPropertyAccessInfo(
receiver_map, receiver_map,
NameRef(broker(), isolate()->factory()->has_instance_symbol()), NameRef(broker(), isolate()->factory()->has_instance_symbol()),
@ -529,7 +529,7 @@ JSNativeContextSpecialization::InferHasInPrototypeChain(
all = false; all = false;
break; break;
} }
if (FLAG_concurrent_inlining && !map.serialized_prototype()) { if (should_disallow_heap_access() && !map.serialized_prototype()) {
TRACE_BROKER_MISSING(broker(), "prototype data for map " << map); TRACE_BROKER_MISSING(broker(), "prototype data for map " << map);
return kMayBeInPrototypeChain; return kMayBeInPrototypeChain;
} }
@ -608,7 +608,7 @@ Reduction JSNativeContextSpecialization::ReduceJSOrdinaryHasInstance(
// OrdinaryHasInstance on bound functions turns into a recursive invocation // OrdinaryHasInstance on bound functions turns into a recursive invocation
// of the instanceof operator again. // of the instanceof operator again.
JSBoundFunctionRef function = m.Ref(broker()).AsJSBoundFunction(); JSBoundFunctionRef function = m.Ref(broker()).AsJSBoundFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), "data for JSBoundFunction " << function); TRACE_BROKER_MISSING(broker(), "data for JSBoundFunction " << function);
return NoChange(); return NoChange();
} }
@ -627,7 +627,7 @@ Reduction JSNativeContextSpecialization::ReduceJSOrdinaryHasInstance(
// Optimize if we currently know the "prototype" property. // Optimize if we currently know the "prototype" property.
JSFunctionRef function = m.Ref(broker()).AsJSFunction(); JSFunctionRef function = m.Ref(broker()).AsJSFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), "data for JSFunction " << function); TRACE_BROKER_MISSING(broker(), "data for JSFunction " << function);
return NoChange(); return NoChange();
} }
@ -706,7 +706,7 @@ Reduction JSNativeContextSpecialization::ReduceJSResolvePromise(Node* node) {
ZoneVector<PropertyAccessInfo> access_infos(graph()->zone()); ZoneVector<PropertyAccessInfo> access_infos(graph()->zone());
AccessInfoFactory access_info_factory(broker(), dependencies(), AccessInfoFactory access_info_factory(broker(), dependencies(),
graph()->zone()); graph()->zone());
if (!FLAG_concurrent_inlining) { if (!should_disallow_heap_access()) {
access_info_factory.ComputePropertyAccessInfos( access_info_factory.ComputePropertyAccessInfos(
resolution_maps, factory()->then_string(), AccessMode::kLoad, resolution_maps, factory()->then_string(), AccessMode::kLoad,
&access_infos); &access_infos);
@ -1078,8 +1078,9 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
if (map.is_deprecated()) continue; if (map.is_deprecated()) continue;
PropertyAccessInfo access_info = broker()->GetPropertyAccessInfo( PropertyAccessInfo access_info = broker()->GetPropertyAccessInfo(
map, feedback.name(), access_mode, dependencies(), map, feedback.name(), access_mode, dependencies(),
FLAG_concurrent_inlining ? SerializationPolicy::kAssumeSerialized should_disallow_heap_access()
: SerializationPolicy::kSerializeIfNeeded); ? SerializationPolicy::kAssumeSerialized
: SerializationPolicy::kSerializeIfNeeded);
access_infos_for_feedback.push_back(access_info); access_infos_for_feedback.push_back(access_info);
} }
@ -1326,7 +1327,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) {
name.equals(ObjectRef(broker(), factory()->prototype_string()))) { name.equals(ObjectRef(broker(), factory()->prototype_string()))) {
// Optimize "prototype" property of functions. // Optimize "prototype" property of functions.
JSFunctionRef function = object.AsJSFunction(); JSFunctionRef function = object.AsJSFunction();
if (FLAG_concurrent_inlining && !function.serialized()) { if (should_disallow_heap_access() && !function.serialized()) {
TRACE_BROKER_MISSING(broker(), "data for function " << function); TRACE_BROKER_MISSING(broker(), "data for function " << function);
return NoChange(); return NoChange();
} }
@ -1622,7 +1623,7 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
base::Optional<JSTypedArrayRef> typed_array = base::Optional<JSTypedArrayRef> typed_array =
GetTypedArrayConstant(broker(), receiver); GetTypedArrayConstant(broker(), receiver);
if (typed_array.has_value()) { if (typed_array.has_value()) {
if (FLAG_concurrent_inlining && !typed_array->serialized()) { if (should_disallow_heap_access() && !typed_array->serialized()) {
TRACE_BROKER_MISSING(broker(), "data for typed array " << *typed_array); TRACE_BROKER_MISSING(broker(), "data for typed array " << *typed_array);
return NoChange(); return NoChange();
} }
@ -1839,7 +1840,7 @@ Reduction JSNativeContextSpecialization::ReduceElementLoadFromHeapConstant(
Reduction JSNativeContextSpecialization::ReducePropertyAccess( Reduction JSNativeContextSpecialization::ReducePropertyAccess(
Node* node, Node* key, base::Optional<NameRef> static_name, Node* value, Node* node, Node* key, base::Optional<NameRef> static_name, Node* value,
FeedbackSource const& source, AccessMode access_mode) { FeedbackSource const& source, AccessMode access_mode) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining); DisallowHeapAccessIf disallow_heap_access(should_disallow_heap_access());
DCHECK_EQ(key == nullptr, static_name.has_value()); DCHECK_EQ(key == nullptr, static_name.has_value());
DCHECK(node->opcode() == IrOpcode::kJSLoadProperty || DCHECK(node->opcode() == IrOpcode::kJSLoadProperty ||

View File

@ -44,7 +44,11 @@ class V8_EXPORT_PRIVATE JSNativeContextSpecialization final
: public AdvancedReducer { : public AdvancedReducer {
public: public:
// Flags that control the mode of operation. // Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kBailoutOnUninitialized = 1u << 0 }; enum Flag {
kNoFlags = 0u,
kBailoutOnUninitialized = 1u << 0,
kConcurrentInlining = 1u << 1
};
using Flags = base::Flags<Flag>; using Flags = base::Flags<Flag>;
JSNativeContextSpecialization(Editor* editor, JSGraph* jsgraph, JSNativeContextSpecialization(Editor* editor, JSGraph* jsgraph,
@ -248,6 +252,10 @@ class V8_EXPORT_PRIVATE JSNativeContextSpecialization final
Zone* zone() const { return zone_; } Zone* zone() const { return zone_; }
Zone* shared_zone() const { return shared_zone_; } Zone* shared_zone() const { return shared_zone_; }
bool should_disallow_heap_access() const {
return flags() & kConcurrentInlining;
}
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
JSHeapBroker* const broker_; JSHeapBroker* const broker_;
Flags const flags_; Flags const flags_;

View File

@ -132,7 +132,8 @@ class PipelineData {
// For main entry point. // For main entry point.
PipelineData(ZoneStats* zone_stats, Isolate* isolate, PipelineData(ZoneStats* zone_stats, Isolate* isolate,
OptimizedCompilationInfo* info, OptimizedCompilationInfo* info,
PipelineStatistics* pipeline_statistics) PipelineStatistics* pipeline_statistics,
bool is_concurrent_inlining)
: isolate_(isolate), : isolate_(isolate),
allocator_(isolate->allocator()), allocator_(isolate->allocator()),
info_(info), info_(info),
@ -150,7 +151,8 @@ class PipelineData {
codegen_zone_scope_(zone_stats_, kCodegenZoneName), codegen_zone_scope_(zone_stats_, kCodegenZoneName),
codegen_zone_(codegen_zone_scope_.zone()), codegen_zone_(codegen_zone_scope_.zone()),
broker_(new JSHeapBroker(isolate_, info_->zone(), broker_(new JSHeapBroker(isolate_, info_->zone(),
info_->trace_heap_broker_enabled())), info_->trace_heap_broker_enabled(),
is_concurrent_inlining)),
register_allocation_zone_scope_(zone_stats_, register_allocation_zone_scope_(zone_stats_,
kRegisterAllocationZoneName), kRegisterAllocationZoneName),
register_allocation_zone_(register_allocation_zone_scope_.zone()), register_allocation_zone_(register_allocation_zone_scope_.zone()),
@ -968,7 +970,8 @@ class PipelineCompilationJob final : public OptimizedCompilationJob {
public: public:
PipelineCompilationJob(Isolate* isolate, PipelineCompilationJob(Isolate* isolate,
Handle<SharedFunctionInfo> shared_info, Handle<SharedFunctionInfo> shared_info,
Handle<JSFunction> function); Handle<JSFunction> function,
bool is_concurrent_inlining);
~PipelineCompilationJob() final; ~PipelineCompilationJob() final;
protected: protected:
@ -993,7 +996,7 @@ class PipelineCompilationJob final : public OptimizedCompilationJob {
PipelineCompilationJob::PipelineCompilationJob( PipelineCompilationJob::PipelineCompilationJob(
Isolate* isolate, Handle<SharedFunctionInfo> shared_info, Isolate* isolate, Handle<SharedFunctionInfo> shared_info,
Handle<JSFunction> function) Handle<JSFunction> function, bool is_concurrent_inlining)
// Note that the OptimizedCompilationInfo is not initialized at the time // Note that the OptimizedCompilationInfo is not initialized at the time
// we pass it to the CompilationJob constructor, but it is not // we pass it to the CompilationJob constructor, but it is not
// dereferenced there. // dereferenced there.
@ -1006,10 +1009,9 @@ PipelineCompilationJob::PipelineCompilationJob(
handle(Script::cast(shared_info->script()), isolate), handle(Script::cast(shared_info->script()), isolate),
compilation_info(), function->GetIsolate(), &zone_stats_)), compilation_info(), function->GetIsolate(), &zone_stats_)),
data_(&zone_stats_, function->GetIsolate(), compilation_info(), data_(&zone_stats_, function->GetIsolate(), compilation_info(),
pipeline_statistics_.get()), pipeline_statistics_.get(), is_concurrent_inlining),
pipeline_(&data_), pipeline_(&data_),
linkage_(nullptr) { linkage_(nullptr) {}
}
PipelineCompilationJob::~PipelineCompilationJob() { PipelineCompilationJob::~PipelineCompilationJob() {
} }
@ -1030,6 +1032,9 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl(
if (FLAG_turbo_inlining) { if (FLAG_turbo_inlining) {
compilation_info()->MarkAsInliningEnabled(); compilation_info()->MarkAsInliningEnabled();
} }
if (FLAG_concurrent_inlining && !compilation_info()->is_osr()) {
compilation_info()->MarkAsConcurrentInlining();
}
// This is the bottleneck for computing and setting poisoning level in the // This is the bottleneck for computing and setting poisoning level in the
// optimizing compiler. // optimizing compiler.
@ -1078,7 +1083,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl(
pipeline_.Serialize(); pipeline_.Serialize();
if (!FLAG_concurrent_inlining) { if (!compilation_info()->is_concurrent_inlining()) {
if (!pipeline_.CreateGraph()) { if (!pipeline_.CreateGraph()) {
CHECK(!isolate->has_pending_exception()); CHECK(!isolate->has_pending_exception());
return AbortOptimization(BailoutReason::kGraphBuildingFailed); return AbortOptimization(BailoutReason::kGraphBuildingFailed);
@ -1110,7 +1115,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::ExecuteJobImpl(
// Ensure that the RuntimeCallStats table is only available during execution // Ensure that the RuntimeCallStats table is only available during execution
// and not during finalization as that might be on a different thread. // and not during finalization as that might be on a different thread.
PipelineExecuteJobScope scope(&data_, stats); PipelineExecuteJobScope scope(&data_, stats);
if (FLAG_concurrent_inlining) { if (compilation_info()->is_concurrent_inlining()) {
if (!pipeline_.CreateGraph()) { if (!pipeline_.CreateGraph()) {
return AbortOptimization(BailoutReason::kGraphBuildingFailed); return AbortOptimization(BailoutReason::kGraphBuildingFailed);
} }
@ -1323,6 +1328,9 @@ struct GraphBuilderPhase {
if (data->info()->is_bailout_on_uninitialized()) { if (data->info()->is_bailout_on_uninitialized()) {
flags |= BytecodeGraphBuilderFlag::kBailoutOnUninitialized; flags |= BytecodeGraphBuilderFlag::kBailoutOnUninitialized;
} }
if (data->info()->is_concurrent_inlining()) {
flags |= BytecodeGraphBuilderFlag::kConcurrentInlining;
}
JSFunctionRef closure(data->broker(), data->info()->closure()); JSFunctionRef closure(data->broker(), data->info()->closure());
CallFrequency frequency(1.0f); CallFrequency frequency(1.0f);
@ -1347,11 +1355,15 @@ struct InliningPhase {
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags;
if (data->info()->is_bailout_on_uninitialized()) {
call_reducer_flags |= JSCallReducer::kBailoutOnUninitialized;
}
if (data->info()->is_concurrent_inlining()) {
call_reducer_flags |= JSCallReducer::kConcurrentInlining;
}
JSCallReducer call_reducer(&graph_reducer, data->jsgraph(), data->broker(), JSCallReducer call_reducer(&graph_reducer, data->jsgraph(), data->broker(),
temp_zone, temp_zone, call_reducer_flags,
data->info()->is_bailout_on_uninitialized()
? JSCallReducer::kBailoutOnUninitialized
: JSCallReducer::kNoFlags,
data->dependencies()); data->dependencies());
JSContextSpecialization context_specialization( JSContextSpecialization context_specialization(
&graph_reducer, data->jsgraph(), data->broker(), &graph_reducer, data->jsgraph(), data->broker(),
@ -1364,6 +1376,9 @@ struct InliningPhase {
if (data->info()->is_bailout_on_uninitialized()) { if (data->info()->is_bailout_on_uninitialized()) {
flags |= JSNativeContextSpecialization::kBailoutOnUninitialized; flags |= JSNativeContextSpecialization::kBailoutOnUninitialized;
} }
if (data->info()->is_concurrent_inlining()) {
flags |= JSNativeContextSpecialization::kConcurrentInlining;
}
// Passing the OptimizedCompilationInfo's shared zone here as // Passing the OptimizedCompilationInfo's shared zone here as
// JSNativeContextSpecialization allocates out-of-heap objects // JSNativeContextSpecialization allocates out-of-heap objects
// that need to live until code generation. // that need to live until code generation.
@ -1373,8 +1388,15 @@ struct InliningPhase {
JSInliningHeuristic inlining(&graph_reducer, JSInliningHeuristic inlining(&graph_reducer,
temp_zone, data->info(), data->jsgraph(), temp_zone, data->info(), data->jsgraph(),
data->broker(), data->source_positions()); data->broker(), data->source_positions());
JSIntrinsicLowering::Flags intrinsic_lowering_flags =
JSIntrinsicLowering::kNoFlags;
if (data->info()->is_concurrent_inlining()) {
intrinsic_lowering_flags |= JSIntrinsicLowering::kConcurrentInlining;
}
JSIntrinsicLowering intrinsic_lowering(&graph_reducer, data->jsgraph(), JSIntrinsicLowering intrinsic_lowering(&graph_reducer, data->jsgraph(),
data->broker()); data->broker(),
intrinsic_lowering_flags);
AddReducer(data, &graph_reducer, &dead_code_elimination); AddReducer(data, &graph_reducer, &dead_code_elimination);
AddReducer(data, &graph_reducer, &checkpoint_elimination); AddReducer(data, &graph_reducer, &checkpoint_elimination);
AddReducer(data, &graph_reducer, &common_reducer); AddReducer(data, &graph_reducer, &common_reducer);
@ -2349,7 +2371,7 @@ void PipelineImpl::Serialize() {
} }
data->broker()->SetTargetNativeContextRef(data->native_context()); data->broker()->SetTargetNativeContextRef(data->native_context());
if (FLAG_concurrent_inlining) { if (data->info()->is_concurrent_inlining()) {
Run<HeapBrokerInitializationPhase>(); Run<HeapBrokerInitializationPhase>();
Run<SerializationPhase>(); Run<SerializationPhase>();
data->broker()->StopSerializing(); data->broker()->StopSerializing();
@ -2389,7 +2411,7 @@ bool PipelineImpl::CreateGraph() {
// Run the type-sensitive lowerings and optimizations on the graph. // Run the type-sensitive lowerings and optimizations on the graph.
{ {
if (!FLAG_concurrent_inlining) { if (!data->info()->is_concurrent_inlining()) {
Run<HeapBrokerInitializationPhase>(); Run<HeapBrokerInitializationPhase>();
Run<CopyMetadataForConcurrentCompilePhase>(); Run<CopyMetadataForConcurrentCompilePhase>();
data->broker()->StopSerializing(); data->broker()->StopSerializing();
@ -2786,7 +2808,12 @@ MaybeHandle<Code> Pipeline::GenerateCodeForTesting(
std::unique_ptr<PipelineStatistics> pipeline_statistics( std::unique_ptr<PipelineStatistics> pipeline_statistics(
CreatePipelineStatistics(Handle<Script>::null(), info, isolate, CreatePipelineStatistics(Handle<Script>::null(), info, isolate,
&zone_stats)); &zone_stats));
PipelineData data(&zone_stats, isolate, info, pipeline_statistics.get()); if (i::FLAG_concurrent_inlining) {
info->MarkAsConcurrentInlining();
}
PipelineData data(&zone_stats, isolate, info, pipeline_statistics.get(),
info->is_concurrent_inlining());
PipelineImpl pipeline(&data); PipelineImpl pipeline(&data);
Linkage linkage(Linkage::ComputeIncoming(data.instruction_zone(), info)); Linkage linkage(Linkage::ComputeIncoming(data.instruction_zone(), info));
@ -2848,10 +2875,12 @@ MaybeHandle<Code> Pipeline::GenerateCodeForTesting(
// static // static
std::unique_ptr<OptimizedCompilationJob> Pipeline::NewCompilationJob( std::unique_ptr<OptimizedCompilationJob> Pipeline::NewCompilationJob(
Isolate* isolate, Handle<JSFunction> function, bool has_script) { Isolate* isolate, Handle<JSFunction> function, bool has_script,
bool is_concurrent_inlining) {
Handle<SharedFunctionInfo> shared = Handle<SharedFunctionInfo> shared =
handle(function->shared(), function->GetIsolate()); handle(function->shared(), function->GetIsolate());
return std::make_unique<PipelineCompilationJob>(isolate, shared, function); return std::make_unique<PipelineCompilationJob>(isolate, shared, function,
is_concurrent_inlining);
} }
// static // static

View File

@ -45,7 +45,8 @@ class Pipeline : public AllStatic {
public: public:
// Returns a new compilation job for the given JavaScript function. // Returns a new compilation job for the given JavaScript function.
static std::unique_ptr<OptimizedCompilationJob> NewCompilationJob( static std::unique_ptr<OptimizedCompilationJob> NewCompilationJob(
Isolate* isolate, Handle<JSFunction> function, bool has_script); Isolate* isolate, Handle<JSFunction> function, bool has_script,
bool is_concurrent_inlining);
// Run the pipeline for the WebAssembly compilation info. // Run the pipeline for the WebAssembly compilation info.
static void GenerateCodeForWasmFunction( static void GenerateCodeForWasmFunction(

View File

@ -38,7 +38,7 @@ class JSConstantCacheTester : public HandleAndZoneScope,
JSGraph(main_isolate(), &main_graph_, &main_common_, &main_javascript_, JSGraph(main_isolate(), &main_graph_, &main_common_, &main_javascript_,
nullptr, &main_machine_), nullptr, &main_machine_),
canonical_(main_isolate()), canonical_(main_isolate()),
broker_(main_isolate(), main_zone(), false) { broker_(main_isolate(), main_zone(), false, false) {
main_graph_.SetStart(main_graph_.NewNode(common()->Start(0))); main_graph_.SetStart(main_graph_.NewNode(common()->Start(0)));
main_graph_.SetEnd( main_graph_.SetEnd(
main_graph_.NewNode(common()->End(1), main_graph_.start())); main_graph_.NewNode(common()->End(1), main_graph_.start()));

View File

@ -33,7 +33,8 @@ class ContextSpecializationTester : public HandleAndZoneScope {
jsgraph_(main_isolate(), graph(), common(), &javascript_, &simplified_, jsgraph_(main_isolate(), graph(), common(), &javascript_, &simplified_,
&machine_), &machine_),
reducer_(main_zone(), graph(), &tick_counter_), reducer_(main_zone(), graph(), &tick_counter_),
js_heap_broker_(main_isolate(), main_zone(), FLAG_trace_heap_broker), js_heap_broker_(main_isolate(), main_zone(), FLAG_trace_heap_broker,
false),
spec_(&reducer_, jsgraph(), &js_heap_broker_, context, spec_(&reducer_, jsgraph(), &js_heap_broker_, context,
MaybeHandle<JSFunction>()) {} MaybeHandle<JSFunction>()) {}

View File

@ -26,7 +26,7 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
explicit JSTypedLoweringTester(int num_parameters = 0) explicit JSTypedLoweringTester(int num_parameters = 0)
: isolate(main_isolate()), : isolate(main_isolate()),
canonical(isolate), canonical(isolate),
js_heap_broker(isolate, main_zone(), FLAG_trace_heap_broker), js_heap_broker(isolate, main_zone(), FLAG_trace_heap_broker, false),
binop(nullptr), binop(nullptr),
unop(nullptr), unop(nullptr),
javascript(main_zone()), javascript(main_zone()),

View File

@ -27,7 +27,7 @@ class RepresentationChangerTester : public HandleAndZoneScope,
javascript_(main_zone()), javascript_(main_zone()),
jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_, jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_,
&main_simplified_, &main_machine_), &main_simplified_, &main_machine_),
broker_{main_isolate(), main_zone(), FLAG_trace_heap_broker}, broker_{main_isolate(), main_zone(), FLAG_trace_heap_broker, false},
changer_(&jsgraph_, &broker_) { changer_(&jsgraph_, &broker_) {
Node* s = graph()->NewNode(common()->Start(num_parameters)); Node* s = graph()->NewNode(common()->Start(num_parameters));
graph()->SetStart(s); graph()->SetStart(s);

View File

@ -42,7 +42,7 @@ class Types {
public: public:
Types(Zone* zone, Isolate* isolate, v8::base::RandomNumberGenerator* rng) Types(Zone* zone, Isolate* isolate, v8::base::RandomNumberGenerator* rng)
: zone_(zone), : zone_(zone),
js_heap_broker_(isolate, zone, FLAG_trace_heap_broker), js_heap_broker_(isolate, zone, FLAG_trace_heap_broker, false),
rng_(rng) { rng_(rng) {
#define DECLARE_TYPE(name, value) \ #define DECLARE_TYPE(name, value) \
name = Type::name(); \ name = Type::name(); \

View File

@ -29,7 +29,7 @@ class CommonOperatorReducerTest : public GraphTest {
Reduction Reduce( Reduction Reduce(
AdvancedReducer::Editor* editor, Node* node, AdvancedReducer::Editor* editor, Node* node,
MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags) { MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags) {
JSHeapBroker broker(isolate(), zone(), FLAG_trace_heap_broker); JSHeapBroker broker(isolate(), zone(), FLAG_trace_heap_broker, false);
MachineOperatorBuilder machine(zone(), MachineType::PointerRepresentation(), MachineOperatorBuilder machine(zone(), MachineType::PointerRepresentation(),
flags); flags);
CommonOperatorReducer reducer(editor, graph(), &broker, common(), &machine, CommonOperatorReducer reducer(editor, graph(), &broker, common(), &machine,

View File

@ -63,7 +63,7 @@ class ConstantFoldingReducerTest : public TypedGraphTest {
public: public:
ConstantFoldingReducerTest() ConstantFoldingReducerTest()
: TypedGraphTest(3), : TypedGraphTest(3),
broker_(isolate(), zone(), FLAG_trace_heap_broker), broker_(isolate(), zone(), FLAG_trace_heap_broker, false),
simplified_(zone()), simplified_(zone()),
deps_(&broker_, zone()) {} deps_(&broker_, zone()) {}
~ConstantFoldingReducerTest() override = default; ~ConstantFoldingReducerTest() override = default;

View File

@ -18,7 +18,7 @@ GraphTest::GraphTest(int num_parameters)
: canonical_(isolate()), : canonical_(isolate()),
common_(zone()), common_(zone()),
graph_(zone()), graph_(zone()),
broker_(isolate(), zone(), FLAG_trace_heap_broker), broker_(isolate(), zone(), FLAG_trace_heap_broker, false),
source_positions_(&graph_), source_positions_(&graph_),
node_origins_(&graph_) { node_origins_(&graph_) {
graph()->SetStart(graph()->NewNode(common()->Start(num_parameters))); graph()->SetStart(graph()->NewNode(common()->Start(num_parameters)));

View File

@ -37,7 +37,8 @@ class JSIntrinsicLoweringTest : public GraphTest {
&machine); &machine);
// TODO(titzer): mock the GraphReducer here for better unit testing. // TODO(titzer): mock the GraphReducer here for better unit testing.
GraphReducer graph_reducer(zone(), graph(), tick_counter()); GraphReducer graph_reducer(zone(), graph(), tick_counter());
JSIntrinsicLowering reducer(&graph_reducer, &jsgraph, broker()); JSIntrinsicLowering reducer(&graph_reducer, &jsgraph, broker(),
JSIntrinsicLowering::kNoFlags);
return reducer.Reduce(node); return reducer.Reduce(node);
} }

View File

@ -30,7 +30,7 @@ class SimplifiedOperatorReducerTest : public GraphTest {
protected: protected:
Reduction Reduce(Node* node) { Reduction Reduce(Node* node) {
JSHeapBroker broker(isolate(), zone(), FLAG_trace_heap_broker); JSHeapBroker broker(isolate(), zone(), FLAG_trace_heap_broker, false);
MachineOperatorBuilder machine(zone()); MachineOperatorBuilder machine(zone());
JSOperatorBuilder javascript(zone()); JSOperatorBuilder javascript(zone());
JSGraph jsgraph(isolate(), graph(), common(), &javascript, simplified(), JSGraph jsgraph(isolate(), graph(), common(), &javascript, simplified(),

View File

@ -22,7 +22,7 @@ class TyperTest : public TypedGraphTest {
public: public:
TyperTest() TyperTest()
: TypedGraphTest(3), : TypedGraphTest(3),
broker_(isolate(), zone(), FLAG_trace_heap_broker), broker_(isolate(), zone(), FLAG_trace_heap_broker, false),
operation_typer_(&broker_, zone()), operation_typer_(&broker_, zone()),
types_(zone(), isolate(), random_number_generator()), types_(zone(), isolate(), random_number_generator()),
javascript_(zone()), javascript_(zone()),