Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 057ca1ef2bae528deba94161f7478d26203a4d8c..31473e909c968885cbd2075fcc16a8840913d026 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -91,7 +91,7 @@ void LCodeGen::FinishCode(Handle<Code> code) { |
} |
-void LCodeGen::Abort(const char* reason) { |
+void LCodeGen::Abort(BailoutReason reason) { |
info()->set_bailout_reason(reason); |
status_ = ABORTED; |
} |
@@ -334,7 +334,7 @@ bool LCodeGen::GenerateDeoptJumpTable() { |
// 32bit data after it. |
if (!is_int24((masm()->pc_offset() / Assembler::kInstrSize) + |
deopt_jump_table_.length() * 7)) { |
- Abort("Generated code is too large"); |
+ Abort(kGeneratedCodeIsTooLarge); |
} |
if (deopt_jump_table_.length() > 0) { |
@@ -423,7 +423,7 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { |
ASSERT(literal->IsNumber()); |
__ mov(scratch, Operand(static_cast<int32_t>(literal->Number()))); |
} else if (r.IsDouble()) { |
- Abort("EmitLoadRegister: Unsupported double immediate."); |
+ Abort(kEmitLoadRegisterUnsupportedDoubleImmediate); |
} else { |
ASSERT(r.IsTagged()); |
__ LoadObject(scratch, literal); |
@@ -461,9 +461,9 @@ DwVfpRegister LCodeGen::EmitLoadDoubleRegister(LOperand* op, |
__ vcvt_f64_s32(dbl_scratch, flt_scratch); |
return dbl_scratch; |
} else if (r.IsDouble()) { |
- Abort("unsupported double immediate"); |
+ Abort(kUnsupportedDoubleImmediate); |
} else if (r.IsTagged()) { |
- Abort("unsupported tagged immediate"); |
+ Abort(kUnsupportedTaggedImmediate); |
} |
} else if (op->IsStackSlot() || op->IsArgument()) { |
// TODO(regis): Why is vldr not taking a MemOperand? |
@@ -534,14 +534,14 @@ Operand LCodeGen::ToOperand(LOperand* op) { |
ASSERT(constant->HasInteger32Value()); |
return Operand(constant->Integer32Value()); |
} else if (r.IsDouble()) { |
- Abort("ToOperand Unsupported double immediate."); |
+ Abort(kToOperandUnsupportedDoubleImmediate); |
} |
ASSERT(r.IsTagged()); |
return Operand(constant->handle()); |
} else if (op->IsRegister()) { |
return Operand(ToRegister(op)); |
} else if (op->IsDoubleRegister()) { |
- Abort("ToOperand IsDoubleRegister unimplemented"); |
+ Abort(kToOperandIsDoubleRegisterUnimplemented); |
return Operand::Zero(); |
} |
// Stack slots not implemented, use ToMemOperand instead. |
@@ -772,7 +772,7 @@ void LCodeGen::DeoptimizeIf(Condition cc, |
Address entry = |
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
if (entry == NULL) { |
- Abort("bailout was not prepared"); |
+ Abort(kBailoutWasNotPrepared); |
return; |
} |
@@ -1744,8 +1744,12 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
if (shift_count != 0) { |
if (instr->hydrogen_value()->representation().IsSmi() && |
instr->can_deopt()) { |
- __ mov(result, Operand(left, LSL, shift_count - 1)); |
- __ SmiTag(result, result, SetCC); |
+ if (shift_count != 1) { |
+ __ mov(result, Operand(left, LSL, shift_count - 1)); |
+ __ SmiTag(result, result, SetCC); |
+ } else { |
+ __ SmiTag(result, left, SetCC); |
+ } |
DeoptimizeIf(vs, instr->environment()); |
} else { |
__ mov(result, Operand(left, LSL, shift_count)); |
@@ -1822,6 +1826,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) { |
} |
+void LCodeGen::DoConstantE(LConstantE* instr) { |
+ __ mov(ToRegister(instr->result()), Operand(instr->value())); |
+} |
+ |
+ |
void LCodeGen::DoConstantT(LConstantT* instr) { |
Handle<Object> value = instr->value(); |
AllowDeferredHandleDereference smi_check; |
@@ -1927,7 +1936,7 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
__ cmp(ip, Operand(encoding == String::ONE_BYTE_ENCODING |
? one_byte_seq_type : two_byte_seq_type)); |
- __ Check(eq, "Unexpected string type"); |
+ __ Check(eq, kUnexpectedStringType); |
} |
__ add(ip, |
@@ -2931,19 +2940,6 @@ void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
} |
-void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) { |
- Register object = ToRegister(instr->object()); |
- ExternalReference sites_list_address = instr->GetReference(isolate()); |
- |
- __ mov(ip, Operand(sites_list_address)); |
- __ ldr(ip, MemOperand(ip)); |
- __ str(ip, FieldMemOperand(object, |
- instr->hydrogen()->store_field().offset())); |
- __ mov(ip, Operand(sites_list_address)); |
- __ str(object, MemOperand(ip)); |
-} |
- |
- |
void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
Register context = ToRegister(instr->context()); |
Register result = ToRegister(instr->result()); |
@@ -3002,6 +2998,13 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
HObjectAccess access = instr->hydrogen()->access(); |
int offset = access.offset(); |
Register object = ToRegister(instr->object()); |
+ |
+ if (access.IsExternalMemory()) { |
+ Register result = ToRegister(instr->result()); |
+ __ ldr(result, MemOperand(object, offset)); |
+ return; |
+ } |
+ |
if (instr->hydrogen()->representation().IsDouble()) { |
DwVfpRegister result = ToDoubleRegister(instr->result()); |
__ vldr(result, FieldMemOperand(object, offset)); |
@@ -3197,7 +3200,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { |
if (key_is_constant) { |
constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
if (constant_key & 0xF0000000) { |
- Abort("array index constant value too big."); |
+ Abort(kArrayIndexConstantValueTooBig); |
} |
} else { |
key = ToRegister(instr->key()); |
@@ -3281,7 +3284,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { |
if (key_is_constant) { |
constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
if (constant_key & 0xF0000000) { |
- Abort("array index constant value too big."); |
+ Abort(kArrayIndexConstantValueTooBig); |
} |
} else { |
key = ToRegister(instr->key()); |
@@ -3542,7 +3545,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
void LCodeGen::DoPushArgument(LPushArgument* instr) { |
LOperand* argument = instr->value(); |
if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { |
- Abort("DoPushArgument not implemented for double type."); |
+ Abort(kDoPushArgumentNotImplementedForDoubleType); |
} else { |
Register argument_reg = EmitLoadRegister(argument, ip); |
__ push(argument_reg); |
@@ -3762,7 +3765,7 @@ void LCodeGen::DoMathAbs(LMathAbs* instr) { |
DwVfpRegister input = ToDoubleRegister(instr->value()); |
DwVfpRegister result = ToDoubleRegister(instr->result()); |
__ vabs(result, input); |
- } else if (r.IsInteger32()) { |
+ } else if (r.IsSmiOrInteger32()) { |
EmitIntegerMathAbs(instr); |
} else { |
// Representation is tagged. |
@@ -4181,10 +4184,15 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
Register object = ToRegister(instr->object()); |
Register scratch = scratch0(); |
- |
HObjectAccess access = instr->hydrogen()->access(); |
int offset = access.offset(); |
+ if (access.IsExternalMemory()) { |
+ Register value = ToRegister(instr->value()); |
+ __ str(value, MemOperand(object, offset)); |
+ return; |
+ } |
+ |
Handle<Map> transition = instr->transition(); |
if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
@@ -4311,7 +4319,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
if (key_is_constant) { |
constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
if (constant_key & 0xF0000000) { |
- Abort("array index constant value too big."); |
+ Abort(kArrayIndexConstantValueTooBig); |
} |
} else { |
key = ToRegister(instr->key()); |
@@ -4384,7 +4392,7 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
if (key_is_constant) { |
constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
if (constant_key & 0xF0000000) { |
- Abort("array index constant value too big."); |
+ Abort(kArrayIndexConstantValueTooBig); |
} |
} else { |
key = ToRegister(instr->key()); |
@@ -4407,7 +4415,7 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
if (masm()->emit_debug_code()) { |
__ vmrs(ip); |
__ tst(ip, Operand(kVFPDefaultNaNModeControlBit)); |
- __ Assert(ne, "Default NaN mode not set"); |
+ __ Assert(ne, kDefaultNaNModeNotSet); |
} |
__ VFPCanonicalizeNaN(value); |
} |
@@ -4637,13 +4645,6 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { |
} |
-void LCodeGen::DoStringLength(LStringLength* instr) { |
- Register string = ToRegister(instr->string()); |
- Register result = ToRegister(instr->result()); |
- __ ldr(result, FieldMemOperand(string, String::kLengthOffset)); |
-} |
- |
- |
void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
LOperand* input = instr->value(); |
ASSERT(input->IsRegister() || input->IsStackSlot()); |
@@ -5336,10 +5337,12 @@ void LCodeGen::DoAllocate(LAllocate* instr) { |
if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
} |
- if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
- ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); |
+ if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
+ ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
+ ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); |
flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); |
- } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { |
+ } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
+ ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); |
flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); |
} |
@@ -5398,10 +5401,12 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
__ Push(Smi::FromInt(size)); |
} |
- if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
- ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); |
+ if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
+ ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
+ ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); |
CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr); |
- } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { |
+ } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
+ ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); |
CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr); |
} else { |
CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); |