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

Unified Diff: src/compiler/instruction.cc

Issue 1075903002: [turbofan] support small immediates (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/instruction.h ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.cc
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc
index 62bd5b74e951456a0a8ab1d6a4d4e085df51514c..9b051bab7a6add13dd2bbf1acc13db3cfc4886d0 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -44,8 +44,15 @@ std::ostream& operator<<(std::ostream& os,
case InstructionOperand::CONSTANT:
return os << "[constant:" << ConstantOperand::cast(op).virtual_register()
<< "]";
- case InstructionOperand::IMMEDIATE:
- return os << "[immediate:" << ImmediateOperand::cast(op).index() << "]";
+ case InstructionOperand::IMMEDIATE: {
+ auto imm = ImmediateOperand::cast(op);
+ switch (imm.type()) {
+ case ImmediateOperand::INLINE:
+ return os << "#" << imm.inline_value();
+ case ImmediateOperand::INDEXED:
+ return os << "[immediate:" << imm.indexed_value() << "]";
+ }
+ }
case InstructionOperand::ALLOCATED:
switch (AllocatedOperand::cast(op).allocated_kind()) {
case AllocatedOperand::STACK_SLOT:
@@ -606,7 +613,7 @@ RpoNumber InstructionSequence::InputRpo(Instruction* instr, size_t index) {
InstructionOperand* operand = instr->InputAt(index);
Constant constant =
operand->IsImmediate()
- ? GetImmediate(ImmediateOperand::cast(operand)->index())
+ ? GetImmediate(ImmediateOperand::cast(operand))
: GetConstant(ConstantOperand::cast(operand)->virtual_register());
return constant.ToRpoNumber();
}
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698