Commit f6726358 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[deoptimizer] Turn always-true condition into (D)CHECK

Also fix a typo in a log message.

Change-Id: I247e5347b7f7d71b08630489896da463dd76b8a3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2277885
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68635}
parent 3a4a0235
...@@ -176,7 +176,7 @@ Code Deoptimizer::FindDeoptimizingCode(Address addr) { ...@@ -176,7 +176,7 @@ Code Deoptimizer::FindDeoptimizingCode(Address addr) {
Object element = native_context.DeoptimizedCodeListHead(); Object element = native_context.DeoptimizedCodeListHead();
while (!element.IsUndefined(isolate)) { while (!element.IsUndefined(isolate)) {
Code code = Code::cast(element); Code code = Code::cast(element);
CHECK(code.kind() == Code::OPTIMIZED_FUNCTION); CHECK_EQ(code.kind(), Code::OPTIMIZED_FUNCTION);
if (code.contains(addr)) return code; if (code.contains(addr)) return code;
element = code.next_code_link(); element = code.next_code_link();
} }
...@@ -528,13 +528,13 @@ Deoptimizer::Deoptimizer(Isolate* isolate, JSFunction function, ...@@ -528,13 +528,13 @@ Deoptimizer::Deoptimizer(Isolate* isolate, JSFunction function,
DCHECK(AllowHeapAllocation::IsAllowed()); DCHECK(AllowHeapAllocation::IsAllowed());
disallow_heap_allocation_ = new DisallowHeapAllocation(); disallow_heap_allocation_ = new DisallowHeapAllocation();
#endif // DEBUG #endif // DEBUG
if ((compiled_code_.kind() != Code::OPTIMIZED_FUNCTION || CHECK_EQ(compiled_code_.kind(), Code::OPTIMIZED_FUNCTION);
!compiled_code_.deopt_already_counted()) && if (!compiled_code_.deopt_already_counted() &&
deopt_kind_ == DeoptimizeKind::kSoft) { deopt_kind_ == DeoptimizeKind::kSoft) {
isolate->counters()->soft_deopts_executed()->Increment(); isolate->counters()->soft_deopts_executed()->Increment();
} }
if (compiled_code_.kind() == Code::OPTIMIZED_FUNCTION) {
compiled_code_.set_deopt_already_counted(true); compiled_code_.set_deopt_already_counted(true);
{
HandleScope scope(isolate_); HandleScope scope(isolate_);
PROFILE(isolate_, CodeDeoptEvent(handle(compiled_code_, isolate_), kind, PROFILE(isolate_, CodeDeoptEvent(handle(compiled_code_, isolate_), kind,
from_, fp_to_sp_delta_)); from_, fp_to_sp_delta_));
...@@ -665,7 +665,7 @@ int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) { ...@@ -665,7 +665,7 @@ int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) {
Object element = native_context.DeoptimizedCodeListHead(); Object element = native_context.DeoptimizedCodeListHead();
while (!element.IsUndefined(isolate)) { while (!element.IsUndefined(isolate)) {
Code code = Code::cast(element); Code code = Code::cast(element);
DCHECK(code.kind() == Code::OPTIMIZED_FUNCTION); DCHECK_EQ(code.kind(), Code::OPTIMIZED_FUNCTION);
if (!code.marked_for_deoptimization()) { if (!code.marked_for_deoptimization()) {
length++; length++;
} }
...@@ -1819,14 +1819,13 @@ unsigned Deoptimizer::ComputeInputFrameSize() const { ...@@ -1819,14 +1819,13 @@ unsigned Deoptimizer::ComputeInputFrameSize() const {
// function into account so we have to avoid double counting them. // function into account so we have to avoid double counting them.
unsigned fixed_size_above_fp = ComputeInputFrameAboveFpFixedSize(); unsigned fixed_size_above_fp = ComputeInputFrameAboveFpFixedSize();
unsigned result = fixed_size_above_fp + fp_to_sp_delta_; unsigned result = fixed_size_above_fp + fp_to_sp_delta_;
if (compiled_code_.kind() == Code::OPTIMIZED_FUNCTION) { DCHECK_EQ(compiled_code_.kind(), Code::OPTIMIZED_FUNCTION);
unsigned stack_slots = compiled_code_.stack_slots(); unsigned stack_slots = compiled_code_.stack_slots();
unsigned outgoing_size = 0; unsigned outgoing_size = 0;
// ComputeOutgoingArgumentSize(compiled_code_, bailout_id_); // ComputeOutgoingArgumentSize(compiled_code_, bailout_id_);
CHECK_EQ(fixed_size_above_fp + (stack_slots * kSystemPointerSize) - CHECK_EQ(fixed_size_above_fp + (stack_slots * kSystemPointerSize) -
CommonFrameConstants::kFixedFrameSizeAboveFp + outgoing_size, CommonFrameConstants::kFixedFrameSizeAboveFp + outgoing_size,
result); result);
}
return result; return result;
} }
......
...@@ -411,7 +411,7 @@ void FeedbackVector::EvictOptimizedCodeMarkedForDeoptimization( ...@@ -411,7 +411,7 @@ void FeedbackVector::EvictOptimizedCodeMarkedForDeoptimization(
if (FLAG_trace_deopt) { if (FLAG_trace_deopt) {
CodeTracer::Scope scope(GetIsolate()->GetCodeTracer()); CodeTracer::Scope scope(GetIsolate()->GetCodeTracer());
PrintF(scope.file(), PrintF(scope.file(),
"[evicting optimizing code marked for deoptimization (%s) for ", "[evicting optimized code marked for deoptimization (%s) for ",
reason); reason);
shared.ShortPrint(scope.file()); shared.ShortPrint(scope.file());
PrintF(scope.file(), "]\n"); PrintF(scope.file(), "]\n");
......
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