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

[cleanup] Remove variable shadowing in cctest/compiler/*

Bug: v8:12244
Change-Id: Ia99fac6e7001bb6bce12256d3fcce28e45222f7d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3182229Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77094}
parent 0298ece6
......@@ -141,9 +141,9 @@ Handle<JSFunction> FunctionTester::ForMachineGraph(Graph* graph,
p, p.GetIsolate()); // allocated in outer handle scope.
}
Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) {
Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> f) {
Zone zone(isolate->allocator(), ZONE_NAME);
return Optimize(function, &zone, isolate, flags_);
return Optimize(f, &zone, isolate, flags_);
}
// Compile the given machine graph instead of the source of the function
......
......@@ -471,9 +471,9 @@ TEST(BranchCombineInt32AddLessThanZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Int32LessThan(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -498,9 +498,9 @@ TEST(BranchCombineInt32AddGreaterThanOrEqualZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Int32GreaterThanOrEqual(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -525,9 +525,9 @@ TEST(BranchCombineInt32ZeroGreaterThanAdd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Int32GreaterThan(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -552,9 +552,9 @@ TEST(BranchCombineInt32ZeroLessThanOrEqualAdd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Int32LessThanOrEqual(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -579,9 +579,9 @@ TEST(BranchCombineUint32AddLessThanOrEqualZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Uint32LessThanOrEqual(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -605,9 +605,9 @@ TEST(BranchCombineUint32AddGreaterThanZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Uint32GreaterThan(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -631,9 +631,9 @@ TEST(BranchCombineUint32ZeroGreaterThanOrEqualAdd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Uint32GreaterThanOrEqual(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -657,9 +657,9 @@ TEST(BranchCombineUint32ZeroLessThanAdd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Int32Add(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Int32Add(p0, p1);
Node* compare = m.Uint32LessThan(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -683,9 +683,9 @@ TEST(BranchCombineWord32AndLessThanZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Int32LessThan(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -709,9 +709,9 @@ TEST(BranchCombineWord32AndGreaterThanOrEqualZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Int32GreaterThanOrEqual(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -735,9 +735,9 @@ TEST(BranchCombineInt32ZeroGreaterThanAnd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Int32GreaterThan(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -761,9 +761,9 @@ TEST(BranchCombineInt32ZeroLessThanOrEqualAnd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Int32(),
MachineType::Int32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Int32LessThanOrEqual(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -787,9 +787,9 @@ TEST(BranchCombineUint32AndLessThanOrEqualZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Uint32LessThanOrEqual(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -813,9 +813,9 @@ TEST(BranchCombineUint32AndGreaterThanZero) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Uint32GreaterThan(add, m.Int32Constant(0));
RawMachineLabel blocka, blockb;
......@@ -839,9 +839,9 @@ TEST(BranchCombineUint32ZeroGreaterThanOrEqualAnd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Uint32GreaterThanOrEqual(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......@@ -865,9 +865,9 @@ TEST(BranchCombineUint32ZeroLessThanAnd) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
MachineType::Uint32());
Node* a = m.Parameter(0);
Node* b = m.Parameter(1);
Node* add = m.Word32And(a, b);
Node* p0 = m.Parameter(0);
Node* p1 = m.Parameter(1);
Node* add = m.Word32And(p0, p1);
Node* compare = m.Uint32LessThan(m.Int32Constant(0), add);
RawMachineLabel blocka, blockb;
......
......@@ -18,7 +18,7 @@ void CompileRunWithNodeObserver(const std::string& js_code,
IrOpcode::Value updated_call_opcode2) {
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope scope(isolate);
v8::HandleScope handle_scope(isolate);
FLAG_allow_natives_syntax = true;
FLAG_turbo_optimize_apply = true;
......
......@@ -235,12 +235,12 @@ class ParallelMoveCreator : public HandleAndZoneScope {
// destinations set with the float equivalents of the operand and check
// that all destinations are unique and do not alias each other.
if (!kSimpleFPAliasing && mo.destination().IsFPLocationOperand()) {
std::vector<InstructionOperand> fragments;
GetCanonicalOperands(dst, &fragments);
CHECK(!fragments.empty());
for (size_t i = 0; i < fragments.size(); ++i) {
if (destinations.find(fragments[i]) == destinations.end()) {
destinations.insert(fragments[i]);
std::vector<InstructionOperand> dst_fragments;
GetCanonicalOperands(dst, &dst_fragments);
CHECK(!dst_fragments.empty());
for (size_t j = 0; j < dst_fragments.size(); ++j) {
if (destinations.find(dst_fragments[j]) == destinations.end()) {
destinations.insert(dst_fragments[j]);
} else {
reject = true;
break;
......@@ -250,18 +250,18 @@ class ParallelMoveCreator : public HandleAndZoneScope {
// representations.
const InstructionOperand& src = mo.source();
if (src.IsFPRegister()) {
std::vector<InstructionOperand> fragments;
std::vector<InstructionOperand> src_fragments;
MachineRepresentation src_rep =
LocationOperand::cast(src).representation();
GetCanonicalOperands(src, &fragments);
CHECK(!fragments.empty());
for (size_t i = 0; i < fragments.size(); ++i) {
auto find_it = sources.find(fragments[i]);
GetCanonicalOperands(src, &src_fragments);
CHECK(!src_fragments.empty());
for (size_t j = 0; j < src_fragments.size(); ++j) {
auto find_it = sources.find(src_fragments[j]);
if (find_it != sources.end() && find_it->second != src_rep) {
reject = true;
break;
}
sources.insert(std::make_pair(fragments[i], src_rep));
sources.insert(std::make_pair(src_fragments[j], src_rep));
}
}
} else {
......
......@@ -765,8 +765,8 @@ TEST(RemoveToNumberEffects) {
if (effect_use != nullptr) {
R.CheckEffectInput(R.start(), effect_use);
// Check that value uses of ToNumber() do not go to start().
for (int i = 0; i < effect_use->op()->ValueInputCount(); i++) {
CHECK_NE(R.start(), effect_use->InputAt(i));
for (int j = 0; j < effect_use->op()->ValueInputCount(); j++) {
CHECK_NE(R.start(), effect_use->InputAt(j));
}
}
}
......@@ -843,8 +843,8 @@ void CheckEqualityReduction(JSTypedLoweringTester* R, bool strict, Node* l,
const Operator* op = strict ? R->javascript.StrictEqual(feedback_source)
: R->javascript.Equal(feedback_source);
Node* eq = R->Binop(op, p0, p1);
Node* r = R->reduce(eq);
R->CheckBinop(expected, r);
Node* reduced = R->reduce(eq);
R->CheckBinop(expected, reduced);
}
}
}
......
......@@ -119,7 +119,6 @@ class LoopFinderTester : HandleAndZoneScope {
}
Node* Return(Node* val, Node* effect, Node* control) {
Node* zero = graph.NewNode(common.Int32Constant(0));
Node* ret = graph.NewNode(common.Return(), zero, val, effect, control);
end->ReplaceInput(0, ret);
return ret;
......
This diff is collapsed.
......@@ -949,10 +949,9 @@ static void Build_Select_With_Call(CallDescriptor* desc,
// Build the actual select.
Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone);
RawMachineAssembler raw(isolate, &graph, desc);
raw.Return(raw.Parameter(which));
inner =
CompileGraph("Select-indirection", desc, &graph, raw.ExportForTest());
RawMachineAssembler r(isolate, &graph, desc);
r.Return(r.Parameter(which));
inner = CompileGraph("Select-indirection", desc, &graph, r.ExportForTest());
CHECK(!inner.is_null());
CHECK(inner->IsCode());
}
......@@ -1044,8 +1043,8 @@ void MixedParamTest(int start) {
Handle<Code> select;
{
// build the select.
Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone);
Zone select_zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&select_zone);
RawMachineAssembler raw(isolate, &graph, desc);
raw.Return(raw.Parameter(which));
select = CompileGraph("Compute", desc, &graph, raw.ExportForTest());
......@@ -1061,12 +1060,13 @@ void MixedParamTest(int start) {
CSignatureOf<int32_t> csig;
{
// Wrap the select code with a callable function that passes constants.
Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone);
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
Zone wrap_zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&wrap_zone);
CallDescriptor* cdesc =
Linkage::GetSimplifiedCDescriptor(&wrap_zone, &csig);
RawMachineAssembler raw(isolate, &graph, cdesc);
Node* target = raw.HeapConstant(select);
Node** inputs = zone.NewArray<Node*>(num_params + 1);
Node** inputs = wrap_zone.NewArray<Node*>(num_params + 1);
int input_count = 0;
inputs[input_count++] = target;
int64_t constant = 0x0102030405060708;
......
......@@ -59,8 +59,8 @@ class TestSloppyEqualityFactory {
TEST(TestSloppyEquality) {
FlagScope<bool> allow_natives_syntax(&i::FLAG_allow_natives_syntax, true);
FlagScope<bool> always_opt(&i::FLAG_always_opt, false);
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
HandleAndZoneScope handle_and_zone_scope;
Isolate* isolate = handle_and_zone_scope.main_isolate();
Zone zone(isolate->allocator(), ZONE_NAME);
TestSloppyEqualityFactory f(&zone);
// TODO(nicohartmann@, v8:5660): Collect more precise feedback for some useful
......
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