Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index c1954a898a4ec1449568cd0683b2b6648feb455d..2f4b5f6ad289a028304a732eed5762ff42427053 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -262,6 +262,21 @@ void MacroAssembler::Assert(Condition cc, const char* msg) { |
} |
+void MacroAssembler::AssertFastElements(Register elements) { |
+ if (FLAG_debug_code) { |
+ Label ok; |
+ CompareRoot(FieldOperand(elements, HeapObject::kMapOffset), |
+ Heap::kFixedArrayMapRootIndex); |
+ j(equal, &ok); |
+ CompareRoot(FieldOperand(elements, HeapObject::kMapOffset), |
+ Heap::kFixedCOWArrayMapRootIndex); |
+ 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); |