Commit ca596361 authored by Peter Kasting's avatar Peter Kasting Committed by V8 LUCI CQ

Fix some instances of -Wunreachable-code-aggressive.

These need some consideration.  Clang apparently considers V8_UNLIKELY
to mean "always false", which seems questionable to me (possibly a
bug?).  That said, removing it in the cases here doesn't seem likely to
cause problems -- the logging instance seems fine, and the other used to
not have the macro and gained it in a commit that seemed to have nothing
to do with performance.

The trampoline register change is safe, but perhaps V8 will support an
architecture in the future which needs this conditional?

I'd leave these as-is, but it also seems a shame not to enable
-Wunreachable-code-aggressive just because of these...

Bug: chromium:1066980
Change-Id: Ib819298cecba082666c26fa7010009f8e9441bf8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2994805
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75681}
parent 9e6fcf1d
......@@ -1029,7 +1029,7 @@ Logger::~Logger() = default;
const LogSeparator Logger::kNext = LogSeparator::kSeparator;
int64_t Logger::Time() {
if (V8_UNLIKELY(FLAG_verify_predictable)) {
if (FLAG_verify_predictable) {
return isolate_->heap()->MonotonicallyIncreasingTimeInMs() * 1000;
}
return timer_.Elapsed().InMicroseconds();
......
......@@ -189,10 +189,8 @@ bool BuiltinAliasesOffHeapTrampolineRegister(Isolate* isolate, Code code) {
return false;
}
if (CallInterfaceDescriptor::ContextRegister() ==
kOffHeapTrampolineRegister) {
return true;
}
STATIC_ASSERT(CallInterfaceDescriptor::ContextRegister() !=
kOffHeapTrampolineRegister);
Callable callable = Builtins::CallableFor(isolate, code.builtin_id());
CallInterfaceDescriptor descriptor = callable.descriptor();
......
......@@ -1747,7 +1747,7 @@ bool WasmCodeManager::CanRegisterUnwindInfoForNonABICompliantCodeRange() {
void WasmCodeManager::Commit(base::AddressRegion region) {
// TODO(v8:8462): Remove eager commit once perf supports remapping.
if (V8_UNLIKELY(FLAG_perf_prof)) return;
if (FLAG_perf_prof) return;
DCHECK(IsAligned(region.begin(), CommitPageSize()));
DCHECK(IsAligned(region.size(), CommitPageSize()));
// Reserve the size. Use CAS loop to avoid overflow on
......@@ -1806,7 +1806,7 @@ void WasmCodeManager::Commit(base::AddressRegion region) {
void WasmCodeManager::Decommit(base::AddressRegion region) {
// TODO(v8:8462): Remove this once perf supports remapping.
if (V8_UNLIKELY(FLAG_perf_prof)) return;
if (FLAG_perf_prof) return;
PageAllocator* allocator = GetPlatformPageAllocator();
DCHECK(IsAligned(region.begin(), allocator->CommitPageSize()));
DCHECK(IsAligned(region.size(), allocator->CommitPageSize()));
......
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