Commit c5fcc5fc authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Remove CompilationInfo::unoptimized_code field.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1812923002

Cr-Commit-Position: refs/heads/master@{#34881}
parent 5b5d24b3
......@@ -1088,20 +1088,20 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
DCHECK(AllowCompilation::IsAllowed(isolate));
Handle<Code> current_code(shared->code());
if (!shared->is_compiled() ||
shared->scope_info() == ScopeInfo::Empty(isolate)) {
// The function was never compiled. Compile it unoptimized first.
// TODO(titzer): reuse the AST and scope info from this compile.
CompilationInfoWithZone unoptimized(function);
unoptimized.EnableDeoptimizationSupport();
if (!GetUnoptimizedCodeCommon(&unoptimized).ToHandle(&current_code)) {
Handle<Code> unoptimized_code;
if (!GetUnoptimizedCodeCommon(&unoptimized).ToHandle(&unoptimized_code)) {
return MaybeHandle<Code>();
}
shared->ReplaceCode(*current_code);
shared->ReplaceCode(*unoptimized_code);
}
current_code->set_profiler_ticks(0);
shared->code()->set_profiler_ticks(0);
// TODO(mstarzinger): We cannot properly deserialize a scope chain containing
// an eval scope and hence would fail at parsing the eval source again.
......@@ -1121,7 +1121,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
DCHECK(!isolate->has_pending_exception());
PostponeInterruptsScope postpone(isolate);
info->SetOptimizingForOsr(osr_ast_id, current_code);
info->SetOptimizingForOsr(osr_ast_id);
if (mode == Compiler::CONCURRENT) {
if (GetOptimizedCodeLater(info.get())) {
......
......@@ -197,7 +197,6 @@ class CompilationInfo {
Handle<Code> code() const { return code_; }
Code::Flags code_flags() const { return code_flags_; }
BailoutId osr_ast_id() const { return osr_ast_id_; }
Handle<Code> unoptimized_code() const { return unoptimized_code_; }
int opt_count() const { return opt_count_; }
int num_parameters() const;
int num_parameters_including_this() const;
......@@ -362,10 +361,9 @@ class CompilationInfo {
code_flags_ =
Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION);
}
void SetOptimizingForOsr(BailoutId osr_ast_id, Handle<Code> unoptimized) {
void SetOptimizingForOsr(BailoutId osr_ast_id) {
SetOptimizing();
osr_ast_id_ = osr_ast_id;
unoptimized_code_ = unoptimized;
}
// Deoptimization support.
......@@ -389,7 +387,7 @@ class CompilationInfo {
}
void ReopenHandlesInNewHandleScope() {
unoptimized_code_ = Handle<Code>(*unoptimized_code_);
// Empty for now but will be needed once fields move from ParseInfo.
}
void AbortOptimization(BailoutReason reason) {
......@@ -542,10 +540,6 @@ class CompilationInfo {
// Compilation mode flag and whether deoptimization is allowed.
Mode mode_;
BailoutId osr_ast_id_;
// The unoptimized code we patched for OSR may not be the shared code
// afterwards, since we may need to compile it again to include deoptimization
// data. Keep track which code we patched.
Handle<Code> unoptimized_code_;
// Holds the bytecode array generated by the interpreter.
// TODO(rmcilroy/mstarzinger): Temporary work-around until compiler.cc is
......
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