Revision: 8998
Author: [email protected]
Date: Tue Aug 23 05:00:09 2011
Log: Fix ARM build for gcc-4.6.
This is based on Peter Varga's work in
http://codereview.chromium.org/7708004/
but with a different solution for the Operand(0) int/pointer ambiguity.
Review URL: http://codereview.chromium.org/7706030
http://code.google.com/p/v8/source/detail?r=8998
Modified:
/branches/bleeding_edge/src/arm/assembler-arm.h
/branches/bleeding_edge/src/arm/code-stubs-arm.cc
/branches/bleeding_edge/src/arm/full-codegen-arm.cc
/branches/bleeding_edge/src/arm/lithium-arm.cc
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/arm/lithium-gap-resolver-arm.cc
/branches/bleeding_edge/src/arm/stub-cache-arm.cc
=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm.h Mon Jul 18 03:44:13 2011
+++ /branches/bleeding_edge/src/arm/assembler-arm.h Tue Aug 23 05:00:09 2011
@@ -377,6 +377,9 @@
// immediate
INLINE(explicit Operand(int32_t immediate,
RelocInfo::Mode rmode = RelocInfo::NONE));
+ INLINE(static Operand Zero()) {
+ return Operand(static_cast<int32_t>(0));
+ }
INLINE(explicit Operand(const ExternalReference& f));
explicit Operand(Handle<Object> handle);
INLINE(explicit Operand(Smi* value));
=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Aug 16 02:58:34
2011
+++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Aug 23 05:00:09
2011
@@ -549,7 +549,7 @@
// | s | exp | mantissa |
// Check for zero.
- __ cmp(int_scratch, Operand(0));
+ __ cmp(int_scratch, Operand::Zero());
__ mov(dst2, int_scratch);
__ mov(dst1, int_scratch);
__ b(eq, &done);
@@ -557,7 +557,7 @@
// Preload the sign of the value.
__ and_(dst2, int_scratch, Operand(HeapNumber::kSignMask), SetCC);
// Get the absolute value of the object (as an unsigned integer).
- __ rsb(int_scratch, int_scratch, Operand(0), SetCC, mi);
+ __ rsb(int_scratch, int_scratch, Operand::Zero(), SetCC, mi);
// Get mantisssa[51:20].
@@ -589,7 +589,7 @@
__ mov(scratch2, Operand(int_scratch, LSL, scratch2));
__ orr(dst2, dst2, scratch2);
// Set dst1 to 0.
- __ mov(dst1, Operand(0));
+ __ mov(dst1, Operand::Zero());
}
__ bind(&done);
}
@@ -657,7 +657,7 @@
// Check for 0 and -0.
__ bic(scratch1, dst1, Operand(HeapNumber::kSignMask));
__ orr(scratch1, scratch1, Operand(dst2));
- __ cmp(scratch1, Operand(0));
+ __ cmp(scratch1, Operand::Zero());
__ b(eq, &done);
// Check that the value can be exactly represented by a 32-bit integer.
@@ -730,7 +730,7 @@
// Check for 0 and -0.
__ bic(dst, scratch1, Operand(HeapNumber::kSignMask));
__ orr(dst, scratch2, Operand(dst));
- __ cmp(dst, Operand(0));
+ __ cmp(dst, Operand::Zero());
__ b(eq, &done);
DoubleIs32BitInteger(masm, scratch1, scratch2, dst, scratch3,
not_int32);
@@ -747,7 +747,7 @@
// Set the sign.
__ ldr(scratch1, FieldMemOperand(object, HeapNumber::kExponentOffset));
__ tst(scratch1, Operand(HeapNumber::kSignMask));
- __ rsb(dst, dst, Operand(0), LeaveCC, mi);
+ __ rsb(dst, dst, Operand::Zero(), LeaveCC, mi);
}
__ bind(&done);
@@ -2424,7 +2424,6 @@
Register left = r1;
Register right = r0;
Register scratch1 = r7;
- Register scratch2 = r9;
// Perform combined smi check on both operands.
__ orr(scratch1, left, Operand(right));
@@ -2618,7 +2617,7 @@
__ b(mi, &return_heap_number);
// Check for minus zero. Return heap number for minus zero.
Label not_zero;
- __ cmp(scratch1, Operand(0));
+ __ cmp(scratch1, Operand::Zero());
__ b(ne, ¬_zero);
__ vmov(scratch2, d5.high());
__ tst(scratch2, Operand(HeapNumber::kSignMask));
@@ -3110,7 +3109,6 @@
Label no_update;
Label skip_cache;
- const Register heap_number_map = r5;
// Call C function to calculate the result and update the cache.
// Register r0 holds precalculated cache entry address; preserve
@@ -3581,7 +3579,7 @@
ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, isolate);
__ mov(r5, Operand(ExternalReference(js_entry_sp)));
__ ldr(r6, MemOperand(r5));
- __ cmp(r6, Operand(0));
+ __ cmp(r6, Operand::Zero());
__ b(ne, &non_outermost_js);
__ str(fp, MemOperand(r5));
__ mov(ip, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
@@ -3656,7 +3654,7 @@
__ pop(r5);
__ cmp(r5, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
__ b(ne, &non_outermost_js_2);
- __ mov(r6, Operand(0));
+ __ mov(r6, Operand::Zero());
__ mov(r5, Operand(ExternalReference(js_entry_sp)));
__ str(r6, MemOperand(r5));
__ bind(&non_outermost_js_2);
@@ -3857,7 +3855,7 @@
__ Push(r0, r1);
__ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION);
__ LeaveInternalFrame();
- __ cmp(r0, Operand(0));
+ __ cmp(r0, Operand::Zero());
__ LoadRoot(r0, Heap::kTrueValueRootIndex, eq);
__ LoadRoot(r0, Heap::kFalseValueRootIndex, ne);
__ Ret(HasArgsInRegisters() ? 0 : 2);
@@ -3991,7 +3989,7 @@
FixedArray::kHeaderSize + 2 * kPointerSize;
// If there are no mapped parameters, we do not need the parameter_map.
__ cmp(r1, Operand(Smi::FromInt(0)));
- __ mov(r9, Operand(0), LeaveCC, eq);
+ __ mov(r9, Operand::Zero(), LeaveCC, eq);
__ mov(r9, Operand(r1, LSL, 1), LeaveCC, ne);
__ add(r9, r9, Operand(kParameterMapHeaderSize), LeaveCC, ne);
@@ -4015,7 +4013,7 @@
__ ldr(r4, MemOperand(r8, Context::SlotOffset(Context::GLOBAL_INDEX)));
__ ldr(r4, FieldMemOperand(r4, GlobalObject::kGlobalContextOffset));
- __ cmp(r1, Operand(0));
+ __ cmp(r1, Operand::Zero());
__ ldr(r4, MemOperand(r4, kNormalOffset), eq);
__ ldr(r4, MemOperand(r4, kAliasedOffset), ne);
@@ -5697,7 +5695,7 @@
Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
__ add(left, left, Operand(scratch1));
__ add(right, right, Operand(scratch1));
- __ rsb(length, length, Operand(0));
+ __ rsb(length, length, Operand::Zero());
Register index = length; // index = -length;
// Compare loop.
@@ -6555,7 +6553,7 @@
// treated as a lookup success. For positive lookup probing failure
// should be treated as lookup failure.
if (mode_ == POSITIVE_LOOKUP) {
- __ mov(result, Operand(0));
+ __ mov(result, Operand::Zero());
__ Ret();
}
@@ -6564,7 +6562,7 @@
__ Ret();
__ bind(¬_in_dictionary);
- __ mov(result, Operand(0));
+ __ mov(result, Operand::Zero());
__ Ret();
}
=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Fri Aug 19 02:54:08
2011
+++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue Aug 23 05:00:09
2011
@@ -4129,11 +4129,8 @@
default: {
VisitForAccumulatorValue(expr->right());
Condition cond = eq;
- bool strict = false;
switch (op) {
case Token::EQ_STRICT:
- strict = true;
- // Fall through
case Token::EQ:
cond = eq;
__ pop(r1);
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Thu Aug 11 07:00:16 2011
+++ /branches/bleeding_edge/src/arm/lithium-arm.cc Tue Aug 23 05:00:09 2011
@@ -1399,7 +1399,6 @@
LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
Token::Value op = instr->token();
- Representation r = instr->GetInputRepresentation();
ASSERT(instr->left()->representation().IsTagged());
ASSERT(instr->right()->representation().IsTagged());
bool reversed = (op == Token::GT || op == Token::LTE);
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Thu Aug 11
07:00:16 2011
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Tue Aug 23
05:00:09 2011
@@ -1804,7 +1804,6 @@
void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
Register reg = ToRegister(instr->InputAt(0));
Register temp1 = ToRegister(instr->TempAt(0));
- Register temp2 = scratch0();
int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id());
@@ -2759,7 +2758,6 @@
void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
- Register context = ToRegister(instr->context());
Register result = ToRegister(instr->result());
__ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX));
}
@@ -3965,7 +3963,6 @@
Register scratch1 = scratch0();
Register scratch2 = ToRegister(instr->TempAt(0));
DwVfpRegister double_input = ToDoubleRegister(instr->InputAt(0));
- DwVfpRegister double_scratch = double_scratch0();
SwVfpRegister single_scratch = double_scratch0().low();
Label done;
=======================================
--- /branches/bleeding_edge/src/arm/lithium-gap-resolver-arm.cc Fri Mar 18
13:35:07 2011
+++ /branches/bleeding_edge/src/arm/lithium-gap-resolver-arm.cc Tue Aug 23
05:00:09 2011
@@ -254,7 +254,6 @@
} else {
ASSERT(destination->IsStackSlot());
ASSERT(!in_cycle_); // Constant moves happen after all cycles are
gone.
- MemOperand destination_operand = cgen_->ToMemOperand(destination);
__ mov(kSavedValueRegister, source_operand);
__ str(kSavedValueRegister, cgen_->ToMemOperand(destination));
}
@@ -265,8 +264,7 @@
__ vmov(cgen_->ToDoubleRegister(destination), source_register);
} else {
ASSERT(destination->IsDoubleStackSlot());
- MemOperand destination_operand = cgen_->ToMemOperand(destination);
- __ vstr(source_register, destination_operand);
+ __ vstr(source_register, cgen_->ToMemOperand(destination));
}
} else if (source->IsDoubleStackSlot()) {
=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Thu Aug 11 07:00:16
2011
+++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Tue Aug 23 05:00:09
2011
@@ -1183,9 +1183,8 @@
__ JumpIfSmi(receiver, miss);
// Check that the maps haven't changed.
- Register reg =
- CheckPrototypes(object, receiver, holder,
- scratch1, scratch2, scratch3, name, miss);
+ CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3,
name,
+ miss);
// Return the constant value.
__ mov(r0, Operand(Handle<Object>(value)));
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev