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

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

Issue 1242303005: [turbofan]: Elide extra move when accessing stack or frame register (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: src/compiler/code-generator.cc Created 5 years, 5 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/arm/code-generator-arm.cc ('k') | src/compiler/code-generator-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm64/code-generator-arm64.cc
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
index c3e9af6a29e7e6be9931bf1872eebdd96290aa75..d26531f579eb5dd3e6bae8363a7655208ee9ac9a 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -144,14 +144,14 @@ class Arm64OperandConverter final : public InstructionOperandConverter {
}
Operand ToOperand(InstructionOperand* op) {
- if (op->IsRegister()) {
+ if (op->GeneratesRegister()) {
return Operand(ToRegister(op));
}
return ToImmediate(op);
}
Operand ToOperand32(InstructionOperand* op) {
- if (op->IsRegister()) {
+ if (op->GeneratesRegister()) {
return Operand(ToRegister(op).W());
}
return ToImmediate(op);
@@ -184,7 +184,7 @@ class Arm64OperandConverter final : public InstructionOperandConverter {
MemOperand ToMemOperand(InstructionOperand* op, MacroAssembler* masm) const {
DCHECK(op != NULL);
- DCHECK(!op->IsRegister());
+ DCHECK(!op->GeneratesRegister());
DCHECK(!op->IsDoubleRegister());
DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
// The linkage computes where all spill slots are located.
@@ -333,7 +333,7 @@ Condition FlagsConditionToCondition(FlagsCondition condition) {
#define ASSEMBLE_SHIFT(asm_instr, width) \
do { \
- if (instr->InputAt(1)->IsRegister()) { \
+ if (instr->InputAt(1)->GeneratesRegister()) { \
__ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0), \
i.InputRegister##width(1)); \
} else { \
@@ -1199,18 +1199,18 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
Arm64OperandConverter g(this, NULL);
// Dispatch on the source and destination operand kinds. Not all
// combinations are possible.
- if (source->IsRegister()) {
- DCHECK(destination->IsRegister() || destination->IsStackSlot());
+ if (source->GeneratesRegister()) {
+ DCHECK(destination->GeneratesRegister() || destination->IsStackSlot());
Register src = g.ToRegister(source);
- if (destination->IsRegister()) {
+ if (destination->GeneratesRegister()) {
__ Mov(g.ToRegister(destination), src);
} else {
__ Str(src, g.ToMemOperand(destination, masm()));
}
} else if (source->IsStackSlot()) {
MemOperand src = g.ToMemOperand(source, masm());
- DCHECK(destination->IsRegister() || destination->IsStackSlot());
- if (destination->IsRegister()) {
+ DCHECK(destination->GeneratesRegister() || destination->IsStackSlot());
+ if (destination->GeneratesRegister()) {
__ Ldr(g.ToRegister(destination), src);
} else {
UseScratchRegisterScope scope(masm());
@@ -1220,10 +1220,11 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
}
} else if (source->IsConstant()) {
Constant src = g.ToConstant(ConstantOperand::cast(source));
- if (destination->IsRegister() || destination->IsStackSlot()) {
+ if (destination->GeneratesRegister() || destination->IsStackSlot()) {
UseScratchRegisterScope scope(masm());
- Register dst = destination->IsRegister() ? g.ToRegister(destination)
- : scope.AcquireX();
+ Register dst = destination->GeneratesRegister()
+ ? g.ToRegister(destination)
+ : scope.AcquireX();
if (src.type() == Constant::kHeapObject) {
Handle<HeapObject> src_object = src.ToHeapObject();
Heap::RootListIndex index;
@@ -1296,12 +1297,12 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
Arm64OperandConverter g(this, NULL);
// Dispatch on the source and destination operand kinds. Not all
// combinations are possible.
- if (source->IsRegister()) {
+ if (source->GeneratesRegister()) {
// Register-register.
UseScratchRegisterScope scope(masm());
Register temp = scope.AcquireX();
Register src = g.ToRegister(source);
- if (destination->IsRegister()) {
+ if (destination->GeneratesRegister()) {
Register dst = g.ToRegister(destination);
__ Mov(temp, src);
__ Mov(src, dst);
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/compiler/code-generator-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698