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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 11745030: ARM: generate integer zero in a uniform manner. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 12 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/arm/lithium-codegen-arm.cc ('k') | src/arm/regexp-macro-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 614be5e0e70eb5b46b12d64dd0e402ef8441ff42..7802d90a20287c0e2e0b0b066269af79e553bfb2 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -304,7 +304,7 @@ void MacroAssembler::And(Register dst, Register src1, const Operand& src2,
if (!src2.is_reg() &&
!src2.must_output_reloc_info(this) &&
src2.immediate() == 0) {
- mov(dst, Operand(0, RelocInfo::NONE32), LeaveCC, cond);
+ mov(dst, Operand::Zero(), LeaveCC, cond);
} else if (!src2.is_single_instruction(this) &&
!src2.must_output_reloc_info(this) &&
CpuFeatures::IsSupported(ARMv7) &&
@@ -410,7 +410,7 @@ void MacroAssembler::Usat(Register dst, int satpos, const Operand& src,
}
tst(dst, Operand(~satval));
b(eq, &done);
- mov(dst, Operand(0, RelocInfo::NONE32), LeaveCC, mi); // 0 if negative.
+ mov(dst, Operand::Zero(), LeaveCC, mi); // 0 if negative.
mov(dst, Operand(satval), LeaveCC, pl); // satval if positive.
bind(&done);
} else {
@@ -864,7 +864,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) {
// Reserve room for saved entry sp and code object.
sub(sp, sp, Operand(2 * kPointerSize));
if (emit_debug_code()) {
- mov(ip, Operand(0));
+ mov(ip, Operand::Zero());
str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
}
mov(ip, Operand(CodeObject()));
@@ -948,7 +948,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles,
}
// Clear top frame.
- mov(r3, Operand(0, RelocInfo::NONE32));
+ mov(r3, Operand::Zero());
mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate())));
str(r3, MemOperand(ip));
@@ -1218,7 +1218,7 @@ void MacroAssembler::IsObjectJSStringType(Register object,
#ifdef ENABLE_DEBUGGER_SUPPORT
void MacroAssembler::DebugBreak() {
- mov(r0, Operand(0, RelocInfo::NONE32));
+ mov(r0, Operand::Zero());
mov(r1, Operand(ExternalReference(Runtime::kDebugBreak, isolate())));
CEntryStub ces(1);
ASSERT(AllowThisStubCall(&ces));
@@ -1249,7 +1249,7 @@ void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
// Push the frame pointer, context, state, and code object.
if (kind == StackHandler::JS_ENTRY) {
mov(r7, Operand(Smi::FromInt(0))); // Indicates no context.
- mov(ip, Operand(0, RelocInfo::NONE32)); // NULL frame pointer.
+ mov(ip, Operand::Zero()); // NULL frame pointer.
stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | ip.bit());
} else {
stm(db_w, sp, r5.bit() | r6.bit() | cp.bit() | fp.bit());
@@ -1373,7 +1373,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
ldr(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset));
// In debug mode, make sure the lexical context is set.
#ifdef DEBUG
- cmp(scratch, Operand(0, RelocInfo::NONE32));
+ cmp(scratch, Operand::Zero());
Check(ne, "we should not have an empty lexical context");
#endif
@@ -2025,7 +2025,7 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg,
// it's an Infinity, and the non-NaN code path applies.
b(gt, &is_nan);
ldr(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset));
- cmp(mantissa_reg, Operand(0));
+ cmp(mantissa_reg, Operand::Zero());
b(eq, &have_double_value);
bind(&is_nan);
// Load canonical NaN for storing into the double array.
@@ -2277,7 +2277,7 @@ void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function,
// If result is non-zero, dereference to get the result value
// otherwise set it to undefined.
- cmp(r0, Operand(0));
+ cmp(r0, Operand::Zero());
LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
ldr(r0, MemOperand(r0), ne);
@@ -2456,7 +2456,7 @@ void MacroAssembler::ConvertToInt32(Register source,
HeapNumber::kExponentBits);
// Load dest with zero. We use this either for the final shift or
// for the answer.
- mov(dest, Operand(0, RelocInfo::NONE32));
+ mov(dest, Operand::Zero());
// Check whether the exponent matches a 32 bit signed int that is not a Smi.
// A non-Smi integer is 1.xxx * 2^30 so the exponent is 30 (biased). This is
// the exponent that we are fastest at and also the highest exponent we can
@@ -2510,7 +2510,7 @@ void MacroAssembler::ConvertToInt32(Register source,
// Move down according to the exponent.
mov(dest, Operand(scratch, LSR, dest));
// Fix sign if sign bit was set.
- rsb(dest, dest, Operand(0, RelocInfo::NONE32), LeaveCC, ne);
+ rsb(dest, dest, Operand::Zero(), LeaveCC, ne);
bind(&done);
}
}
@@ -2601,7 +2601,7 @@ void MacroAssembler::EmitOutOfInt32RangeTruncate(Register result,
// Check for Infinity and NaNs, which should return 0.
cmp(result, Operand(HeapNumber::kExponentMask));
- mov(result, Operand(0), LeaveCC, eq);
+ mov(result, Operand::Zero(), LeaveCC, eq);
b(eq, &done);
// Express exponent as delta to (number of mantissa bits + 31).
@@ -2613,7 +2613,7 @@ void MacroAssembler::EmitOutOfInt32RangeTruncate(Register result,
// If the delta is strictly positive, all bits would be shifted away,
// which means that we can return 0.
b(le, &normal_exponent);
- mov(result, Operand(0));
+ mov(result, Operand::Zero());
b(&done);
bind(&normal_exponent);
@@ -2641,7 +2641,7 @@ void MacroAssembler::EmitOutOfInt32RangeTruncate(Register result,
b(&pos_shift, ge);
// Negate scratch.
- rsb(scratch, scratch, Operand(0));
+ rsb(scratch, scratch, Operand::Zero());
mov(input_low, Operand(input_low, LSL, scratch));
b(&shift_done);
@@ -2651,10 +2651,10 @@ void MacroAssembler::EmitOutOfInt32RangeTruncate(Register result,
bind(&shift_done);
orr(input_high, input_high, Operand(input_low));
// Restore sign if necessary.
- cmp(sign, Operand(0));
+ cmp(sign, Operand::Zero());
result = sign;
sign = no_reg;
- rsb(result, input_high, Operand(0), LeaveCC, ne);
+ rsb(result, input_high, Operand::Zero(), LeaveCC, ne);
mov(result, input_high, LeaveCC, eq);
bind(&done);
}
@@ -3295,7 +3295,7 @@ void MacroAssembler::CopyBytes(Register src,
// Align src before copying in word size chunks.
bind(&align_loop);
- cmp(length, Operand(0));
+ cmp(length, Operand::Zero());
b(eq, &done);
bind(&align_loop_1);
tst(src, Operand(kPointerSize - 1));
@@ -3330,7 +3330,7 @@ void MacroAssembler::CopyBytes(Register src,
// Copy the last bytes if any left.
bind(&byte_loop);
- cmp(length, Operand(0));
+ cmp(length, Operand::Zero());
b(eq, &done);
bind(&byte_loop_1);
ldrb(scratch, MemOperand(src, 1, PostIndex));
@@ -3368,7 +3368,7 @@ void MacroAssembler::CountLeadingZeros(Register zeros, // Answer.
// Order of the next two lines is important: zeros register
// can be the same as source register.
Move(scratch, source);
- mov(zeros, Operand(0, RelocInfo::NONE32));
+ mov(zeros, Operand::Zero());
// Top 16.
tst(scratch, Operand(0xffff0000));
add(zeros, zeros, Operand(16), LeaveCC, eq);
@@ -3800,7 +3800,7 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg,
b(gt, &above_zero);
// Double value is less than zero, NaN or Inf, return 0.
- mov(result_reg, Operand(0));
+ mov(result_reg, Operand::Zero());
b(al, &done);
// Double value is >= 255, return 255.
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/arm/regexp-macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698