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

Unified Diff: src/compiler/code-generator-impl.h

Issue 758073002: [turbofan] Use special constant type for RPO block number operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator-impl.h
diff --git a/src/compiler/code-generator-impl.h b/src/compiler/code-generator-impl.h
index 0dc919ad6b30d87742eadf1f2cb05b6498f84b02..914e1e8c91ded126a042422e611c8bdd0b88b546 100644
--- a/src/compiler/code-generator-impl.h
+++ b/src/compiler/code-generator-impl.h
@@ -25,6 +25,8 @@ class InstructionOperandConverter {
InstructionOperandConverter(CodeGenerator* gen, Instruction* instr)
: gen_(gen), instr_(instr) {}
+ // -- Instruction operand accesses with conversions --------------------------
+
Register InputRegister(int index) {
return ToRegister(instr_->InputAt(index));
}
@@ -57,22 +59,31 @@ class InstructionOperandConverter {
return ToHeapObject(instr_->InputAt(index));
}
- Label* InputLabel(int index) { return gen_->GetLabel(InputRpo(index)); }
+ Label* InputLabel(int index) { return ToLabel(instr_->InputAt(index)); }
BasicBlock::RpoNumber InputRpo(int index) {
- int rpo_number = InputInt32(index);
- return BasicBlock::RpoNumber::FromInt(rpo_number);
+ return ToRpoNumber(instr_->InputAt(index));
}
Register OutputRegister(int index = 0) {
return ToRegister(instr_->OutputAt(index));
}
+ Register TempRegister(int index) { return ToRegister(instr_->TempAt(index)); }
+
DoubleRegister OutputDoubleRegister() {
return ToDoubleRegister(instr_->Output());
}
- Register TempRegister(int index) { return ToRegister(instr_->TempAt(index)); }
+ // -- Conversions for operands -----------------------------------------------
+
+ Label* ToLabel(InstructionOperand* op) {
+ return gen_->GetLabel(ToRpoNumber(op));
+ }
+
+ BasicBlock::RpoNumber ToRpoNumber(InstructionOperand* op) {
+ return ToConstant(op).ToRpoNumber();
+ }
Register ToRegister(InstructionOperand* op) {
DCHECK(op->IsRegister());
@@ -84,19 +95,17 @@ class InstructionOperandConverter {
return DoubleRegister::FromAllocationIndex(op->index());
}
- Constant ToConstant(InstructionOperand* operand) {
- if (operand->IsImmediate()) {
- return gen_->code()->GetImmediate(operand->index());
+ Constant ToConstant(InstructionOperand* op) {
+ if (op->IsImmediate()) {
+ return gen_->code()->GetImmediate(op->index());
}
- return gen_->code()->GetConstant(operand->index());
+ return gen_->code()->GetConstant(op->index());
}
- double ToDouble(InstructionOperand* operand) {
- return ToConstant(operand).ToFloat64();
- }
+ double ToDouble(InstructionOperand* op) { return ToConstant(op).ToFloat64(); }
- Handle<HeapObject> ToHeapObject(InstructionOperand* operand) {
- return ToConstant(operand).ToHeapObject();
+ Handle<HeapObject> ToHeapObject(InstructionOperand* op) {
+ return ToConstant(op).ToHeapObject();
}
Frame* frame() const { return gen_->frame(); }
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698