Commit a1439d41 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[liftoff][debug] Minor cleanup

1) Replace a condition by a DCHECK.
2) Remove dead argument.

R=thibaudm@chromium.org

Bug: v8:10321
Change-Id: I546d18e7e5520630ab32b4f73f9fe12b0441cb95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108556Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66790}
parent da647667
...@@ -653,9 +653,10 @@ class DebugInfoImpl { ...@@ -653,9 +653,10 @@ class DebugInfoImpl {
// Liftoff variants of a function would be problematic. // Liftoff variants of a function would be problematic.
base::MutexGuard guard(&mutex_); base::MutexGuard guard(&mutex_);
// offset == 0 indicates flooding and should not happen here.
DCHECK_NE(0, offset);
std::vector<int>& breakpoints = breakpoints_per_function_[func_index]; std::vector<int>& breakpoints = breakpoints_per_function_[func_index];
// offset == 0 indicates flooding and is handled by the compiler.
if (offset != 0) {
auto insertion_point = auto insertion_point =
std::lower_bound(breakpoints.begin(), breakpoints.end(), offset); std::lower_bound(breakpoints.begin(), breakpoints.end(), offset);
if (insertion_point != breakpoints.end() && *insertion_point == offset) { if (insertion_point != breakpoints.end() && *insertion_point == offset) {
...@@ -663,7 +664,6 @@ class DebugInfoImpl { ...@@ -663,7 +664,6 @@ class DebugInfoImpl {
return; return;
} }
breakpoints.insert(insertion_point, offset); breakpoints.insert(insertion_point, offset);
}
// No need to recompile if the function is already flooded. // No need to recompile if the function is already flooded.
if (func_index == flooded_function_index_) return; if (func_index == flooded_function_index_) return;
...@@ -672,8 +672,7 @@ class DebugInfoImpl { ...@@ -672,8 +672,7 @@ class DebugInfoImpl {
current_isolate); current_isolate);
} }
void FloodWithBreakpoints(NativeModule* native_module, int func_index, void FloodWithBreakpoints(int func_index, Isolate* current_isolate) {
Isolate* current_isolate) {
base::MutexGuard guard(&mutex_); base::MutexGuard guard(&mutex_);
// 0 is an invalid offset used to indicate flooding. // 0 is an invalid offset used to indicate flooding.
int offset = 0; int offset = 0;
...@@ -687,8 +686,7 @@ class DebugInfoImpl { ...@@ -687,8 +686,7 @@ class DebugInfoImpl {
DCHECK(it.frame()->is_wasm_compiled()); DCHECK(it.frame()->is_wasm_compiled());
WasmCompiledFrame* frame = WasmCompiledFrame::cast(it.frame()); WasmCompiledFrame* frame = WasmCompiledFrame::cast(it.frame());
if (static_cast<int>(frame->function_index()) != flooded_function_index_) { if (static_cast<int>(frame->function_index()) != flooded_function_index_) {
FloodWithBreakpoints(frame->native_module(), frame->function_index(), FloodWithBreakpoints(frame->function_index(), isolate);
isolate);
flooded_function_index_ = frame->function_index(); flooded_function_index_ = frame->function_index();
} }
stepping_frame_ = frame->id(); stepping_frame_ = frame->id();
......
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