Commit c016398d authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

[cleanup] Fix -Wshadow in src/base/ and src/d8/

Bug: v8:12244,v8:12245
Change-Id: I718eea6eb065b2775186322b888f805423d6be1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3183161
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77085}
parent 422dc378
......@@ -91,7 +91,7 @@ VLQDecodeUnsigned(GetNextFunction&& get_next) {
}
uint32_t bits = cur_byte & kDataMask;
for (int shift = kContinueShift; shift <= 32; shift += kContinueShift) {
byte cur_byte = get_next();
cur_byte = get_next();
bits |= (cur_byte & kDataMask) << shift;
if (cur_byte <= kDataMask) break;
}
......
......@@ -165,10 +165,12 @@ class ExecArgs {
"os.system(): String conversion of program name failed");
return false;
}
int len = prog.length() + 3;
char* c_arg = new char[len];
snprintf(c_arg, len, "%s", *prog);
exec_args_[0] = c_arg;
{
int len = prog.length() + 3;
char* c_arg = new char[len];
snprintf(c_arg, len, "%s", *prog);
exec_args_[0] = c_arg;
}
int i = 1;
for (unsigned j = 0; j < command_args->Length(); i++, j++) {
Local<Value> arg(
......
......@@ -706,7 +706,7 @@ bool Shell::ExecuteString(Isolate* isolate, Local<String> source,
ScriptOrigin origin(isolate, name);
for (int i = 1; i < options.repeat_compile; ++i) {
HandleScope handle_scope(isolate);
HandleScope handle_scope_for_compiling(isolate);
if (CompileString<Script>(isolate, context, source, origin).IsEmpty()) {
return false;
}
......@@ -3252,10 +3252,10 @@ void Shell::WriteLcovData(v8::Isolate* isolate, const char* file) {
int end_line = end.GetLineNumber();
uint32_t count = function_data.Count();
Local<String> name;
Local<String> function_name;
std::stringstream name_stream;
if (function_data.Name().ToLocal(&name)) {
name_stream << ToSTLString(isolate, name);
if (function_data.Name().ToLocal(&function_name)) {
name_stream << ToSTLString(isolate, function_name);
} else {
name_stream << "<" << start_line + 1 << "-";
name_stream << start.GetColumnNumber() << ">";
......@@ -3275,8 +3275,8 @@ void Shell::WriteLcovData(v8::Isolate* isolate, const char* file) {
}
}
// Write per-line coverage. LCOV uses 1-based line numbers.
for (size_t i = 0; i < lines.size(); i++) {
sink << "DA:" << (i + 1) << "," << lines[i] << std::endl;
for (size_t j = 0; j < lines.size(); j++) {
sink << "DA:" << (j + 1) << "," << lines[j] << std::endl;
}
sink << "end_of_record" << std::endl;
}
......@@ -5194,15 +5194,15 @@ int Shell::Main(int argc, char* argv[]) {
ShellOptions::CodeCacheOptions::kNoProduceCache) {
printf("============ Run: Produce code cache ============\n");
// First run to produce the cache
Isolate::CreateParams create_params;
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
Isolate::CreateParams create_params2;
create_params2.array_buffer_allocator = Shell::array_buffer_allocator;
i::FLAG_hash_seed ^= 1337; // Use a different hash seed.
Isolate* isolate2 = Isolate::New(create_params);
Isolate* isolate2 = Isolate::New(create_params2);
i::FLAG_hash_seed ^= 1337; // Restore old hash seed.
{
D8Console console(isolate2);
Initialize(isolate2, &console);
PerIsolateData data(isolate2);
D8Console console2(isolate2);
Initialize(isolate2, &console2);
PerIsolateData data2(isolate2);
Isolate::Scope isolate_scope(isolate2);
result = RunMain(isolate2, false);
......
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