Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 946553002: [turbofan] Fix several int vs size_t issues. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fix Win64. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index aae5aceefbc80627d3c8d42166cfab9b6f5dadd1..f05dc2e96442d4ff1a8a3b9dcd0b23b4ae5081c2 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -24,11 +24,13 @@ class X64OperandConverter : public InstructionOperandConverter {
X64OperandConverter(CodeGenerator* gen, Instruction* instr)
: InstructionOperandConverter(gen, instr) {}
- Immediate InputImmediate(int index) {
+ Immediate InputImmediate(size_t index) {
return ToImmediate(instr_->InputAt(index));
}
- Operand InputOperand(int index) { return ToOperand(instr_->InputAt(index)); }
+ Operand InputOperand(size_t index) {
+ return ToOperand(instr_->InputAt(index));
+ }
Operand OutputOperand() { return ToOperand(instr_->Output()); }
@@ -43,8 +45,8 @@ class X64OperandConverter : public InstructionOperandConverter {
return Operand(offset.from_stack_pointer() ? rsp : rbp, offset.offset());
}
- static int NextOffset(int* offset) {
- int i = *offset;
+ static size_t NextOffset(size_t* offset) {
+ size_t i = *offset;
(*offset)++;
return i;
}
@@ -59,7 +61,7 @@ class X64OperandConverter : public InstructionOperandConverter {
return static_cast<ScaleFactor>(scale);
}
- Operand MemoryOperand(int* offset) {
+ Operand MemoryOperand(size_t* offset) {
AddressingMode mode = AddressingModeField::decode(instr_->opcode());
switch (mode) {
case kMode_MR: {
@@ -124,7 +126,7 @@ class X64OperandConverter : public InstructionOperandConverter {
return Operand(no_reg, 0);
}
- Operand MemoryOperand(int first_input = 0) {
+ Operand MemoryOperand(size_t first_input = 0) {
return MemoryOperand(&first_input);
}
};
@@ -132,7 +134,7 @@ class X64OperandConverter : public InstructionOperandConverter {
namespace {
-bool HasImmediateInput(Instruction* instr, int index) {
+bool HasImmediateInput(Instruction* instr, size_t index) {
return instr->InputAt(index)->IsImmediate();
}
@@ -821,7 +823,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ AssertZeroExtended(i.OutputRegister());
break;
case kX64Movb: {
- int index = 0;
+ size_t index = 0;
Operand operand = i.MemoryOperand(&index);
if (HasImmediateInput(instr, index)) {
__ movb(operand, Immediate(i.InputInt8(index)));
@@ -839,7 +841,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ AssertZeroExtended(i.OutputRegister());
break;
case kX64Movw: {
- int index = 0;
+ size_t index = 0;
Operand operand = i.MemoryOperand(&index);
if (HasImmediateInput(instr, index)) {
__ movw(operand, Immediate(i.InputInt16(index)));
@@ -861,7 +863,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
}
__ AssertZeroExtended(i.OutputRegister());
} else {
- int index = 0;
+ size_t index = 0;
Operand operand = i.MemoryOperand(&index);
if (HasImmediateInput(instr, index)) {
__ movl(operand, i.InputImmediate(index));
@@ -877,7 +879,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
if (instr->HasOutput()) {
__ movq(i.OutputRegister(), i.MemoryOperand());
} else {
- int index = 0;
+ size_t index = 0;
Operand operand = i.MemoryOperand(&index);
if (HasImmediateInput(instr, index)) {
__ movq(operand, i.InputImmediate(index));
@@ -890,7 +892,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
if (instr->HasOutput()) {
__ movss(i.OutputDoubleRegister(), i.MemoryOperand());
} else {
- int index = 0;
+ size_t index = 0;
Operand operand = i.MemoryOperand(&index);
__ movss(operand, i.InputDoubleRegister(index));
}
@@ -899,7 +901,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
if (instr->HasOutput()) {
__ movsd(i.OutputDoubleRegister(), i.MemoryOperand());
} else {
- int index = 0;
+ size_t index = 0;
Operand operand = i.MemoryOperand(&index);
__ movsd(operand, i.InputDoubleRegister(index));
}
@@ -1078,8 +1080,8 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
// Materialize a full 64-bit 1 or 0 value. The result register is always the
// last output of the instruction.
Label check;
- DCHECK_NE(0, static_cast<int>(instr->OutputCount()));
- Register reg = i.OutputRegister(static_cast<int>(instr->OutputCount() - 1));
+ DCHECK_NE(0u, instr->OutputCount());
+ Register reg = i.OutputRegister(instr->OutputCount() - 1);
Condition cc = no_condition;
switch (condition) {
case kUnorderedEqual:
@@ -1140,8 +1142,8 @@ void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
X64OperandConverter i(this, instr);
Register input = i.InputRegister(0);
for (size_t index = 2; index < instr->InputCount(); index += 2) {
- __ cmpl(input, Immediate(i.InputInt32(static_cast<int>(index + 0))));
- __ j(equal, GetLabel(i.InputRpo(static_cast<int>(index + 1))));
+ __ cmpl(input, Immediate(i.InputInt32(index + 0)));
+ __ j(equal, GetLabel(i.InputRpo(index + 1)));
}
AssembleArchJump(i.InputRpo(1));
}
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698