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