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

Unified Diff: src/a64/macro-assembler-a64-inl.h

Issue 164793003: A64: Use a scope utility to allocate scratch registers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. Created 6 years, 9 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/a64/macro-assembler-a64.cc ('k') | src/a64/stub-cache-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/macro-assembler-a64-inl.h
diff --git a/src/a64/macro-assembler-a64-inl.h b/src/a64/macro-assembler-a64-inl.h
index 98a14b75e92f0e5319009537d0004c48cd0e02d8..09efcc38b7ded2eaab72da37b8f4de9d5f136e4c 100644
--- a/src/a64/macro-assembler-a64-inl.h
+++ b/src/a64/macro-assembler-a64-inl.h
@@ -588,7 +588,8 @@ void MacroAssembler::Fcmp(const FPRegister& fn, const FPRegister& fm) {
void MacroAssembler::Fcmp(const FPRegister& fn, double value) {
ASSERT(allow_macro_instructions_);
if (value != 0.0) {
- FPRegister tmp = AppropriateTempFor(fn);
+ UseScratchRegisterScope temps(this);
+ FPRegister tmp = temps.AcquireSameSizeAs(fn);
Fmov(tmp, value);
fcmp(fn, tmp);
} else {
@@ -742,16 +743,19 @@ void MacroAssembler::Fmov(FPRegister fd, double imm) {
// These cases can be handled by the Assembler.
fmov(fd, imm);
} else {
+ UseScratchRegisterScope temps(this);
// TODO(all): The Assembler would try to relocate the immediate with
// Assembler::ldr(const FPRegister& ft, double imm) but it is not
// implemented yet.
if (fd.SizeInBits() == kDRegSize) {
- Mov(Tmp0(), double_to_rawbits(imm));
- Fmov(fd, Tmp0());
+ Register tmp = temps.AcquireX();
+ Mov(tmp, double_to_rawbits(imm));
+ Fmov(fd, tmp);
} else {
ASSERT(fd.SizeInBits() == kSRegSize);
- Mov(WTmp0(), float_to_rawbits(static_cast<float>(imm)));
- Fmov(fd, WTmp0());
+ Register tmp = temps.AcquireW();
+ Mov(tmp, float_to_rawbits(static_cast<float>(imm)));
+ Fmov(fd, tmp);
}
}
}
@@ -1351,9 +1355,11 @@ void MacroAssembler::JumpIfBothSmi(Register value1,
Label* both_smi_label,
Label* not_smi_label) {
STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
+ UseScratchRegisterScope temps(this);
+ Register tmp = temps.AcquireX();
// Check if both tag bits are clear.
- Orr(Tmp0(), value1, value2);
- JumpIfSmi(Tmp0(), both_smi_label, not_smi_label);
+ Orr(tmp, value1, value2);
+ JumpIfSmi(tmp, both_smi_label, not_smi_label);
}
@@ -1362,9 +1368,11 @@ void MacroAssembler::JumpIfEitherSmi(Register value1,
Label* either_smi_label,
Label* not_smi_label) {
STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
+ UseScratchRegisterScope temps(this);
+ Register tmp = temps.AcquireX();
// Check if either tag bit is clear.
- And(Tmp0(), value1, value2);
- JumpIfSmi(Tmp0(), either_smi_label, not_smi_label);
+ And(tmp, value1, value2);
+ JumpIfSmi(tmp, either_smi_label, not_smi_label);
}
@@ -1437,8 +1445,10 @@ void MacroAssembler::IsObjectJSStringType(Register object,
void MacroAssembler::Push(Handle<Object> handle) {
- Mov(Tmp0(), Operand(handle));
- Push(Tmp0());
+ UseScratchRegisterScope temps(this);
+ Register tmp = temps.AcquireX();
+ Mov(tmp, Operand(handle));
+ Push(tmp);
}
« no previous file with comments | « src/a64/macro-assembler-a64.cc ('k') | src/a64/stub-cache-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698