Commit e7c8f7d7 authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[profiler] Fix -Wshadow warnings

Bug: v8:12244,v8:12245
Change-Id: If92311b47a6019cb9f7b96a7dcd313a658d426ec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3265067Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77770}
parent 2aa7166b
......@@ -234,7 +234,7 @@ void SamplingEventsProcessor::SymbolizeAndAddToProfiles(
symbolizer_->SymbolizeTickSample(record->sample);
profiles_->AddPathToCurrentProfiles(
record->sample.timestamp, symbolized.stack_trace, symbolized.src_line,
record->sample.update_stats, record->sample.sampling_interval,
record->sample.update_stats_, record->sample.sampling_interval_,
reinterpret_cast<Address>(record->sample.context));
}
......
......@@ -127,7 +127,7 @@ void HeapEntry::Print(const char* prefix, const char* edge_name, int max_depth,
HeapGraphEdge& edge = **i;
const char* edge_prefix = "";
base::EmbeddedVector<char, 64> index;
const char* edge_name = index.begin();
edge_name = index.begin();
switch (edge.type()) {
case HeapGraphEdge::kContextVariable:
edge_prefix = "#";
......
......@@ -177,7 +177,7 @@ void ProfilerListener::CodeCreateEvent(LogEventsAndTags tag,
if (pos_info.position.ScriptOffset() == kNoSourcePosition) continue;
if (pos_info.script.is_null()) continue;
int line_number =
line_number =
pos_info.script->GetLineNumber(pos_info.position.ScriptOffset()) +
1;
......
......@@ -132,11 +132,11 @@ SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() {
AllocationNode* node = &profile_root_;
std::vector<SharedFunctionInfo> stack;
JavaScriptFrameIterator it(isolate_);
JavaScriptFrameIterator frame_it(isolate_);
int frames_captured = 0;
bool found_arguments_marker_frames = false;
while (!it.done() && frames_captured < stack_depth_) {
JavaScriptFrame* frame = it.frame();
while (!frame_it.done() && frames_captured < stack_depth_) {
JavaScriptFrame* frame = frame_it.frame();
// If we are materializing objects during deoptimization, inlined
// closures may not yet be materialized, and this includes the
// closure on the stack. Skip over any such frames (they'll be
......@@ -149,7 +149,7 @@ SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() {
} else {
found_arguments_marker_frames = true;
}
it.Advance();
frame_it.Advance();
}
if (frames_captured == 0) {
......
......@@ -125,8 +125,8 @@ Symbolizer::SymbolizedSample Symbolizer::SymbolizeTickSample(
entry->GetInlineStack(pc_offset);
if (inline_stack) {
int most_inlined_frame_line_number = entry->GetSourceLine(pc_offset);
for (auto entry : *inline_stack) {
stack_trace.push_back(entry);
for (auto inline_stack_entry : *inline_stack) {
stack_trace.push_back(inline_stack_entry);
}
// This is a bit of a messy hack. The line number for the most-inlined
......
......@@ -159,7 +159,7 @@ DISABLE_ASAN void TickSample::Init(Isolate* v8_isolate,
bool update_stats,
bool use_simulator_reg_state,
base::TimeDelta sampling_interval) {
this->update_stats = update_stats;
update_stats_ = update_stats;
SampleInfo info;
RegisterState regs = reg_state;
if (!GetStackSample(v8_isolate, &regs, record_c_entry_frame, stack,
......@@ -196,7 +196,7 @@ DISABLE_ASAN void TickSample::Init(Isolate* v8_isolate,
} else {
tos = nullptr;
}
this->sampling_interval = sampling_interval;
sampling_interval_ = sampling_interval;
timestamp = base::TimeTicks::HighResolutionNow();
}
......@@ -352,9 +352,9 @@ void TickSample::print() const {
PrintF(" - has_external_callback: %d\n", has_external_callback);
PrintF(" - %s: %p\n",
has_external_callback ? "external_callback_entry" : "tos", tos);
PrintF(" - update_stats: %d\n", update_stats);
PrintF(" - update_stats: %d\n", update_stats_);
PrintF(" - sampling_interval: %" PRId64 "\n",
sampling_interval.InMicroseconds());
sampling_interval_.InMicroseconds());
PrintF("\n");
}
......
......@@ -27,7 +27,7 @@ struct V8_EXPORT TickSample {
external_callback_entry(nullptr),
frames_count(0),
has_external_callback(false),
update_stats(true) {}
update_stats_(true) {}
/**
* Initialize a tick sample from the isolate.
......@@ -93,10 +93,10 @@ struct V8_EXPORT TickSample {
void* context = nullptr; // Address of the incumbent native context.
unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames.
bool has_external_callback : 1;
bool update_stats : 1; // Whether the sample should update aggregated stats.
bool update_stats_ : 1; // Whether the sample should update aggregated stats.
base::TimeTicks timestamp;
base::TimeDelta sampling_interval; // Sampling interval used to capture.
base::TimeDelta sampling_interval_; // Sampling interval used to capture.
};
} // namespace internal
......
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