Commit 0389c613 authored by Jakob Linke's avatar Jakob Linke Committed by V8 LUCI CQ

[compiler] Remove unused osr_frame member

.. in OptimizedCompilationInfo.

Bug: v8:7700
Change-Id: I1dcff9c798ae3e70ae5dd84d815f45f7303e39e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3845083Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82644}
parent 3cc93154
......@@ -1114,7 +1114,6 @@ MaybeHandle<CodeT> CompileTurbofan(Isolate* isolate,
Handle<SharedFunctionInfo> shared,
ConcurrencyMode mode,
BytecodeOffset osr_offset,
JavaScriptFrame* osr_frame,
CompileResultBehavior result_behavior) {
VMState<COMPILER> state(isolate);
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
......@@ -1128,9 +1127,8 @@ MaybeHandle<CodeT> CompileTurbofan(Isolate* isolate,
// tolerate the lack of a script without bytecode.
DCHECK_IMPLIES(!has_script, shared->HasBytecodeArray());
std::unique_ptr<TurbofanCompilationJob> job(
compiler::Pipeline::NewCompilationJob(isolate, function,
CodeKind::TURBOFAN, has_script,
osr_offset, osr_frame));
compiler::Pipeline::NewCompilationJob(
isolate, function, CodeKind::TURBOFAN, has_script, osr_offset));
if (result_behavior == CompileResultBehavior::kDiscardForTesting) {
job->compilation_info()->set_discard_result_for_testing();
......@@ -1175,13 +1173,11 @@ void RecordMaglevFunctionCompilation(Isolate* isolate,
MaybeHandle<CodeT> CompileMaglev(Isolate* isolate, Handle<JSFunction> function,
ConcurrencyMode mode,
BytecodeOffset osr_offset,
JavaScriptFrame* osr_frame,
CompileResultBehavior result_behavior) {
#ifdef V8_ENABLE_MAGLEV
DCHECK(FLAG_maglev);
// TODO(v8:7700): Add missing support.
CHECK(!IsOSR(osr_offset));
CHECK(osr_frame == nullptr);
CHECK(result_behavior == CompileResultBehavior::kDefault);
// TODO(v8:7700): Tracing, see CompileTurbofan.
......@@ -1241,7 +1237,6 @@ MaybeHandle<CodeT> CompileMaglev(Isolate* isolate, Handle<JSFunction> function,
MaybeHandle<CodeT> GetOrCompileOptimized(
Isolate* isolate, Handle<JSFunction> function, ConcurrencyMode mode,
CodeKind code_kind, BytecodeOffset osr_offset = BytecodeOffset::None(),
JavaScriptFrame* osr_frame = nullptr,
CompileResultBehavior result_behavior = CompileResultBehavior::kDefault) {
DCHECK(CodeKindIsOptimizedJSFunction(code_kind));
......@@ -1287,11 +1282,10 @@ MaybeHandle<CodeT> GetOrCompileOptimized(
if (code_kind == CodeKind::TURBOFAN) {
return CompileTurbofan(isolate, function, shared, mode, osr_offset,
osr_frame, result_behavior);
result_behavior);
} else {
DCHECK_EQ(code_kind, CodeKind::MAGLEV);
return CompileMaglev(isolate, function, mode, osr_offset, osr_frame,
result_behavior);
return CompileMaglev(isolate, function, mode, osr_offset, result_behavior);
}
}
......@@ -1314,7 +1308,7 @@ void SpawnDuplicateConcurrentJobForStressTesting(Isolate* isolate,
? CompileResultBehavior::kDefault
: CompileResultBehavior::kDiscardForTesting;
USE(GetOrCompileOptimized(isolate, function, ConcurrencyMode::kConcurrent,
code_kind, BytecodeOffset::None(), nullptr,
code_kind, BytecodeOffset::None(),
result_behavior));
}
......@@ -3873,10 +3867,8 @@ template Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
MaybeHandle<CodeT> Compiler::CompileOptimizedOSR(Isolate* isolate,
Handle<JSFunction> function,
BytecodeOffset osr_offset,
UnoptimizedFrame* frame,
ConcurrencyMode mode) {
DCHECK(IsOSR(osr_offset));
DCHECK_NOT_NULL(frame);
if (V8_UNLIKELY(isolate->serializer_enabled())) return {};
if (V8_UNLIKELY(function->shared().optimization_disabled())) return {};
......@@ -3899,7 +3891,7 @@ MaybeHandle<CodeT> Compiler::CompileOptimizedOSR(Isolate* isolate,
CompilerTracer::TraceOptimizeOSRStarted(isolate, function, osr_offset, mode);
MaybeHandle<CodeT> result = GetOrCompileOptimized(
isolate, function, mode, CodeKind::TURBOFAN, osr_offset, frame);
isolate, function, mode, CodeKind::TURBOFAN, osr_offset);
if (result.is_null()) {
CompilerTracer::TraceOptimizeOSRUnavailable(isolate, function, osr_offset,
......
......@@ -101,7 +101,7 @@ class V8_EXPORT_PRIVATE Compiler : public AllStatic {
// a future OSR request will pick up the resulting code object).
V8_WARN_UNUSED_RESULT static MaybeHandle<CodeT> CompileOptimizedOSR(
Isolate* isolate, Handle<JSFunction> function, BytecodeOffset osr_offset,
UnoptimizedFrame* frame, ConcurrencyMode mode);
ConcurrencyMode mode);
V8_WARN_UNUSED_RESULT static MaybeHandle<SharedFunctionInfo>
CompileForLiveEdit(ParseInfo* parse_info, Handle<Script> script,
......
......@@ -23,11 +23,9 @@ namespace internal {
OptimizedCompilationInfo::OptimizedCompilationInfo(
Zone* zone, Isolate* isolate, Handle<SharedFunctionInfo> shared,
Handle<JSFunction> closure, CodeKind code_kind, BytecodeOffset osr_offset,
JavaScriptFrame* osr_frame)
Handle<JSFunction> closure, CodeKind code_kind, BytecodeOffset osr_offset)
: code_kind_(code_kind),
osr_offset_(osr_offset),
osr_frame_(osr_frame),
zone_(zone),
optimization_id_(isolate->NextOptimizationId()) {
DCHECK_EQ(*shared, closure->shared());
......
......@@ -95,14 +95,13 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
OptimizedCompilationInfo(Zone* zone, Isolate* isolate,
Handle<SharedFunctionInfo> shared,
Handle<JSFunction> closure, CodeKind code_kind,
BytecodeOffset osr_offset,
JavaScriptFrame* osr_frame);
BytecodeOffset osr_offset);
// For testing.
OptimizedCompilationInfo(Zone* zone, Isolate* isolate,
Handle<SharedFunctionInfo> shared,
Handle<JSFunction> closure, CodeKind code_kind)
: OptimizedCompilationInfo(zone, isolate, shared, closure, code_kind,
BytecodeOffset::None(), nullptr) {}
BytecodeOffset::None()) {}
// Construct a compilation info for stub compilation, Wasm, and testing.
OptimizedCompilationInfo(base::Vector<const char> debug_name, Zone* zone,
CodeKind code_kind);
......@@ -124,7 +123,6 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
Builtin builtin() const { return builtin_; }
void set_builtin(Builtin builtin) { builtin_ = builtin; }
BytecodeOffset osr_offset() const { return osr_offset_; }
JavaScriptFrame* osr_frame() const { return osr_frame_; }
void SetNodeObserver(compiler::NodeObserver* observer) {
DCHECK_NULL(node_observer_);
node_observer_ = observer;
......@@ -274,8 +272,6 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
// Entry point when compiling for OSR, {BytecodeOffset::None} otherwise.
const BytecodeOffset osr_offset_ = BytecodeOffset::None();
// The current OSR frame for specialization or {nullptr}.
JavaScriptFrame* const osr_frame_ = nullptr;
// The zone from which the compilation pipeline working on this
// OptimizedCompilationInfo allocates.
......
......@@ -1105,7 +1105,7 @@ class PipelineCompilationJob final : public TurbofanCompilationJob {
PipelineCompilationJob(Isolate* isolate,
Handle<SharedFunctionInfo> shared_info,
Handle<JSFunction> function, BytecodeOffset osr_offset,
JavaScriptFrame* osr_frame, CodeKind code_kind);
CodeKind code_kind);
~PipelineCompilationJob() final;
PipelineCompilationJob(const PipelineCompilationJob&) = delete;
PipelineCompilationJob& operator=(const PipelineCompilationJob&) = delete;
......@@ -1133,8 +1133,7 @@ class PipelineCompilationJob final : public TurbofanCompilationJob {
PipelineCompilationJob::PipelineCompilationJob(
Isolate* isolate, Handle<SharedFunctionInfo> shared_info,
Handle<JSFunction> function, BytecodeOffset osr_offset,
JavaScriptFrame* osr_frame, CodeKind code_kind)
Handle<JSFunction> function, BytecodeOffset osr_offset, CodeKind code_kind)
// Note that the OptimizedCompilationInfo is not initialized at the time
// we pass it to the CompilationJob constructor, but it is not
// dereferenced there.
......@@ -1143,7 +1142,7 @@ PipelineCompilationJob::PipelineCompilationJob(
zone_(isolate->allocator(), kPipelineCompilationJobZoneName),
zone_stats_(isolate->allocator()),
compilation_info_(&zone_, isolate, shared_info, function, code_kind,
osr_offset, osr_frame),
osr_offset),
pipeline_statistics_(CreatePipelineStatistics(
handle(Script::cast(shared_info->script()), isolate),
compilation_info(), isolate, &zone_stats_)),
......@@ -3555,10 +3554,10 @@ MaybeHandle<Code> Pipeline::GenerateCodeForTesting(
// static
std::unique_ptr<TurbofanCompilationJob> Pipeline::NewCompilationJob(
Isolate* isolate, Handle<JSFunction> function, CodeKind code_kind,
bool has_script, BytecodeOffset osr_offset, JavaScriptFrame* osr_frame) {
bool has_script, BytecodeOffset osr_offset) {
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
return std::make_unique<PipelineCompilationJob>(
isolate, shared, function, osr_offset, osr_frame, code_kind);
return std::make_unique<PipelineCompilationJob>(isolate, shared, function,
osr_offset, code_kind);
}
void Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
......
......@@ -49,8 +49,7 @@ class Pipeline : public AllStatic {
static V8_EXPORT_PRIVATE std::unique_ptr<TurbofanCompilationJob>
NewCompilationJob(Isolate* isolate, Handle<JSFunction> function,
CodeKind code_kind, bool has_script,
BytecodeOffset osr_offset = BytecodeOffset::None(),
JavaScriptFrame* osr_frame = nullptr);
BytecodeOffset osr_offset = BytecodeOffset::None());
// Run the pipeline for the WebAssembly compilation info.
static void GenerateCodeForWasmFunction(
......
......@@ -414,7 +414,7 @@ RUNTIME_FUNCTION(Runtime_CompileOptimizedOSR) {
Handle<CodeT> result;
Handle<JSFunction> function(frame->function(), isolate);
if (!Compiler::CompileOptimizedOSR(isolate, function, osr_offset, frame, mode)
if (!Compiler::CompileOptimizedOSR(isolate, function, osr_offset, mode)
.ToHandle(&result)) {
// An empty result can mean one of two things:
// 1) we've started a concurrent compilation job - everything is fine.
......
......@@ -704,8 +704,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
// Queue the job.
auto unused_result = Compiler::CompileOptimizedOSR(
isolate, function, osr_offset, UnoptimizedFrame::cast(it.frame()),
ConcurrencyMode::kConcurrent);
isolate, function, osr_offset, ConcurrencyMode::kConcurrent);
USE(unused_result);
// Finalize again to finish the queued job. The next call into
......
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