Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 66ec04facb1c8695b0cc925bdb3efc6b0dd60eaa..69ecf214a82ae471b385024d9393bf553bb80f1b 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -1464,6 +1464,21 @@ void MacroAssembler::Assert(Condition cc, const char* msg) { |
} |
+void MacroAssembler::AssertFastElements(Register elements) { |
+ if (FLAG_debug_code) { |
+ Label ok; |
+ cmp(FieldOperand(elements, HeapObject::kMapOffset), |
+ Immediate(Factory::fixed_array_map())); |
+ j(equal, &ok); |
+ cmp(FieldOperand(elements, HeapObject::kMapOffset), |
+ Immediate(Factory::fixed_cow_array_map())); |
+ j(equal, &ok); |
+ Abort("JSObject with fast elements map has slow elements"); |
+ bind(&ok); |
+ } |
+} |
+ |
+ |
void MacroAssembler::Check(Condition cc, const char* msg) { |
Label L; |
j(cc, &L, taken); |