Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index d0d9e19c9013344990304438a152577199e80995..505fac649dd60e32dc3245d903538ddff6e15ec9 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -2168,6 +2168,32 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
} |
+void MacroAssembler::LoadGlobalInitialConstructedArrayMap( |
+ Register function_in, Register scratch, Register map_out) { |
+ ASSERT(!function_in.is(map_out)); |
+ Label done; |
+ mov(map_out, FieldOperand(function_in, |
+ JSFunction::kPrototypeOrInitialMapOffset)); |
+ if (!FLAG_smi_only_arrays) { |
+ // Load the global or builtins object from the current context. |
+ mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
+ mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset)); |
+ |
+ // Check that the function's map is same as the cached map. |
+ cmp(map_out, |
+ Operand(scratch, |
+ Context::SlotOffset(Context::SMI_JS_ARRAY_MAP_INDEX))); |
+ j(not_equal, &done); |
+ |
+ // Use the cached transitioned map. |
+ mov(map_out, |
+ Operand(scratch, |
+ Context::SlotOffset(Context::OBJECT_JS_ARRAY_MAP_INDEX))); |
+ } |
+ bind(&done); |
+} |
+ |
+ |
void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
// Load the global or builtins object from the current context. |
mov(function, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); |