Commit 5fdea8fd authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[GetIsolate] Remove GetIsolate from src/compiler

Bug: v8:7786
Change-Id: I1e568ff6da02dfd92b24b8badd665096cf49a13a
Reviewed-on: https://chromium-review.googlesource.com/1101321Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53747}
parent 14e0f3cc
......@@ -711,7 +711,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
// tolerate the lack of a script without bytecode.
DCHECK_IMPLIES(!has_script, shared->HasBytecodeArray());
std::unique_ptr<OptimizedCompilationJob> job(
compiler::Pipeline::NewCompilationJob(function, has_script));
compiler::Pipeline::NewCompilationJob(isolate, function, has_script));
OptimizedCompilationInfo* compilation_info = job->compilation_info();
compilation_info->SetOptimizingForOsr(osr_offset, osr_frame);
......
......@@ -90,6 +90,7 @@ class AllocationBuilder final {
protected:
JSGraph* jsgraph() { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
Graph* graph() { return jsgraph_->graph(); }
CommonOperatorBuilder* common() { return jsgraph_->common(); }
SimplifiedOperatorBuilder* simplified() { return jsgraph_->simplified(); }
......
......@@ -247,13 +247,15 @@ bool BranchElimination::ControlPathConditions::LookupCondition(
}
}
return false;
}
}
Graph* BranchElimination::graph() const { return jsgraph()->graph(); }
Graph* BranchElimination::graph() const { return jsgraph()->graph(); }
CommonOperatorBuilder* BranchElimination::common() const {
return jsgraph()->common();
}
Isolate* BranchElimination::isolate() const { return jsgraph()->isolate(); }
CommonOperatorBuilder* BranchElimination::common() const {
return jsgraph()->common();
}
} // namespace compiler
} // namespace internal
......
......@@ -72,6 +72,7 @@ class V8_EXPORT_PRIVATE BranchElimination final
Node* dead() const { return dead_; }
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const;
CommonOperatorBuilder* common() const;
JSGraph* const jsgraph_;
......
......@@ -521,7 +521,8 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
: local_zone_(local_zone),
jsgraph_(jsgraph),
invocation_frequency_(invocation_frequency),
bytecode_array_(handle(shared_info->GetBytecodeArray())),
bytecode_array_(
handle(shared_info->GetBytecodeArray(), jsgraph->isolate())),
feedback_vector_(feedback_vector),
type_hint_lowering_(jsgraph, feedback_vector, flags),
frame_state_function_info_(common()->CreateFrameStateFunctionInfo(
......@@ -878,7 +879,7 @@ void BytecodeGraphBuilder::VisitBytecodes() {
interpreter::BytecodeArrayIterator iterator(bytecode_array());
set_bytecode_iterator(&iterator);
SourcePositionTableIterator source_position_iterator(
handle(bytecode_array()->SourcePositionTable()));
handle(bytecode_array()->SourcePositionTable(), isolate()));
if (analyze_environment_liveness() && FLAG_trace_environment_liveness) {
StdoutStream of;
......@@ -1471,7 +1472,8 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
: NOT_TENURED;
const Operator* op = javascript()->CreateClosure(
shared_info, nexus.GetFeedbackCell(),
handle(jsgraph()->isolate()->builtins()->builtin(Builtins::kCompileLazy)),
handle(jsgraph()->isolate()->builtins()->builtin(Builtins::kCompileLazy),
isolate()),
tenured);
Node* closure = NewNode(op);
environment()->BindAccumulator(closure);
......@@ -1625,8 +1627,8 @@ void BytecodeGraphBuilder::VisitGetTemplateObject() {
cached_value = TemplateObjectDescription::CreateTemplateObject(description);
nexus.vector()->Set(slot, *cached_value);
} else {
cached_value =
handle(JSArray::cast(nexus.GetFeedback()->ToStrongHeapObject()));
cached_value = handle(
JSArray::cast(nexus.GetFeedback()->ToStrongHeapObject()), isolate());
}
Node* template_object = jsgraph()->HeapConstant(cached_value);
......
......@@ -302,6 +302,7 @@ class BytecodeGraphBuilder {
CommonOperatorBuilder* common() const { return jsgraph_->common(); }
Zone* graph_zone() const { return graph()->zone(); }
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
JSOperatorBuilder* javascript() const { return jsgraph_->javascript(); }
SimplifiedOperatorBuilder* simplified() const {
return jsgraph_->simplified();
......
......@@ -100,6 +100,7 @@ class V8_EXPORT_PRIVATE EscapeAnalysisReducer final
Reduction ReplaceNode(Node* original, Node* replacement);
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
EscapeAnalysisResult analysis_result() const { return analysis_result_; }
Zone* zone() const { return zone_; }
......
......@@ -180,6 +180,7 @@ class V8_EXPORT_PRIVATE EscapeAnalysis final
private:
void Reduce(Node* node, Reduction* reduction);
JSGraph* jsgraph() { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
EscapeAnalysisTracker* tracker_;
JSGraph* jsgraph_;
};
......
......@@ -258,6 +258,7 @@ class GraphAssembler {
Operator const* ToNumberOperator();
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
Graph* graph() const { return jsgraph_->graph(); }
Zone* temp_zone() const { return temp_zone_; }
CommonOperatorBuilder* common() const { return jsgraph()->common(); }
......
This diff is collapsed.
......@@ -1147,7 +1147,7 @@ Reduction JSCreateLowering::ReduceJSCreateKeyValueArray(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* array_map = jsgraph()->HeapConstant(
handle(native_context()->js_array_fast_elements_map_index()));
handle(native_context()->js_array_fast_elements_map_index(), isolate()));
Node* properties = jsgraph()->EmptyFixedArrayConstant();
Node* length = jsgraph()->Constant(2);
......
......@@ -113,7 +113,7 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
Handle<SharedFunctionInfo> shared =
candidate.functions[i].is_null()
? candidate.shared_info
: handle(candidate.functions[i]->shared());
: handle(candidate.functions[i]->shared(), isolate());
candidate.can_inline_function[i] = CanInlineFunction(shared);
// Do not allow direct recursion i.e. f() -> f(). We still allow indirect
// recurion like f() -> g() -> f(). The indirect recursion is helpful in
......@@ -607,7 +607,7 @@ Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate,
Handle<SharedFunctionInfo> shared =
candidate.functions[0].is_null()
? candidate.shared_info
: handle(candidate.functions[0]->shared());
: handle(candidate.functions[0]->shared(), isolate());
Reduction const reduction = inliner_.ReduceJSCall(node);
if (reduction.Changed()) {
cumulative_count_ += shared->GetBytecodeArray()->length();
......@@ -719,7 +719,7 @@ void JSInliningHeuristic::PrintCandidates() {
Handle<SharedFunctionInfo> shared =
candidate.functions[i].is_null()
? candidate.shared_info
: handle(candidate.functions[i]->shared());
: handle(candidate.functions[i]->shared(), isolate());
PrintF(" - size:%d, name: %s\n", shared->GetBytecodeArray()->length(),
shared->DebugName()->ToCString().get());
}
......
......@@ -80,6 +80,7 @@ class JSInliningHeuristic final : public AdvancedReducer {
CommonOperatorBuilder* common() const;
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
SimplifiedOperatorBuilder* simplified() const;
Mode const mode_;
......
......@@ -298,7 +298,7 @@ bool JSInliner::DetermineCallTarget(
return false;
}
shared_info_out = handle(function->shared());
shared_info_out = handle(function->shared(), isolate());
return true;
}
......@@ -343,8 +343,8 @@ void JSInliner::DetermineCallContext(
JSFunction::EnsureFeedbackVector(function);
// The inlinee specializes to the context from the JSFunction object.
context_out = jsgraph()->Constant(handle(function->context()));
feedback_vector_out = handle(function->feedback_vector());
context_out = jsgraph()->Constant(handle(function->context(), isolate()));
feedback_vector_out = handle(function->feedback_vector(), isolate());
return;
}
......@@ -358,7 +358,8 @@ void JSInliner::DetermineCallContext(
// The inlinee uses the locally provided context at instantiation.
context_out = NodeProperties::GetContextInput(match.node());
feedback_vector_out = handle(FeedbackVector::cast(cell->value()));
feedback_vector_out =
handle(FeedbackVector::cast(cell->value()), isolate());
return;
}
......@@ -372,7 +373,7 @@ Reduction JSInliner::Reduce(Node* node) {
}
Handle<Context> JSInliner::native_context() const {
return handle(info_->context()->native_context());
return handle(info_->context()->native_context(), isolate());
}
Reduction JSInliner::ReduceJSCall(Node* node) {
......@@ -604,10 +605,10 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
if (node->opcode() == IrOpcode::kJSCall &&
is_sloppy(shared_info->language_mode()) && !shared_info->native()) {
Node* effect = NodeProperties::GetEffectInput(node);
if (NodeProperties::CanBePrimitive(call.receiver(), effect)) {
if (NodeProperties::CanBePrimitive(isolate(), call.receiver(), effect)) {
CallParameters const& p = CallParametersOf(node->op());
Node* global_proxy = jsgraph()->HeapConstant(
handle(info_->native_context()->global_proxy()));
handle(info_->native_context()->global_proxy(), isolate()));
Node* receiver = effect =
graph()->NewNode(simplified()->ConvertReceiver(p.convert_mode()),
call.receiver(), global_proxy, effect, start);
......
......@@ -47,6 +47,7 @@ class JSInliner final : public AdvancedReducer {
SimplifiedOperatorBuilder* simplified() const;
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const { return jsgraph_->isolate(); }
Handle<Context> native_context() const;
Zone* const local_zone_;
......
......@@ -302,7 +302,8 @@ JSNativeContextSpecialization::InferHasInPrototypeChain(
Node* receiver, Node* effect, Handle<HeapObject> prototype) {
ZoneHandleSet<Map> receiver_maps;
NodeProperties::InferReceiverMapsResult result =
NodeProperties::InferReceiverMaps(receiver, effect, &receiver_maps);
NodeProperties::InferReceiverMaps(isolate(), receiver, effect,
&receiver_maps);
if (result == NodeProperties::kNoReceiverMaps) return kMayBeInPrototypeChain;
// Check if either all or none of the {receiver_maps} have the given
......@@ -437,12 +438,13 @@ Reduction JSNativeContextSpecialization::ReduceJSPromiseResolve(Node* node) {
// Check if the {constructor} is the %Promise% function.
HeapObjectMatcher m(constructor);
if (!m.Is(handle(native_context()->promise_function()))) return NoChange();
if (!m.Is(handle(native_context()->promise_function(), isolate())))
return NoChange();
// Check if we know something about the {value}.
ZoneHandleSet<Map> value_maps;
NodeProperties::InferReceiverMapsResult result =
NodeProperties::InferReceiverMaps(value, effect, &value_maps);
NodeProperties::InferReceiverMaps(isolate(), value, effect, &value_maps);
if (result == NodeProperties::kNoReceiverMaps) return NoChange();
DCHECK_NE(0, value_maps.size());
......@@ -472,7 +474,8 @@ Reduction JSNativeContextSpecialization::ReduceJSResolvePromise(Node* node) {
// Check if we know something about the {resolution}.
ZoneHandleSet<Map> resolution_maps;
NodeProperties::InferReceiverMapsResult result =
NodeProperties::InferReceiverMaps(resolution, effect, &resolution_maps);
NodeProperties::InferReceiverMaps(isolate(), resolution, effect,
&resolution_maps);
if (result != NodeProperties::kReliableReceiverMaps) return NoChange();
DCHECK_NE(0, resolution_maps.size());
......@@ -2837,7 +2840,7 @@ bool JSNativeContextSpecialization::InferReceiverMaps(
Node* receiver, Node* effect, MapHandles* receiver_maps) {
ZoneHandleSet<Map> maps;
NodeProperties::InferReceiverMapsResult result =
NodeProperties::InferReceiverMaps(receiver, effect, &maps);
NodeProperties::InferReceiverMaps(isolate(), receiver, effect, &maps);
if (result == NodeProperties::kReliableReceiverMaps) {
for (size_t i = 0; i < maps.size(); ++i) {
receiver_maps->push_back(maps[i]);
......
......@@ -189,6 +189,7 @@ class JSSpeculativeBinopBuilder final {
}
JSGraph* jsgraph() const { return lowering_->jsgraph(); }
Isolate* isolate() const { return jsgraph()->isolate(); }
Graph* graph() const { return jsgraph()->graph(); }
JSOperatorBuilder* javascript() { return jsgraph()->javascript(); }
SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); }
......@@ -212,6 +213,8 @@ JSTypeHintLowering::JSTypeHintLowering(JSGraph* jsgraph,
Flags flags)
: jsgraph_(jsgraph), flags_(flags), feedback_vector_(feedback_vector) {}
Isolate* JSTypeHintLowering::isolate() const { return jsgraph()->isolate(); }
JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceUnaryOperation(
const Operator* op, Node* operand, Node* effect, Node* control,
FeedbackSlot slot) const {
......
......@@ -157,6 +157,7 @@ class JSTypeHintLowering {
DeoptimizeReason reson) const;
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() const;
Flags flags() const { return flags_; }
const Handle<FeedbackVector>& feedback_vector() const {
return feedback_vector_;
......
......@@ -360,6 +360,7 @@ class JSBinopReduction final {
SimplifiedOperatorBuilder* simplified() { return lowering_->simplified(); }
Graph* graph() const { return lowering_->graph(); }
JSGraph* jsgraph() { return lowering_->jsgraph(); }
Isolate* isolate() { return jsgraph()->isolate(); }
JSOperatorBuilder* javascript() { return lowering_->javascript(); }
CommonOperatorBuilder* common() { return jsgraph()->common(); }
Zone* zone() const { return graph()->zone(); }
......@@ -1673,7 +1674,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
if (is_sloppy(shared->language_mode()) && !shared->native() &&
!receiver_type.Is(Type::Receiver())) {
Node* global_proxy =
jsgraph()->HeapConstant(handle(function->global_proxy()));
jsgraph()->HeapConstant(handle(function->global_proxy(), isolate()));
receiver = effect =
graph()->NewNode(simplified()->ConvertReceiver(convert_mode),
receiver, global_proxy, effect, control);
......
......@@ -1369,6 +1369,8 @@ CommonOperatorBuilder* LoadElimination::common() const {
Graph* LoadElimination::graph() const { return jsgraph()->graph(); }
Isolate* LoadElimination::isolate() const { return jsgraph()->isolate(); }
Factory* LoadElimination::factory() const { return jsgraph()->factory(); }
} // namespace compiler
......
......@@ -302,6 +302,7 @@ class V8_EXPORT_PRIVATE LoadElimination final
CommonOperatorBuilder* common() const;
AbstractState const* empty_state() const { return &empty_state_; }
Isolate* isolate() const;
Factory* factory() const;
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
......
......@@ -363,11 +363,11 @@ bool NodeProperties::IsSame(Node* a, Node* b) {
// static
NodeProperties::InferReceiverMapsResult NodeProperties::InferReceiverMaps(
Node* receiver, Node* effect, ZoneHandleSet<Map>* maps_return) {
Isolate* isolate, Node* receiver, Node* effect,
ZoneHandleSet<Map>* maps_return) {
HeapObjectMatcher m(receiver);
if (m.HasValue()) {
Handle<HeapObject> receiver = m.Value();
Isolate* const isolate = m.Value()->GetIsolate();
// We don't use ICs for the Array.prototype and the Object.prototype
// because the runtime has to be able to intercept them properly, so
// we better make sure that TurboFan doesn't outsmart the system here
......@@ -503,12 +503,12 @@ NodeProperties::InferReceiverMapsResult NodeProperties::InferReceiverMaps(
}
// static
MaybeHandle<Map> NodeProperties::GetMapWitness(Node* node) {
MaybeHandle<Map> NodeProperties::GetMapWitness(Isolate* isolate, Node* node) {
ZoneHandleSet<Map> maps;
Node* receiver = NodeProperties::GetValueInput(node, 1);
Node* effect = NodeProperties::GetEffectInput(node);
NodeProperties::InferReceiverMapsResult result =
NodeProperties::InferReceiverMaps(receiver, effect, &maps);
NodeProperties::InferReceiverMaps(isolate, receiver, effect, &maps);
if (result == NodeProperties::kReliableReceiverMaps && maps.size() == 1) {
return maps[0];
}
......@@ -516,11 +516,13 @@ MaybeHandle<Map> NodeProperties::GetMapWitness(Node* node) {
}
// static
bool NodeProperties::HasInstanceTypeWitness(Node* receiver, Node* effect,
bool NodeProperties::HasInstanceTypeWitness(Isolate* isolate, Node* receiver,
Node* effect,
InstanceType instance_type) {
ZoneHandleSet<Map> receiver_maps;
NodeProperties::InferReceiverMapsResult result =
NodeProperties::InferReceiverMaps(receiver, effect, &receiver_maps);
NodeProperties::InferReceiverMaps(isolate, receiver, effect,
&receiver_maps);
switch (result) {
case NodeProperties::kUnreliableReceiverMaps:
case NodeProperties::kReliableReceiverMaps:
......@@ -551,7 +553,8 @@ bool NodeProperties::NoObservableSideEffectBetween(Node* effect,
}
// static
bool NodeProperties::CanBePrimitive(Node* receiver, Node* effect) {
bool NodeProperties::CanBePrimitive(Isolate* isolate, Node* receiver,
Node* effect) {
switch (receiver->opcode()) {
#define CASE(Opcode) case IrOpcode::k##Opcode:
JS_CONSTRUCT_OP_LIST(CASE)
......@@ -571,7 +574,8 @@ bool NodeProperties::CanBePrimitive(Node* receiver, Node* effect) {
// just the instance types, which don't change
// across potential side-effecting operations.
ZoneHandleSet<Map> maps;
if (InferReceiverMaps(receiver, effect, &maps) != kNoReceiverMaps) {
if (InferReceiverMaps(isolate, receiver, effect, &maps) !=
kNoReceiverMaps) {
// Check if all {maps} are actually JSReceiver maps.
for (size_t i = 0; i < maps.size(); ++i) {
if (!maps[i]->IsJSReceiverMap()) return true;
......@@ -584,8 +588,9 @@ bool NodeProperties::CanBePrimitive(Node* receiver, Node* effect) {
}
// static
bool NodeProperties::CanBeNullOrUndefined(Node* receiver, Node* effect) {
if (CanBePrimitive(receiver, effect)) {
bool NodeProperties::CanBeNullOrUndefined(Isolate* isolate, Node* receiver,
Node* effect) {
if (CanBePrimitive(isolate, receiver, effect)) {
switch (receiver->opcode()) {
case IrOpcode::kCheckInternalizedString:
case IrOpcode::kCheckNumber:
......@@ -602,7 +607,6 @@ bool NodeProperties::CanBeNullOrUndefined(Node* receiver, Node* effect) {
return false;
case IrOpcode::kHeapConstant: {
Handle<HeapObject> value = HeapObjectMatcher(receiver).Value();
Isolate* const isolate = value->GetIsolate();
return value->IsNullOrUndefined(isolate);
}
default:
......
......@@ -152,11 +152,12 @@ class V8_EXPORT_PRIVATE NodeProperties final {
// but instance type is reliable.
};
static InferReceiverMapsResult InferReceiverMaps(
Node* receiver, Node* effect, ZoneHandleSet<Map>* maps_return);
Isolate* isolate, Node* receiver, Node* effect,
ZoneHandleSet<Map>* maps_return);
static MaybeHandle<Map> GetMapWitness(Node* node);
static bool HasInstanceTypeWitness(Node* receiver, Node* effect,
InstanceType instance_type);
static MaybeHandle<Map> GetMapWitness(Isolate* isolate, Node* node);
static bool HasInstanceTypeWitness(Isolate* isolate, Node* receiver,
Node* effect, InstanceType instance_type);
// Walks up the {effect} chain to check that there's no observable side-effect
// between the {effect} and it's {dominator}. Aborts the walk if there's join
......@@ -166,11 +167,12 @@ class V8_EXPORT_PRIVATE NodeProperties final {
// Returns true if the {receiver} can be a primitive value (i.e. is not
// definitely a JavaScript object); might walk up the {effect} chain to
// find map checks on {receiver}.
static bool CanBePrimitive(Node* receiver, Node* effect);
static bool CanBePrimitive(Isolate* isolate, Node* receiver, Node* effect);
// Returns true if the {receiver} can be null or undefined. Might walk
// up the {effect} chain to find map checks for {receiver}.
static bool CanBeNullOrUndefined(Node* receiver, Node* effect);
static bool CanBeNullOrUndefined(Isolate* isolate, Node* receiver,
Node* effect);
// ---------------------------------------------------------------------------
// Context.
......
......@@ -568,8 +568,8 @@ void PrintParticipatingSource(OptimizedCompilationInfo* info,
}
// Print the code after compiling it.
void PrintCode(Handle<Code> code, OptimizedCompilationInfo* info) {
Isolate* isolate = code->GetIsolate();
void PrintCode(Isolate* isolate, Handle<Code> code,
OptimizedCompilationInfo* info) {
if (FLAG_print_opt_source && info->IsOptimizing()) {
PrintParticipatingSource(info, isolate);
}
......@@ -800,7 +800,8 @@ PipelineStatistics* CreatePipelineStatistics(wasm::FunctionBody function_body,
class PipelineCompilationJob final : public OptimizedCompilationJob {
public:
PipelineCompilationJob(Handle<SharedFunctionInfo> shared_info,
PipelineCompilationJob(Isolate* isolate,
Handle<SharedFunctionInfo> shared_info,
Handle<JSFunction> function)
// Note that the OptimizedCompilationInfo is not initialized at the time
// we pass it to the CompilationJob constructor, but it is not
......@@ -813,8 +814,8 @@ class PipelineCompilationJob final : public OptimizedCompilationJob {
compilation_info_(&zone_, function->GetIsolate(), shared_info,
function),
pipeline_statistics_(CreatePipelineStatistics(
handle(Script::cast(shared_info->script())), compilation_info(),
function->GetIsolate(), &zone_stats_)),
handle(Script::cast(shared_info->script()), isolate),
compilation_info(), function->GetIsolate(), &zone_stats_)),
data_(&zone_stats_, function->GetIsolate(), compilation_info(),
pipeline_statistics_.get()),
pipeline_(&data_),
......@@ -1106,7 +1107,7 @@ struct GraphBuilderPhase {
}
BytecodeGraphBuilder graph_builder(
temp_zone, data->info()->shared_info(),
handle(data->info()->closure()->feedback_vector()),
handle(data->info()->closure()->feedback_vector(), data->isolate()),
data->info()->osr_offset(), data->jsgraph(), CallFrequency(1.0f),
data->source_positions(), data->native_context(),
SourcePosition::kNotInlined, flags, true,
......@@ -1132,10 +1133,10 @@ Maybe<OuterContext> GetModuleContext(Handle<JSFunction> closure) {
}
Maybe<OuterContext> ChooseSpecializationContext(
OptimizedCompilationInfo* info) {
Isolate* isolate, OptimizedCompilationInfo* info) {
if (info->is_function_context_specializing()) {
DCHECK(info->has_context());
return Just(OuterContext(handle(info->context()), 0));
return Just(OuterContext(handle(info->context(), isolate), 0));
}
return GetModuleContext(info->closure());
}
......@@ -1146,14 +1147,15 @@ struct InliningPhase {
static const char* phase_name() { return "inlining"; }
void Run(PipelineData* data, Zone* temp_zone) {
Isolate* isolate = data->isolate();
GraphReducer graph_reducer(temp_zone, data->graph(),
data->jsgraph()->Dead());
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
data->common(), temp_zone);
CheckpointElimination checkpoint_elimination(&graph_reducer);
CommonOperatorReducer common_reducer(data->isolate(), &graph_reducer,
data->graph(), data->common(),
data->machine(), temp_zone);
CommonOperatorReducer common_reducer(isolate, &graph_reducer, data->graph(),
data->common(), data->machine(),
temp_zone);
JSCallReducer call_reducer(
&graph_reducer, data->jsgraph(), data->js_heap_broker(),
data->info()->is_bailout_on_uninitialized()
......@@ -1162,7 +1164,7 @@ struct InliningPhase {
data->native_context(), data->info()->dependencies());
JSContextSpecialization context_specialization(
&graph_reducer, data->jsgraph(),
ChooseSpecializationContext(data->info()),
ChooseSpecializationContext(isolate, data->info()),
data->info()->is_function_context_specializing()
? data->info()->closure()
: MaybeHandle<JSFunction>());
......@@ -2199,9 +2201,10 @@ Handle<Code> Pipeline::GenerateCodeForTesting(
// static
OptimizedCompilationJob* Pipeline::NewCompilationJob(
Handle<JSFunction> function, bool has_script) {
Handle<SharedFunctionInfo> shared = handle(function->shared());
return new PipelineCompilationJob(shared, function);
Isolate* isolate, Handle<JSFunction> function, bool has_script) {
Handle<SharedFunctionInfo> shared =
handle(function->shared(), function->GetIsolate());
return new PipelineCompilationJob(isolate, shared, function);
}
// static
......@@ -2423,7 +2426,7 @@ Handle<Code> PipelineImpl::FinalizeCode() {
}
info()->SetCode(code);
PrintCode(code, info());
PrintCode(isolate(), code, info());
if (info()->trace_turbo_json_enabled()) {
TurboJsonFile json_of(info(), std::ios_base::app);
......
......@@ -41,7 +41,8 @@ class WasmCompilationData;
class Pipeline : public AllStatic {
public:
// Returns a new compilation job for the given function.
static OptimizedCompilationJob* NewCompilationJob(Handle<JSFunction> function,
static OptimizedCompilationJob* NewCompilationJob(Isolate* isolate,
Handle<JSFunction> function,
bool has_script);
// Returns a new compilation job for the WebAssembly compilation info.
......
......@@ -147,6 +147,7 @@ class RedundantStoreFinder final {
bool HasBeenVisited(Node* node);
JSGraph* jsgraph() const { return jsgraph_; }
Isolate* isolate() { return jsgraph()->isolate(); }
Zone* temp_zone() const { return temp_zone_; }
ZoneVector<UnobservablesSet>& unobservable() { return unobservable_; }
UnobservablesSet& unobservable_for_id(NodeId id) {
......
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