Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index b53b5ea23d1e45d684789b7afe9fd3146bc7ca94..e88e5be804508f18666e4310105a7ad18bd4d858 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -4798,38 +4798,46 @@ void MacroAssembler::JumpIfEitherSmi(Register reg1, |
} |
-void MacroAssembler::AbortIfSmi(Register object) { |
- STATIC_ASSERT(kSmiTag == 0); |
- andi(at, object, kSmiTagMask); |
- Assert(ne, "Operand is a smi", at, Operand(zero_reg)); |
+void MacroAssembler::AssertNotSmi(Register object) { |
+ if (emit_debug_code()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ andi(at, object, kSmiTagMask); |
+ Check(ne, "Operand is a smi", at, Operand(zero_reg)); |
+ } |
} |
-void MacroAssembler::AbortIfNotSmi(Register object) { |
- STATIC_ASSERT(kSmiTag == 0); |
- andi(at, object, kSmiTagMask); |
- Assert(eq, "Operand is a smi", at, Operand(zero_reg)); |
+void MacroAssembler::AssertSmi(Register object) { |
+ if (emit_debug_code()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ andi(at, object, kSmiTagMask); |
+ Check(eq, "Operand is a smi", at, Operand(zero_reg)); |
+ } |
} |
-void MacroAssembler::AbortIfNotString(Register object) { |
- STATIC_ASSERT(kSmiTag == 0); |
- And(t0, object, Operand(kSmiTagMask)); |
- Assert(ne, "Operand is not a string", t0, Operand(zero_reg)); |
- push(object); |
- lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
- lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset)); |
- Assert(lo, "Operand is not a string", object, Operand(FIRST_NONSTRING_TYPE)); |
- pop(object); |
-} |
- |
- |
-void MacroAssembler::AbortIfNotRootValue(Register src, |
- Heap::RootListIndex root_value_index, |
- const char* message) { |
- ASSERT(!src.is(at)); |
- LoadRoot(at, root_value_index); |
- Assert(eq, message, src, Operand(at)); |
+void MacroAssembler::AssertString(Register object) { |
+ if (emit_debug_code()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ And(t0, object, Operand(kSmiTagMask)); |
+ Check(ne, "Operand is a smi and not a string", t0, Operand(zero_reg)); |
+ push(object); |
+ lw(object, FieldMemOperand(object, HeapObject::kMapOffset)); |
+ lbu(object, FieldMemOperand(object, Map::kInstanceTypeOffset)); |
+ Check(lo, "Operand is not a string", object, Operand(FIRST_NONSTRING_TYPE)); |
+ pop(object); |
+ } |
+} |
+ |
+ |
+void MacroAssembler::AssertRootValue(Register src, |
+ Heap::RootListIndex root_value_index, |
+ const char* message) { |
+ if (emit_debug_code()) { |
+ ASSERT(!src.is(at)); |
+ LoadRoot(at, root_value_index); |
+ Check(eq, message, src, Operand(at)); |
+ } |
} |