Commit f30b53bd authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[nci] Add native_context_independent flags

... to OptimizedCompilationInfo, BytecodeGraphBuilder, and
JSHeapBroker.

Also add first uses of these flags in pipeline.cc by skipping certain
phases when nci is enabled. With this change, tests in the NCI variant
will start to fail since generic lowering is not fully implemented.
These implementations will follow incrementally in the next days.

Bug: v8:8888
Change-Id: I3f570fb92f09059d1f1f4015f88ffe80ccf746ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2239572
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68339}
parent 340c5458
...@@ -19,7 +19,7 @@ namespace internal { ...@@ -19,7 +19,7 @@ namespace internal {
OptimizedCompilationInfo::OptimizedCompilationInfo( OptimizedCompilationInfo::OptimizedCompilationInfo(
Zone* zone, Isolate* isolate, Handle<SharedFunctionInfo> shared, Zone* zone, Isolate* isolate, Handle<SharedFunctionInfo> shared,
Handle<JSFunction> closure) Handle<JSFunction> closure, bool native_context_independent)
: OptimizedCompilationInfo(Code::OPTIMIZED_FUNCTION, zone) { : OptimizedCompilationInfo(Code::OPTIMIZED_FUNCTION, zone) {
DCHECK_EQ(*shared, closure->shared()); DCHECK_EQ(*shared, closure->shared());
DCHECK(shared->is_compiled()); DCHECK(shared->is_compiled());
...@@ -35,6 +35,7 @@ OptimizedCompilationInfo::OptimizedCompilationInfo( ...@@ -35,6 +35,7 @@ OptimizedCompilationInfo::OptimizedCompilationInfo(
set_source_positions(); set_source_positions();
} }
if (native_context_independent) set_native_context_independent();
SetTracingFlags(shared->PassesFilter(FLAG_trace_turbo_filter)); SetTracingFlags(shared->PassesFilter(FLAG_trace_turbo_filter));
} }
......
...@@ -67,7 +67,8 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final { ...@@ -67,7 +67,8 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
V(WasmRuntimeExceptionSupport, wasm_runtime_exception_support, 18) \ V(WasmRuntimeExceptionSupport, wasm_runtime_exception_support, 18) \
V(TurboControlFlowAwareAllocation, turbo_control_flow_aware_allocation, 19) \ V(TurboControlFlowAwareAllocation, turbo_control_flow_aware_allocation, 19) \
V(TurboPreprocessRanges, turbo_preprocess_ranges, 20) \ V(TurboPreprocessRanges, turbo_preprocess_ranges, 20) \
V(ConcurrentInlining, concurrent_inlining, 21) V(ConcurrentInlining, concurrent_inlining, 21) \
V(NativeContextIndependent, native_context_independent, 22)
enum Flag { enum Flag {
#define DEF_ENUM(Camel, Lower, Bit) k##Camel = 1 << Bit, #define DEF_ENUM(Camel, Lower, Bit) k##Camel = 1 << Bit,
...@@ -99,7 +100,8 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final { ...@@ -99,7 +100,8 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
// Construct a compilation info for optimized compilation. // Construct a compilation info for optimized compilation.
OptimizedCompilationInfo(Zone* zone, Isolate* isolate, OptimizedCompilationInfo(Zone* zone, Isolate* isolate,
Handle<SharedFunctionInfo> shared, Handle<SharedFunctionInfo> shared,
Handle<JSFunction> closure); Handle<JSFunction> closure,
bool native_context_independent);
// Construct a compilation info for stub compilation, Wasm, and testing. // Construct a compilation info for stub compilation, Wasm, and testing.
OptimizedCompilationInfo(Vector<const char> debug_name, Zone* zone, OptimizedCompilationInfo(Vector<const char> debug_name, Zone* zone,
Code::Kind code_kind); Code::Kind code_kind);
......
...@@ -33,6 +33,7 @@ enum class BytecodeGraphBuilderFlag : uint8_t { ...@@ -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,
kNativeContextIndependent = 1 << 3,
}; };
using BytecodeGraphBuilderFlags = base::Flags<BytecodeGraphBuilderFlag>; using BytecodeGraphBuilderFlags = base::Flags<BytecodeGraphBuilderFlag>;
......
...@@ -2385,7 +2385,8 @@ base::Optional<ObjectRef> ContextRef::get(int index, ...@@ -2385,7 +2385,8 @@ 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 is_concurrent_inlining) bool tracing_enabled, bool is_concurrent_inlining,
bool is_native_context_independent)
: isolate_(isolate), : isolate_(isolate),
zone_(broker_zone), zone_(broker_zone),
refs_(new (zone()) refs_(new (zone())
...@@ -2394,6 +2395,7 @@ JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* broker_zone, ...@@ -2394,6 +2395,7 @@ JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* broker_zone,
array_and_object_prototypes_(zone()), array_and_object_prototypes_(zone()),
tracing_enabled_(tracing_enabled), tracing_enabled_(tracing_enabled),
is_concurrent_inlining_(is_concurrent_inlining), is_concurrent_inlining_(is_concurrent_inlining),
is_native_context_independent_(is_native_context_independent),
feedback_(zone()), feedback_(zone()),
bytecode_analyses_(zone()), bytecode_analyses_(zone()),
property_access_infos_(zone()), property_access_infos_(zone()),
......
...@@ -74,7 +74,13 @@ struct PropertyAccessTarget { ...@@ -74,7 +74,13 @@ 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); bool is_concurrent_inlining, bool is_native_context_independent);
// For use only in tests, sets default values for some arguments. Avoids
// churn when new flags are added.
JSHeapBroker(Isolate* isolate, Zone* broker_zone)
: JSHeapBroker(isolate, broker_zone, FLAG_trace_heap_broker, false,
false) {}
// 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.
...@@ -89,6 +95,9 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -89,6 +95,9 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
Zone* zone() const { return zone_; } Zone* zone() const { return zone_; }
bool tracing_enabled() const { return tracing_enabled_; } bool tracing_enabled() const { return tracing_enabled_; }
bool is_concurrent_inlining() const { return is_concurrent_inlining_; } bool is_concurrent_inlining() const { return is_concurrent_inlining_; }
bool is_native_context_independent() const {
return is_native_context_independent_;
}
enum BrokerMode { kDisabled, kSerializing, kSerialized, kRetired }; enum BrokerMode { kDisabled, kSerializing, kSerialized, kRetired };
BrokerMode mode() const { return mode_; } BrokerMode mode() const { return mode_; }
...@@ -242,6 +251,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -242,6 +251,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
BrokerMode mode_ = kDisabled; BrokerMode mode_ = kDisabled;
bool const tracing_enabled_; bool const tracing_enabled_;
bool const is_concurrent_inlining_; bool const is_concurrent_inlining_;
bool const is_native_context_independent_;
unsigned trace_indentation_ = 0; unsigned trace_indentation_ = 0;
PerIsolateCompilerCache* compiler_cache_ = nullptr; PerIsolateCompilerCache* compiler_cache_ = nullptr;
ZoneUnorderedMap<FeedbackSource, ProcessedFeedback const*, ZoneUnorderedMap<FeedbackSource, ProcessedFeedback const*,
......
...@@ -150,9 +150,9 @@ class PipelineData { ...@@ -150,9 +150,9 @@ class PipelineData {
instruction_zone_(instruction_zone_scope_.zone()), instruction_zone_(instruction_zone_scope_.zone()),
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(
info_->trace_heap_broker(), isolate_, info_->zone(), info_->trace_heap_broker(),
is_concurrent_inlining)), is_concurrent_inlining, info->native_context_independent())),
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()),
...@@ -1008,7 +1008,8 @@ PipelineCompilationJob::PipelineCompilationJob( ...@@ -1008,7 +1008,8 @@ PipelineCompilationJob::PipelineCompilationJob(
zone_(function->GetIsolate()->allocator(), zone_(function->GetIsolate()->allocator(),
kPipelineCompilationJobZoneName), kPipelineCompilationJobZoneName),
zone_stats_(function->GetIsolate()->allocator()), zone_stats_(function->GetIsolate()->allocator()),
compilation_info_(&zone_, function->GetIsolate(), shared_info, function), compilation_info_(&zone_, function->GetIsolate(), shared_info, function,
FLAG_turbo_nci),
pipeline_statistics_(CreatePipelineStatistics( pipeline_statistics_(CreatePipelineStatistics(
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_)),
...@@ -1051,13 +1052,14 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl( ...@@ -1051,13 +1052,14 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl(
return AbortOptimization(BailoutReason::kFunctionTooBig); return AbortOptimization(BailoutReason::kFunctionTooBig);
} }
if (!FLAG_always_opt) { if (!FLAG_always_opt && !compilation_info()->native_context_independent()) {
compilation_info()->set_bailout_on_uninitialized(); compilation_info()->set_bailout_on_uninitialized();
} }
if (FLAG_turbo_loop_peeling) { if (FLAG_turbo_loop_peeling) {
compilation_info()->set_loop_peeling(); compilation_info()->set_loop_peeling();
} }
if (FLAG_turbo_inlining) { if (FLAG_turbo_inlining &&
!compilation_info()->native_context_independent()) {
compilation_info()->set_inlining(); compilation_info()->set_inlining();
} }
...@@ -1340,6 +1342,9 @@ struct GraphBuilderPhase { ...@@ -1340,6 +1342,9 @@ struct GraphBuilderPhase {
if (data->info()->bailout_on_uninitialized()) { if (data->info()->bailout_on_uninitialized()) {
flags |= BytecodeGraphBuilderFlag::kBailoutOnUninitialized; flags |= BytecodeGraphBuilderFlag::kBailoutOnUninitialized;
} }
if (data->info()->native_context_independent()) {
flags |= BytecodeGraphBuilderFlag::kNativeContextIndependent;
}
JSFunctionRef closure(data->broker(), data->info()->closure()); JSFunctionRef closure(data->broker(), data->info()->closure());
CallFrequency frequency(1.0f); CallFrequency frequency(1.0f);
...@@ -1397,8 +1402,10 @@ struct InliningPhase { ...@@ -1397,8 +1402,10 @@ struct InliningPhase {
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);
AddReducer(data, &graph_reducer, &native_context_specialization); if (!data->info()->native_context_independent()) {
AddReducer(data, &graph_reducer, &context_specialization); AddReducer(data, &graph_reducer, &native_context_specialization);
AddReducer(data, &graph_reducer, &context_specialization);
}
AddReducer(data, &graph_reducer, &intrinsic_lowering); AddReducer(data, &graph_reducer, &intrinsic_lowering);
AddReducer(data, &graph_reducer, &call_reducer); AddReducer(data, &graph_reducer, &call_reducer);
if (data->info()->inlining()) { if (data->info()->inlining()) {
...@@ -1538,7 +1545,9 @@ struct TypedLoweringPhase { ...@@ -1538,7 +1545,9 @@ struct TypedLoweringPhase {
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
AddReducer(data, &graph_reducer, &dead_code_elimination); AddReducer(data, &graph_reducer, &dead_code_elimination);
AddReducer(data, &graph_reducer, &create_lowering); if (!data->info()->native_context_independent()) {
AddReducer(data, &graph_reducer, &create_lowering);
}
AddReducer(data, &graph_reducer, &constant_folding_reducer); AddReducer(data, &graph_reducer, &constant_folding_reducer);
AddReducer(data, &graph_reducer, &typed_lowering); AddReducer(data, &graph_reducer, &typed_lowering);
AddReducer(data, &graph_reducer, &typed_optimization); AddReducer(data, &graph_reducer, &typed_optimization);
......
...@@ -244,6 +244,8 @@ HandleAndZoneScope::HandleAndZoneScope() ...@@ -244,6 +244,8 @@ HandleAndZoneScope::HandleAndZoneScope()
HandleAndZoneScope::~HandleAndZoneScope() = default; HandleAndZoneScope::~HandleAndZoneScope() = default;
static constexpr bool kNativeContextDependent = false;
i::Handle<i::JSFunction> Optimize( i::Handle<i::JSFunction> Optimize(
i::Handle<i::JSFunction> function, i::Zone* zone, i::Isolate* isolate, i::Handle<i::JSFunction> function, i::Zone* zone, i::Isolate* isolate,
uint32_t flags, std::unique_ptr<i::compiler::JSHeapBroker>* out_broker) { uint32_t flags, std::unique_ptr<i::compiler::JSHeapBroker>* out_broker) {
...@@ -255,7 +257,8 @@ i::Handle<i::JSFunction> Optimize( ...@@ -255,7 +257,8 @@ i::Handle<i::JSFunction> Optimize(
CHECK_NOT_NULL(zone); CHECK_NOT_NULL(zone);
i::OptimizedCompilationInfo info(zone, isolate, shared, function); i::OptimizedCompilationInfo info(zone, isolate, shared, function,
kNativeContextDependent);
if (flags & i::OptimizedCompilationInfo::kInlining) { if (flags & i::OptimizedCompilationInfo::kInlining) {
info.set_inlining(); info.set_inlining();
......
...@@ -145,12 +145,15 @@ Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) { ...@@ -145,12 +145,15 @@ Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) {
return Optimize(function, &zone, isolate, flags_); return Optimize(function, &zone, isolate, flags_);
} }
static constexpr bool kNativeContextDependent = false;
// Compile the given machine graph instead of the source of the function // Compile the given machine graph instead of the source of the function
// and replace the JSFunction's code with the result. // and replace the JSFunction's code with the result.
Handle<JSFunction> FunctionTester::CompileGraph(Graph* graph) { Handle<JSFunction> FunctionTester::CompileGraph(Graph* graph) {
Handle<SharedFunctionInfo> shared(function->shared(), isolate); Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME);
OptimizedCompilationInfo info(&zone, isolate, shared, function); OptimizedCompilationInfo info(&zone, isolate, shared, function,
kNativeContextDependent);
auto call_descriptor = Linkage::ComputeIncoming(&zone, &info); auto call_descriptor = Linkage::ComputeIncoming(&zone, &info);
Handle<Code> code = Handle<Code> code =
......
...@@ -38,7 +38,7 @@ class JSConstantCacheTester : public HandleAndZoneScope, ...@@ -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, false) { broker_(main_isolate(), main_zone()) {
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()));
......
...@@ -33,8 +33,7 @@ class ContextSpecializationTester : public HandleAndZoneScope { ...@@ -33,8 +33,7 @@ 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()),
false),
spec_(&reducer_, jsgraph(), &js_heap_broker_, context, spec_(&reducer_, jsgraph(), &js_heap_broker_, context,
MaybeHandle<JSFunction>()) {} MaybeHandle<JSFunction>()) {}
......
...@@ -27,7 +27,7 @@ class JSTypedLoweringTester : public HandleAndZoneScope { ...@@ -27,7 +27,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, false), js_heap_broker(isolate, main_zone()),
binop(nullptr), binop(nullptr),
unop(nullptr), unop(nullptr),
javascript(main_zone()), javascript(main_zone()),
......
...@@ -26,6 +26,8 @@ namespace compiler { ...@@ -26,6 +26,8 @@ namespace compiler {
static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite,
"dummy", 0, 0, 0, 0, 0, 0); "dummy", 0, 0, 0, 0, 0, 0);
static constexpr bool kNativeContextDependent = false;
// So we can get a real JS function. // So we can get a real JS function.
static Handle<JSFunction> Compile(const char* source) { static Handle<JSFunction> Compile(const char* source) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
...@@ -49,7 +51,7 @@ TEST(TestLinkageCreate) { ...@@ -49,7 +51,7 @@ TEST(TestLinkageCreate) {
Handle<JSFunction> function = Compile("a + b"); Handle<JSFunction> function = Compile("a + b");
Handle<SharedFunctionInfo> shared(function->shared(), handles.main_isolate()); Handle<SharedFunctionInfo> shared(function->shared(), handles.main_isolate());
OptimizedCompilationInfo info(handles.main_zone(), function->GetIsolate(), OptimizedCompilationInfo info(handles.main_zone(), function->GetIsolate(),
shared, function); shared, function, kNativeContextDependent);
auto call_descriptor = Linkage::ComputeIncoming(info.zone(), &info); auto call_descriptor = Linkage::ComputeIncoming(info.zone(), &info);
CHECK(call_descriptor); CHECK(call_descriptor);
} }
...@@ -67,7 +69,7 @@ TEST(TestLinkageJSFunctionIncoming) { ...@@ -67,7 +69,7 @@ TEST(TestLinkageJSFunctionIncoming) {
Handle<SharedFunctionInfo> shared(function->shared(), Handle<SharedFunctionInfo> shared(function->shared(),
handles.main_isolate()); handles.main_isolate());
OptimizedCompilationInfo info(handles.main_zone(), function->GetIsolate(), OptimizedCompilationInfo info(handles.main_zone(), function->GetIsolate(),
shared, function); shared, function, kNativeContextDependent);
auto call_descriptor = Linkage::ComputeIncoming(info.zone(), &info); auto call_descriptor = Linkage::ComputeIncoming(info.zone(), &info);
CHECK(call_descriptor); CHECK(call_descriptor);
...@@ -84,7 +86,7 @@ TEST(TestLinkageJSCall) { ...@@ -84,7 +86,7 @@ TEST(TestLinkageJSCall) {
Handle<JSFunction> function = Compile("a + c"); Handle<JSFunction> function = Compile("a + c");
Handle<SharedFunctionInfo> shared(function->shared(), handles.main_isolate()); Handle<SharedFunctionInfo> shared(function->shared(), handles.main_isolate());
OptimizedCompilationInfo info(handles.main_zone(), function->GetIsolate(), OptimizedCompilationInfo info(handles.main_zone(), function->GetIsolate(),
shared, function); shared, function, kNativeContextDependent);
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
auto call_descriptor = Linkage::GetJSCallDescriptor( auto call_descriptor = Linkage::GetJSCallDescriptor(
......
...@@ -27,7 +27,7 @@ class RepresentationChangerTester : public HandleAndZoneScope, ...@@ -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, false}, broker_{main_isolate(), main_zone()},
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);
......
...@@ -71,6 +71,8 @@ class BytecodeGraphCallable { ...@@ -71,6 +71,8 @@ class BytecodeGraphCallable {
Handle<JSFunction> function_; Handle<JSFunction> function_;
}; };
static constexpr bool kNativeContextDependent = false;
class BytecodeGraphTester { class BytecodeGraphTester {
public: public:
BytecodeGraphTester(Isolate* isolate, const char* script, BytecodeGraphTester(Isolate* isolate, const char* script,
...@@ -121,8 +123,8 @@ class BytecodeGraphTester { ...@@ -121,8 +123,8 @@ class BytecodeGraphTester {
Zone zone(isolate_->allocator(), ZONE_NAME); Zone zone(isolate_->allocator(), ZONE_NAME);
Handle<SharedFunctionInfo> shared(function->shared(), isolate_); Handle<SharedFunctionInfo> shared(function->shared(), isolate_);
OptimizedCompilationInfo compilation_info(&zone, isolate_, shared, OptimizedCompilationInfo compilation_info(&zone, isolate_, shared, function,
function); kNativeContextDependent);
// Compiler relies on canonicalized handles, let's create // Compiler relies on canonicalized handles, let's create
// a canonicalized scope and migrate existing handles there. // a canonicalized scope and migrate existing handles there.
......
...@@ -41,9 +41,7 @@ namespace compiler { ...@@ -41,9 +41,7 @@ namespace compiler {
class Types { 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), rng_(rng) {
js_heap_broker_(isolate, zone, FLAG_trace_heap_broker, false),
rng_(rng) {
#define DECLARE_TYPE(name, value) \ #define DECLARE_TYPE(name, value) \
name = Type::name(); \ name = Type::name(); \
types.push_back(name); types.push_back(name);
......
...@@ -24,6 +24,8 @@ using OptimizingCompileDispatcherTest = TestWithNativeContext; ...@@ -24,6 +24,8 @@ using OptimizingCompileDispatcherTest = TestWithNativeContext;
namespace { namespace {
static constexpr bool kNativeContextDependent = false;
class BlockingCompilationJob : public OptimizedCompilationJob { class BlockingCompilationJob : public OptimizedCompilationJob {
public: public:
BlockingCompilationJob(Isolate* isolate, Handle<JSFunction> function) BlockingCompilationJob(Isolate* isolate, Handle<JSFunction> function)
...@@ -31,7 +33,7 @@ class BlockingCompilationJob : public OptimizedCompilationJob { ...@@ -31,7 +33,7 @@ class BlockingCompilationJob : public OptimizedCompilationJob {
State::kReadyToExecute), State::kReadyToExecute),
shared_(function->shared(), isolate), shared_(function->shared(), isolate),
zone_(isolate->allocator(), ZONE_NAME), zone_(isolate->allocator(), ZONE_NAME),
info_(&zone_, isolate, shared_, function), info_(&zone_, isolate, shared_, function, kNativeContextDependent),
blocking_(false), blocking_(false),
semaphore_(0) {} semaphore_(0) {}
~BlockingCompilationJob() override = default; ~BlockingCompilationJob() override = default;
......
...@@ -29,7 +29,7 @@ class CommonOperatorReducerTest : public GraphTest { ...@@ -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, false); JSHeapBroker broker(isolate(), zone());
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,
......
...@@ -63,7 +63,7 @@ class ConstantFoldingReducerTest : public TypedGraphTest { ...@@ -63,7 +63,7 @@ class ConstantFoldingReducerTest : public TypedGraphTest {
public: public:
ConstantFoldingReducerTest() ConstantFoldingReducerTest()
: TypedGraphTest(3), : TypedGraphTest(3),
broker_(isolate(), zone(), FLAG_trace_heap_broker, false), broker_(isolate(), zone()),
simplified_(zone()), simplified_(zone()),
deps_(&broker_, zone()) {} deps_(&broker_, zone()) {}
~ConstantFoldingReducerTest() override = default; ~ConstantFoldingReducerTest() override = default;
......
...@@ -18,7 +18,7 @@ GraphTest::GraphTest(int num_parameters) ...@@ -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, false), broker_(isolate(), zone()),
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)));
......
...@@ -30,7 +30,7 @@ class SimplifiedOperatorReducerTest : public GraphTest { ...@@ -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, false); JSHeapBroker broker(isolate(), zone());
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(),
......
...@@ -22,7 +22,7 @@ class TyperTest : public TypedGraphTest { ...@@ -22,7 +22,7 @@ class TyperTest : public TypedGraphTest {
public: public:
TyperTest() TyperTest()
: TypedGraphTest(3), : TypedGraphTest(3),
broker_(isolate(), zone(), FLAG_trace_heap_broker, false), broker_(isolate(), zone()),
operation_typer_(&broker_, zone()), operation_typer_(&broker_, zone()),
types_(zone(), isolate(), random_number_generator()), types_(zone(), isolate(), random_number_generator()),
javascript_(zone()), javascript_(zone()),
......
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