Commit e1c3be0c authored by Andreas Haas's avatar Andreas Haas Committed by V8 LUCI CQ

[cleanup] Fix shadowed variables in wasm/*

R=thibaudm@chromium.org

Bug: v8:12244
Change-Id: I36a44660b8b41a4b9dc44a1143b2cc0c2f88a040
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3181523Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77039}
parent 189bef0b
......@@ -2344,7 +2344,7 @@ class LiftoffCompiler {
__ PushRegister(kind, value);
}
void GlobalSet(FullDecoder* decoder, const Value& value,
void GlobalSet(FullDecoder* decoder, const Value&,
const GlobalIndexImmediate<validate>& imm) {
auto* global = &env_->module->globals[imm.index];
ValueKind kind = global->type.kind();
......@@ -4176,8 +4176,9 @@ class LiftoffCompiler {
Load64BitExceptionValue(value, values_array, index, pinned);
break;
case kF64: {
RegClass rc = reg_class_for(kI64);
LiftoffRegister tmp_reg = pinned.set(__ GetUnusedRegister(rc, pinned));
RegClass rc_i64 = reg_class_for(kI64);
LiftoffRegister tmp_reg =
pinned.set(__ GetUnusedRegister(rc_i64, pinned));
Load64BitExceptionValue(tmp_reg, values_array, index, pinned);
__ emit_type_conversion(kExprF64ReinterpretI64, value, tmp_reg,
nullptr);
......
......@@ -253,8 +253,8 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
i.pc() + 1, module);
os << " @" << i.pc_offset();
CHECK(decoder.Validate(i.pc() + 1, imm));
for (uint32_t i = 0; i < imm.out_arity(); i++) {
os << " " << imm.out_type(i).name();
for (uint32_t j = 0; j < imm.out_arity(); j++) {
os << " " << imm.out_type(j).name();
}
control_depth++;
break;
......
......@@ -1531,13 +1531,13 @@ class CompilationTimeCallback {
native_module_(std::move(native_module)),
compile_mode_(compile_mode) {}
void operator()(CompilationEvent event) {
void operator()(CompilationEvent compilation_event) {
DCHECK(base::TimeTicks::IsHighResolution());
std::shared_ptr<NativeModule> native_module = native_module_.lock();
if (!native_module) return;
auto now = base::TimeTicks::Now();
auto duration = now - start_time_;
if (event == CompilationEvent::kFinishedBaselineCompilation) {
if (compilation_event == CompilationEvent::kFinishedBaselineCompilation) {
// Reset {start_time_} to measure tier-up time.
start_time_ = now;
if (compile_mode_ != kSynchronous) {
......@@ -1562,7 +1562,7 @@ class CompilationTimeCallback {
native_module->baseline_compilation_cpu_duration())};
metrics_recorder_->DelayMainThreadEvent(event, context_id_);
}
if (event == CompilationEvent::kFinishedTopTierCompilation) {
if (compilation_event == CompilationEvent::kFinishedTopTierCompilation) {
TimedHistogram* histogram = async_counters_->wasm_tier_up_module_time();
histogram->AddSample(static_cast<int>(duration.InMicroseconds()));
......@@ -1574,7 +1574,7 @@ class CompilationTimeCallback {
native_module->tier_up_cpu_duration())};
metrics_recorder_->DelayMainThreadEvent(event, context_id_);
}
if (event == CompilationEvent::kFailedCompilation) {
if (compilation_event == CompilationEvent::kFailedCompilation) {
v8::metrics::WasmModuleCompiled event{
(compile_mode_ != kSynchronous), // async
(compile_mode_ == kStreaming), // streamed
......
......@@ -450,8 +450,8 @@ void WasmCode::Disassemble(const char* name, std::ostream& os,
os << " registers: ";
uint32_t register_bits = entry.register_bits();
int bits = 32 - base::bits::CountLeadingZeros32(register_bits);
for (int i = bits - 1; i >= 0; --i) {
os << ((register_bits >> i) & 1);
for (int j = bits - 1; j >= 0; --j) {
os << ((register_bits >> j) & 1);
}
}
os << "\n";
......
......@@ -1036,10 +1036,10 @@ void WasmEngine::RemoveIsolate(Isolate* isolate) {
for (auto* native_module : info->native_modules) {
DCHECK_EQ(1, native_modules_.count(native_module));
DCHECK_EQ(1, native_modules_[native_module]->isolates.count(isolate));
auto* info = native_modules_[native_module].get();
info->isolates.erase(isolate);
auto* module = native_modules_[native_module].get();
module->isolates.erase(isolate);
if (current_gc_info_) {
for (WasmCode* code : info->potentially_dead_code) {
for (WasmCode* code : module->potentially_dead_code) {
current_gc_info_->dead_code.erase(code);
}
}
......@@ -1230,9 +1230,9 @@ void WasmEngine::StreamingCompilationFailed(size_t prefix_hash) {
void WasmEngine::FreeNativeModule(NativeModule* native_module) {
base::MutexGuard guard(&mutex_);
auto it = native_modules_.find(native_module);
DCHECK_NE(native_modules_.end(), it);
for (Isolate* isolate : it->second->isolates) {
auto module = native_modules_.find(native_module);
DCHECK_NE(native_modules_.end(), module);
for (Isolate* isolate : module->second->isolates) {
DCHECK_EQ(1, isolates_.count(isolate));
IsolateInfo* info = isolates_[isolate].get();
DCHECK_EQ(1, info->native_modules.count(native_module));
......@@ -1276,7 +1276,7 @@ void WasmEngine::FreeNativeModule(NativeModule* native_module) {
native_module, current_gc_info_->dead_code.size());
}
native_module_cache_.Erase(native_module);
native_modules_.erase(it);
native_modules_.erase(module);
}
namespace {
......
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