Add debug code assertions where we expect smi inputs.


Review URL: http://codereview.chromium.org/998007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f822f101
This diff is collapsed.
......@@ -351,20 +351,20 @@ void MacroAssembler::FCmp() {
}
void MacroAssembler::AbortIfNotNumber(Register object, const char* msg) {
void MacroAssembler::AbortIfNotNumber(Register object) {
Label ok;
test(object, Immediate(kSmiTagMask));
j(zero, &ok);
cmp(FieldOperand(object, HeapObject::kMapOffset),
Factory::heap_number_map());
Assert(equal, msg);
Assert(equal, "Operand not a number");
bind(&ok);
}
void MacroAssembler::AbortIfNotSmi(Register object, const char* msg) {
void MacroAssembler::AbortIfNotSmi(Register object) {
test(object, Immediate(kSmiTagMask));
Assert(equal, msg);
Assert(equal, "Operand not a smi");
}
......
......@@ -189,10 +189,10 @@ class MacroAssembler: public Assembler {
}
// Abort execution if argument is not a number. Used in debug code.
void AbortIfNotNumber(Register object, const char* msg);
void AbortIfNotNumber(Register object);
// Abort execution if argument is not a smi. Used in debug code.
void AbortIfNotSmi(Register object, const char* msg);
void AbortIfNotSmi(Register object);
// ---------------------------------------------------------------------------
// Exception handling
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment