[vm] Cleanup unused variables in anticipation of switching to new clang.

Extracted from https://dart-review.googlesource.com/c/sdk/+/201862 that switches clang to Fuchsia toolchain.

TEST=ci

Change-Id: Icd4e985a433f81862e681332dfcf905b8ec7ba4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204060
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
Alexander Aprelev 2021-06-18 17:45:04 +00:00 committed by commit-bot@chromium.org
parent 495425a546
commit 730156116f
6 changed files with 3 additions and 21 deletions

View file

@ -96,7 +96,7 @@ class ProcessInfoList {
MutexLocker locker(mutex_);
HANDLE wait_handle = INVALID_HANDLE_VALUE;
BOOL success = RegisterWaitForSingleObject(
&wait_handle, handle, &ExitCodeCallback, reinterpret_cast<void*>(pid),
&wait_handle, handle, &ExitCodeCallback, reinterpret_cast<PVOID>(pid),
INFINITE, WT_EXECUTEONLYONCE);
if (!success) {
FATAL("Failed to register exit code wait operation.");
@ -151,7 +151,7 @@ class ProcessInfoList {
if (timed_out) {
return;
}
DWORD pid = reinterpret_cast<DWORD>(data);
DWORD pid = reinterpret_cast<UINT_PTR>(data);
HANDLE handle;
HANDLE wait_handle;
HANDLE exit_pipe;

View file

@ -175,7 +175,6 @@ void CodeStatistics::Finalize() {
}
void CodeStatistics::AppendTo(CombinedCodeStatistics* stat) {
intptr_t sum = 0;
bool returns_constant = true;
bool returns_const_with_load_field_ = true;
@ -183,7 +182,6 @@ void CodeStatistics::AppendTo(CombinedCodeStatistics* stat) {
intptr_t bytes = entries_[i].bytes;
stat->entries_[i].count += entries_[i].count;
if (bytes > 0) {
sum += bytes;
stat->entries_[i].bytes += bytes;
if (i != CombinedCodeStatistics::kTagParallelMove &&
i != CombinedCodeStatistics::kTagReturn &&

View file

@ -1331,8 +1331,7 @@ TypeArgumentsPtr ActivationFrame::BuildParameters(
TypeParameters& type_params = TypeParameters::Handle();
Function& current = Function::Handle(function().ptr());
intptr_t mapping_offset = num_vars;
for (intptr_t i = 0; !current.IsNull(); i += current.NumTypeParameters(),
current = current.parent_function()) {
for (; !current.IsNull(); current = current.parent_function()) {
type_params = current.type_parameters();
if (type_params.IsNull()) continue;
intptr_t size = current.NumTypeParameters();

View file

@ -473,7 +473,6 @@ uword CompactorTask::PlanBlock(uword first_object,
// 1. Compute bitvector of surviving allocation units in the block.
intptr_t block_live_size = 0;
intptr_t block_dead_size = 0;
uword current = first_object;
while (current < block_end) {
ObjectPtr obj = UntaggedObject::FromAddr(current);
@ -483,8 +482,6 @@ uword CompactorTask::PlanBlock(uword first_object,
ASSERT(static_cast<intptr_t>(forwarding_block->Lookup(current)) ==
block_live_size);
block_live_size += size;
} else {
block_dead_size += size;
}
current += size;
}

View file

@ -220,16 +220,12 @@ intptr_t FreeList::LengthLocked(int index) const {
}
void FreeList::PrintSmall() const {
int small_sizes = 0;
int small_objects = 0;
intptr_t small_bytes = 0;
for (int i = 0; i < kNumLists; ++i) {
if (free_lists_[i] == NULL) {
continue;
}
small_sizes += 1;
intptr_t list_length = LengthLocked(i);
small_objects += list_length;
intptr_t list_bytes = list_length * i * kObjectAlignment;
small_bytes += list_bytes;
OS::PrintErr(
@ -265,20 +261,16 @@ class IntptrPair {
};
void FreeList::PrintLarge() const {
int large_sizes = 0;
int large_objects = 0;
intptr_t large_bytes = 0;
MallocDirectChainedHashMap<NumbersKeyValueTrait<IntptrPair> > map;
FreeListElement* node;
for (node = free_lists_[kNumLists]; node != NULL; node = node->next()) {
IntptrPair* pair = map.Lookup(node->HeapSize());
if (pair == NULL) {
large_sizes += 1;
map.Insert(IntptrPair(node->HeapSize(), 1));
} else {
pair->set_second(pair->second() + 1);
}
large_objects += 1;
}
MallocDirectChainedHashMap<NumbersKeyValueTrait<IntptrPair> >::Iterator it =

View file

@ -313,7 +313,6 @@ const char* String::ScrubName(const String& name, bool is_extension) {
printer.Clear();
intptr_t start = 0;
intptr_t final_len = 0;
intptr_t len = sum_segment_len;
bool is_setter = false;
if (is_extension) {
@ -323,7 +322,6 @@ const char* String::ScrubName(const String& name, bool is_extension) {
intptr_t slen = i + 1;
intptr_t plen = slen - start;
AppendSubString(&printer, unmangled_name, start, plen);
final_len = plen;
unmangled_name += slen;
len -= slen;
break;
@ -379,13 +377,11 @@ const char* String::ScrubName(const String& name, bool is_extension) {
intptr_t end = ((dot_pos + 1) == len) ? dot_pos : len;
intptr_t substr_len = end - start;
final_len += substr_len;
AppendSubString(&printer, unmangled_name, start, substr_len);
if (is_setter) {
const char* equals = Symbols::Equals().ToCString();
const intptr_t equals_len = strlen(equals);
AppendSubString(&printer, equals, 0, equals_len);
final_len += equals_len;
}
return printer.buffer();