[runtime] Remove support for missing deoptimization.

This removes support for optimized frame which lack deoptimization
information. All optimized JavaScript frames now imply that the
underlying bytecode is available too.

R=rmcilroy@chromium.org
BUG=v8:6409

Change-Id: Ie73c0a376002466884388f1da9e1ec2741884596
Reviewed-on: https://chromium-review.googlesource.com/612162
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49442}
This commit is contained in:
Michael Starzinger 2017-11-17 12:34:58 +01:00 committed by Commit Bot
parent 4c420258d3
commit 4a7698fcdd
4 changed files with 5 additions and 44 deletions

View File

@ -39,13 +39,6 @@ FrameInspector::FrameInspector(StandardFrame* frame, int inlined_frame_index,
// Calculate the deoptimized frame.
if (is_optimized_) {
DCHECK_NOT_NULL(js_frame);
// TODO(turbofan): Deoptimization from AstGraphBuilder is not supported.
if (js_frame->LookupCode()->is_turbofanned() &&
!js_frame->function()->shared()->HasBytecodeArray()) {
is_optimized_ = false;
return;
}
deoptimized_frame_.reset(Deoptimizer::DebuggerInspectableFrame(
js_frame, inlined_frame_index, isolate));
} else if (frame_->is_wasm_interpreter_entry()) {
@ -75,12 +68,6 @@ Handle<Object> FrameInspector::GetParameter(int index) {
}
Handle<Object> FrameInspector::GetExpression(int index) {
// TODO(turbofan): Deoptimization from AstGraphBuilder is not supported.
if (frame_->is_java_script() &&
javascript_frame()->LookupCode()->is_turbofanned() &&
!javascript_frame()->function()->shared()->HasBytecodeArray()) {
return isolate_->factory()->undefined_value();
}
return is_optimized_ ? deoptimized_frame_->GetExpression(index)
: handle(frame_->GetExpression(index), isolate_);
}

View File

@ -198,14 +198,11 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) {
int deopt_index = safepoint.deoptimization_index();
// Turbofan deopt is checked when we are patching addresses on stack.
bool is_non_deoptimizing_asm_code =
code->is_turbofanned() && !function->shared()->HasBytecodeArray();
bool safe_if_deopt_triggered =
deopt_index != Safepoint::kNoDeoptimizationIndex ||
is_non_deoptimizing_asm_code;
deopt_index != Safepoint::kNoDeoptimizationIndex;
bool is_builtin_code = code->kind() == Code::BUILTIN;
DCHECK(topmost_optimized_code == nullptr || safe_if_deopt_triggered ||
is_non_deoptimizing_asm_code || is_builtin_code);
is_builtin_code);
if (topmost_optimized_code == nullptr) {
topmost_optimized_code = code;
safe_to_deopt_topmost_optimized_code = safe_if_deopt_triggered;

View File

@ -1132,14 +1132,6 @@ int JavaScriptBuiltinContinuationFrame::ComputeParametersCount() const {
return Smi::ToInt(argc_object);
}
namespace {
bool IsNonDeoptimizingAsmCode(Code* code, JSFunction* function) {
return code->is_turbofanned() && !function->shared()->HasBytecodeArray();
}
} // namespace
FrameSummary::JavaScriptFrameSummary::JavaScriptFrameSummary(
Isolate* isolate, Object* receiver, JSFunction* function,
AbstractCode* abstract_code, int code_offset, bool is_constructor)
@ -1150,8 +1142,7 @@ FrameSummary::JavaScriptFrameSummary::JavaScriptFrameSummary(
code_offset_(code_offset),
is_constructor_(is_constructor) {
DCHECK(abstract_code->IsBytecodeArray() ||
Code::cast(abstract_code)->kind() != Code::OPTIMIZED_FUNCTION ||
IsNonDeoptimizingAsmCode(Code::cast(abstract_code), function));
Code::cast(abstract_code)->kind() != Code::OPTIMIZED_FUNCTION);
}
bool FrameSummary::JavaScriptFrameSummary::is_subject_to_debugging() const {
@ -1327,8 +1318,7 @@ void OptimizedFrame::Summarize(std::vector<FrameSummary>* frames) const {
// Delegate to JS frame in absence of turbofan deoptimization.
// TODO(turbofan): Revisit once we support deoptimization across the board.
Code* code = LookupCode();
if (code->kind() == Code::BUILTIN ||
IsNonDeoptimizingAsmCode(code, function())) {
if (code->kind() == Code::BUILTIN) {
return JavaScriptFrame::Summarize(frames);
}
@ -1466,8 +1456,7 @@ void OptimizedFrame::GetFunctions(
// Delegate to JS frame in absence of turbofan deoptimization.
// TODO(turbofan): Revisit once we support deoptimization across the board.
Code* code = LookupCode();
if (code->kind() == Code::BUILTIN ||
IsNonDeoptimizingAsmCode(code, function())) {
if (code->kind() == Code::BUILTIN) {
return JavaScriptFrame::GetFunctions(functions);
}

View File

@ -127,12 +127,6 @@ RUNTIME_FUNCTION(Runtime_DeoptimizeFunction) {
// If the function is not optimized, just return.
if (!function->IsOptimized()) return isolate->heap()->undefined_value();
// TODO(turbofan): Deoptimization from AstGraphBuilder is not supported.
if (function->code()->is_turbofanned() &&
!function->shared()->HasBytecodeArray()) {
return isolate->heap()->undefined_value();
}
Deoptimizer::DeoptimizeFunction(*function);
return isolate->heap()->undefined_value();
@ -153,12 +147,6 @@ RUNTIME_FUNCTION(Runtime_DeoptimizeNow) {
// If the function is not optimized, just return.
if (!function->IsOptimized()) return isolate->heap()->undefined_value();
// TODO(turbofan): Deoptimization from AstGraphBuilder is not supported.
if (function->code()->is_turbofanned() &&
!function->shared()->HasBytecodeArray()) {
return isolate->heap()->undefined_value();
}
Deoptimizer::DeoptimizeFunction(*function);
return isolate->heap()->undefined_value();