Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index b74d09deaa6aef8e9c06fc7290f2be6636f1d405..6dbb9a5a759e3dd9a368d7be6a4d1ecc921b19c2 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3035,38 +3035,46 @@ void MacroAssembler::JumpIfEitherSmi(Register reg1, |
} |
-void MacroAssembler::AbortIfSmi(Register object) { |
- STATIC_ASSERT(kSmiTag == 0); |
- tst(object, Operand(kSmiTagMask)); |
- Assert(ne, "Operand is a smi"); |
+void MacroAssembler::AssertNotSmi(Register object) { |
+ if (emit_debug_code()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ tst(object, Operand(kSmiTagMask)); |
+ Check(ne, "Operand is a smi"); |
+ } |
} |
-void MacroAssembler::AbortIfNotSmi(Register object) { |
- STATIC_ASSERT(kSmiTag == 0); |
- tst(object, Operand(kSmiTagMask)); |
- Assert(eq, "Operand is not smi"); |
+void MacroAssembler::AssertSmi(Register object) { |
+ if (emit_debug_code()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ tst(object, Operand(kSmiTagMask)); |
+ Check(eq, "Operand is not smi"); |
+ } |
} |
-void MacroAssembler::AbortIfNotString(Register object) { |
- STATIC_ASSERT(kSmiTag == 0); |
- tst(object, Operand(kSmiTagMask)); |
- Assert(ne, "Operand is not a string"); |
- push(object); |
- ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
- CompareInstanceType(object, object, FIRST_NONSTRING_TYPE); |
- pop(object); |
- Assert(lo, "Operand is not a string"); |
+void MacroAssembler::AssertString(Register object) { |
+ if (emit_debug_code()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ tst(object, Operand(kSmiTagMask)); |
+ Check(ne, "Operand is a smi and not a string"); |
+ push(object); |
+ ldr(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
+ CompareInstanceType(object, object, FIRST_NONSTRING_TYPE); |
+ pop(object); |
+ Check(lo, "Operand is not a string"); |
+ } |
} |
-void MacroAssembler::AbortIfNotRootValue(Register src, |
- Heap::RootListIndex root_value_index, |
- const char* message) { |
- CompareRoot(src, root_value_index); |
- Assert(eq, message); |
+void MacroAssembler::AssertRootValue(Register src, |
+ Heap::RootListIndex root_value_index, |
+ const char* message) { |
+ if (emit_debug_code()) { |
+ CompareRoot(src, root_value_index); |
+ Check(eq, message); |
+ } |
} |