Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 2012a5ad9d304b0c5c3ebb47c5c4c4283b64d4cc..21ba1d154040dc07c93feafc8ade302acdd2b482 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -669,6 +669,19 @@ void MacroAssembler::AbortIfNotSmi(Register object) { |
} |
+void MacroAssembler::AbortIfNotFixedArray(Register object) { |
+ Label ok, fail; |
+ CheckMap(object, |
+ isolate()->factory()->fixed_array_map(), |
+ &fail, |
+ DONT_DO_SMI_CHECK); |
+ jmp(&ok); |
+ bind(&fail); |
+ Abort("Operand is not a fixed array"); |
+ bind(&ok); |
+} |
+ |
+ |
void MacroAssembler::AbortIfNotString(Register object) { |
test(object, Immediate(kSmiTagMask)); |
Assert(not_equal, "Operand is not a string"); |
@@ -2518,12 +2531,22 @@ void MacroAssembler::Abort(const char* msg) { |
void MacroAssembler::LoadInstanceDescriptors(Register map, |
Register descriptors) { |
- mov(descriptors, |
- FieldOperand(map, Map::kInstanceDescriptorsOrBitField3Offset)); |
- Label not_smi; |
- JumpIfNotSmi(descriptors, ¬_smi); |
+ mov(descriptors, FieldOperand(map, |
+ Map::kInstanceDescriptorsOrBackPointerOffset)); |
+ |
+ Label ok, fail; |
+ CheckMap(descriptors, |
+ isolate()->factory()->fixed_array_map(), |
+ &fail, |
+ DONT_DO_SMI_CHECK); |
+ jmp(&ok); |
+ bind(&fail); |
mov(descriptors, isolate()->factory()->empty_descriptor_array()); |
- bind(¬_smi); |
+ bind(&ok); |
+ |
+ if (emit_debug_code()) { |
+ AbortIfNotFixedArray(descriptors); |
Jakob Kummerow
2012/07/10 12:26:25
This check is pretty pointless, don't you think? Y
Toon Verwaest
2012/07/10 13:28:28
Done.
Toon Verwaest
2012/07/10 13:28:28
Done.
|
+ } |
} |
@@ -2886,8 +2909,15 @@ void MacroAssembler::CheckEnumCache(Label* call_runtime) { |
// check for an enum cache. Leave the map in ebx for the subsequent |
// prototype load. |
mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset)); |
- mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOrBitField3Offset)); |
- JumpIfSmi(edx, call_runtime); |
+ mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOrBackPointerOffset)); |
+ CheckMap(edx, |
+ isolate()->factory()->fixed_array_map(), |
+ call_runtime, |
+ DONT_DO_SMI_CHECK); |
+ |
+ if (emit_debug_code()) { |
+ AbortIfNotFixedArray(edx); |
Jakob Kummerow
2012/07/10 12:26:25
This check is entirely pointless. We just did a ma
Toon Verwaest
2012/07/10 13:28:28
Done.
Toon Verwaest
2012/07/10 13:28:28
Done.
|
+ } |
// Check that there is an enum cache in the non-empty instance |
// descriptors (edx). This is the case if the next enumeration |