Commit 7e8f248b authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Simplify handling of OSR source frame.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/1961843002
Cr-Commit-Position: refs/heads/master@{#36127}
parent 11efb976
...@@ -727,7 +727,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, ...@@ -727,7 +727,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
CompilationInfo* info = job->info(); CompilationInfo* info = job->info();
ParseInfo* parse_info = info->parse_info(); ParseInfo* parse_info = info->parse_info();
info->SetOptimizingForOsr(osr_ast_id); info->SetOptimizingForOsr(osr_ast_id, osr_frame);
// Do not use Crankshaft/TurboFan if we need to be able to set break points. // Do not use Crankshaft/TurboFan if we need to be able to set break points.
if (info->shared_info()->HasDebugInfo()) { if (info->shared_info()->HasDebugInfo()) {
...@@ -774,7 +774,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, ...@@ -774,7 +774,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
return isolate->builtins()->InOptimizationQueue(); return isolate->builtins()->InOptimizationQueue();
} }
} else { } else {
info->set_osr_frame(osr_frame);
if (GetOptimizedCodeNow(job.get())) return info->code(); if (GetOptimizedCodeNow(job.get())) return info->code();
} }
......
...@@ -191,6 +191,7 @@ class CompilationInfo final { ...@@ -191,6 +191,7 @@ class CompilationInfo final {
Handle<Code> code() const { return code_; } Handle<Code> code() const { return code_; }
Code::Flags code_flags() const { return code_flags_; } Code::Flags code_flags() const { return code_flags_; }
BailoutId osr_ast_id() const { return osr_ast_id_; } BailoutId osr_ast_id() const { return osr_ast_id_; }
JavaScriptFrame* osr_frame() const { return osr_frame_; }
int num_parameters() const; int num_parameters() const;
int num_parameters_including_this() const; int num_parameters_including_this() const;
bool is_this_defined() const; bool is_this_defined() const;
...@@ -340,9 +341,10 @@ class CompilationInfo final { ...@@ -340,9 +341,10 @@ class CompilationInfo final {
code_flags_ = code_flags_ =
Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION);
} }
void SetOptimizingForOsr(BailoutId osr_ast_id) { void SetOptimizingForOsr(BailoutId osr_ast_id, JavaScriptFrame* osr_frame) {
SetOptimizing(); SetOptimizing();
osr_ast_id_ = osr_ast_id; osr_ast_id_ = osr_ast_id;
osr_frame_ = osr_frame;
} }
// Deoptimization support. // Deoptimization support.
...@@ -399,10 +401,6 @@ class CompilationInfo final { ...@@ -399,10 +401,6 @@ class CompilationInfo final {
CompilationDependencies* dependencies() { return &dependencies_; } CompilationDependencies* dependencies() { return &dependencies_; }
bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) {
return osr_ast_id_ == osr_ast_id && function.is_identical_to(closure());
}
int optimization_id() const { return optimization_id_; } int optimization_id() const { return optimization_id_; }
int osr_expr_stack_height() { return osr_expr_stack_height_; } int osr_expr_stack_height() { return osr_expr_stack_height_; }
...@@ -410,8 +408,6 @@ class CompilationInfo final { ...@@ -410,8 +408,6 @@ class CompilationInfo final {
DCHECK(height >= 0); DCHECK(height >= 0);
osr_expr_stack_height_ = height; osr_expr_stack_height_ = height;
} }
JavaScriptFrame* osr_frame() const { return osr_frame_; }
void set_osr_frame(JavaScriptFrame* osr_frame) { osr_frame_ = osr_frame; }
#if DEBUG #if DEBUG
void PrintAstForTesting(); void PrintAstForTesting();
......
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