Commit 2bd1ee96 authored by ulan's avatar ulan Committed by Commit bot

[ignition] Fix more -Wsign-compare warnings.

BUG=v8:5614

Review-Url: https://codereview.chromium.org/2493183002
Cr-Commit-Position: refs/heads/master@{#40918}
parent b32ee40d
......@@ -273,7 +273,7 @@ void BytecodeArrayWriter::PatchJump(size_t jump_target, size_t jump_location) {
void BytecodeArrayWriter::EmitJump(BytecodeNode* node, BytecodeLabel* label) {
DCHECK(Bytecodes::IsJump(node->bytecode()));
DCHECK_EQ(0, node->operand(0));
DCHECK_EQ(0u, node->operand(0));
size_t current_offset = bytecodes()->size();
......
......@@ -229,7 +229,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
CHECK_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
CHECK_EQ(iterator.GetRegisterOperand(1).index(), param.index());
CHECK_EQ(iterator.GetRegisterOperandRange(1), 1);
CHECK_EQ(iterator.GetRegisterCountOperand(2), 1);
CHECK_EQ(iterator.GetRegisterCountOperand(2), 1u);
CHECK_EQ(iterator.GetRegisterOperand(3).index(), reg_0.index());
CHECK_EQ(iterator.GetRegisterOperandRange(3), 2);
CHECK(!iterator.done());
......@@ -253,7 +253,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
CHECK_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
CHECK_EQ(iterator.GetRegisterCountOperand(2), 1);
CHECK_EQ(iterator.GetRegisterCountOperand(2), 1u);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
iterator.Advance();
......@@ -269,7 +269,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
CHECK_EQ(iterator.current_offset(), offset);
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
CHECK_EQ(iterator.current_bytecode_size(), 6);
CHECK_EQ(iterator.GetIndexOperand(0), 0x10000000);
CHECK_EQ(iterator.GetIndexOperand(0), 0x10000000u);
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) +
kPrefixByteSize;
iterator.Advance();
......
......@@ -104,19 +104,19 @@ void BytecodeArrayWriterUnittest::WriteJumpLoop(Bytecode bytecode,
}
TEST_F(BytecodeArrayWriterUnittest, SimpleExample) {
CHECK_EQ(bytecodes()->size(), 0);
CHECK_EQ(bytecodes()->size(), 0u);
Write(Bytecode::kStackCheck, {10, false});
CHECK_EQ(bytecodes()->size(), 1);
CHECK_EQ(bytecodes()->size(), 1u);
Write(Bytecode::kLdaSmi, 127, {55, true});
CHECK_EQ(bytecodes()->size(), 3);
CHECK_EQ(bytecodes()->size(), 3u);
Write(Bytecode::kLdar, Register(200).ToOperand());
CHECK_EQ(bytecodes()->size(), 7);
CHECK_EQ(bytecodes()->size(), 7u);
Write(Bytecode::kReturn, {70, true});
CHECK_EQ(bytecodes()->size(), 8);
CHECK_EQ(bytecodes()->size(), 8u);
static const uint8_t bytes[] = {B(StackCheck), B(LdaSmi), U8(127), B(Wide),
B(Ldar), R16(200), B(Return)};
......
......@@ -396,7 +396,7 @@ TEST_F(BytecodePeepholeOptimizerTest, MergeLdaZeroWithBinaryOp) {
CHECK_EQ(write_count(), 1);
CHECK_EQ(last_written().bytecode(), operator_replacement[1]);
CHECK_EQ(last_written().operand_count(), 3);
CHECK_EQ(last_written().operand(0), 0);
CHECK_EQ(last_written().operand(0), 0u);
CHECK_EQ(last_written().operand(1), reg_operand);
CHECK_EQ(last_written().operand(2), idx_operand);
Reset();
......
......@@ -159,7 +159,7 @@ TEST_F(BytecodeNodeTest, SetBytecode1) {
clone.set_bytecode(Bytecode::kJump, 0x01aabbcc);
CHECK_EQ(clone.bytecode(), Bytecode::kJump);
CHECK_EQ(clone.operand_count(), 1);
CHECK_EQ(clone.operand(0), 0x01aabbcc);
CHECK_EQ(clone.operand(0), 0x01aabbccu);
CHECK_EQ(clone.source_info(), source_info);
}
......
......@@ -66,9 +66,9 @@ TEST_F(BytecodeRegisterOptimizerTest, TemporaryMaterializedForFlush) {
Initialize(1, 1);
Register temp = NewTemporary();
optimizer()->DoStar(temp, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
optimizer()->Flush();
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kStar);
CHECK_EQ(output()->at(0).operand(0), static_cast<uint32_t>(temp.ToOperand()));
}
......@@ -77,9 +77,9 @@ TEST_F(BytecodeRegisterOptimizerTest, TemporaryMaterializedForJump) {
Initialize(1, 1);
Register temp = NewTemporary();
optimizer()->DoStar(temp, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
optimizer()->PrepareForBytecode(Bytecode::kJump);
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kStar);
CHECK_EQ(output()->at(0).operand(0), static_cast<uint32_t>(temp.ToOperand()));
}
......@@ -90,12 +90,12 @@ TEST_F(BytecodeRegisterOptimizerTest, TemporaryNotEmitted) {
Initialize(3, 1);
Register parameter = Register::FromParameterIndex(1, 3);
optimizer()->DoLdar(parameter, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
Register temp = NewTemporary();
optimizer()->DoStar(temp, BytecodeSourceInfo());
BytecodeNode node1(Bytecode::kStar, NewTemporary().ToOperand());
ReleaseTemporaries(temp);
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
optimizer()->PrepareForBytecode(Bytecode::kReturn);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kLdar);
CHECK_EQ(output()->at(0).operand(0),
......@@ -108,20 +108,20 @@ TEST_F(BytecodeRegisterOptimizerTest, ReleasedRegisterUsed) {
Register temp0 = NewTemporary();
Register temp1 = NewTemporary();
optimizer()->DoStar(temp1, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
optimizer()->PrepareForBytecode(Bytecode::kLdaSmi);
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kStar);
CHECK_EQ(output()->at(0).operand(0),
static_cast<uint32_t>(temp1.ToOperand()));
optimizer()->DoMov(temp1, temp0, BytecodeSourceInfo());
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
ReleaseTemporaries(temp1);
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
optimizer()->DoLdar(temp0, BytecodeSourceInfo());
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
optimizer()->PrepareForBytecode(Bytecode::kReturn);
CHECK_EQ(write_count(), 2);
CHECK_EQ(write_count(), 2u);
CHECK_EQ(output()->at(1).bytecode(), Bytecode::kLdar);
CHECK_EQ(output()->at(1).operand(0),
static_cast<uint32_t>(temp1.ToOperand()));
......@@ -133,12 +133,12 @@ TEST_F(BytecodeRegisterOptimizerTest, ReleasedRegisterNotFlushed) {
Register temp0 = NewTemporary();
Register temp1 = NewTemporary();
optimizer()->DoStar(temp0, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
optimizer()->DoStar(temp1, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
ReleaseTemporaries(temp1);
optimizer()->Flush();
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kStar);
CHECK_EQ(output()->at(0).operand(0),
static_cast<uint32_t>(temp0.ToOperand()));
......@@ -148,10 +148,10 @@ TEST_F(BytecodeRegisterOptimizerTest, StoresToLocalsImmediate) {
Initialize(3, 1);
Register parameter = Register::FromParameterIndex(1, 3);
optimizer()->DoLdar(parameter, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
Register local = Register(0);
optimizer()->DoStar(local, BytecodeSourceInfo());
CHECK_EQ(write_count(), 1);
CHECK_EQ(write_count(), 1u);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kMov);
CHECK_EQ(output()->at(0).operand(0),
static_cast<uint32_t>(parameter.ToOperand()));
......@@ -159,7 +159,7 @@ TEST_F(BytecodeRegisterOptimizerTest, StoresToLocalsImmediate) {
static_cast<uint32_t>(local.ToOperand()));
optimizer()->PrepareForBytecode(Bytecode::kReturn);
CHECK_EQ(write_count(), 2);
CHECK_EQ(write_count(), 2u);
CHECK_EQ(output()->at(1).bytecode(), Bytecode::kLdar);
CHECK_EQ(output()->at(1).operand(0),
static_cast<uint32_t>(local.ToOperand()));
......@@ -172,12 +172,12 @@ TEST_F(BytecodeRegisterOptimizerTest, SingleTemporaryNotMaterializedForInput) {
Register temp1 = NewTemporary();
optimizer()->DoMov(parameter, temp0, BytecodeSourceInfo());
optimizer()->DoMov(parameter, temp1, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
Register reg = optimizer()->GetInputRegister(temp0);
RegisterList reg_list =
optimizer()->GetInputRegisterList(RegisterList(temp0.index(), 1));
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
CHECK_EQ(parameter.index(), reg.index());
CHECK_EQ(parameter.index(), reg_list.first_register().index());
CHECK_EQ(1, reg_list.register_count());
......@@ -191,14 +191,14 @@ TEST_F(BytecodeRegisterOptimizerTest, RangeOfTemporariesMaterializedForInput) {
optimizer()->PrepareForBytecode(Bytecode::kLdaSmi);
optimizer()->DoStar(temp0, BytecodeSourceInfo());
optimizer()->DoMov(parameter, temp1, BytecodeSourceInfo());
CHECK_EQ(write_count(), 0);
CHECK_EQ(write_count(), 0u);
optimizer()->PrepareForBytecode(Bytecode::kCallJSRuntime);
RegisterList reg_list =
optimizer()->GetInputRegisterList(RegisterList(temp0.index(), 2));
CHECK_EQ(temp0.index(), reg_list.first_register().index());
CHECK_EQ(2, reg_list.register_count());
CHECK_EQ(write_count(), 2);
CHECK_EQ(write_count(), 2u);
CHECK_EQ(output()->at(0).bytecode(), Bytecode::kStar);
CHECK_EQ(output()->at(0).operand(0),
static_cast<uint32_t>(temp0.ToOperand()));
......
......@@ -50,7 +50,7 @@ TEST_F(ConstantArrayBuilderTest, ToFixedArray) {
CHECK(builder.At(i)->SameValue(*object));
}
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(), kNumberOfElements);
CHECK_EQ(constant_array->length(), static_cast<int>(kNumberOfElements));
for (size_t i = 0; i < kNumberOfElements; i++) {
CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i)));
}
......@@ -66,7 +66,7 @@ TEST_F(ConstantArrayBuilderTest, ToLargeFixedArray) {
CHECK(builder.At(i)->SameValue(*object));
}
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(), kNumberOfElements);
CHECK_EQ(constant_array->length(), static_cast<int>(kNumberOfElements));
for (size_t i = 0; i < kNumberOfElements; i++) {
CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i)));
}
......@@ -81,7 +81,7 @@ TEST_F(ConstantArrayBuilderTest, ToLargeFixedArrayWithReservations) {
Smi::FromInt(static_cast<int>(i)));
}
Handle<FixedArray> constant_array = builder.ToFixedArray(isolate());
CHECK_EQ(constant_array->length(), kNumberOfElements);
CHECK_EQ(constant_array->length(), static_cast<int>(kNumberOfElements));
for (size_t i = 0; i < kNumberOfElements; i++) {
CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i)));
}
......
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