Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 0d0bf037751a8361f785844b9cc21fd198459568..169e440448aa7d8c5bc9bcc62ada3b5f28ad1e1a 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -2328,6 +2328,52 @@ void MacroAssembler::LoadInitialArrayMap( |
} |
+void test_routine(Object* context, Object* function) { |
+ context->Print(); |
+ function->Print(); |
+} |
+ |
+void MacroAssembler::LoadInitialArrayMap(Register function_in, |
+ Register elements_kind, |
+ Register map_out) { |
+ Label miss, done; |
+ mov(map_out, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
+ mov(map_out, FieldOperand(map_out, GlobalObject::kGlobalContextOffset)); |
+ mov(map_out, Operand(map_out, |
+ Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); |
+ cmp(function_in, Operand(map_out, |
+ Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); |
+ j(not_equal, &miss); |
+ mov(map_out, FieldOperand(map_out, elements_kind, |
+ times_half_pointer_size, |
+ FixedArrayBase::kHeaderSize)); |
+ jmp(&done); |
+ bind(&miss); |
+ mov(map_out, FieldOperand(function_in, |
+ JSFunction::kPrototypeOrInitialMapOffset)); |
+ bind(&done); |
+} |
+ |
+void MacroAssembler::LoadInitialArrayMap(Register function_in, |
+ ElementsKind elements_kind, |
+ Register map_out) { |
+ Label miss, done; |
+ mov(map_out, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
+ mov(map_out, FieldOperand(map_out, GlobalObject::kGlobalContextOffset)); |
+ mov(map_out, Operand(map_out, |
+ Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); |
+ cmp(function_in, Operand(map_out, |
+ Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); |
+ j(not_equal, &miss); |
+ int offset = FixedArray::kHeaderSize + elements_kind * kPointerSize; |
+ mov(map_out, FieldOperand(map_out, offset)); |
+ jmp(&done); |
+ bind(&miss); |
+ mov(map_out, FieldOperand(function_in, |
+ JSFunction::kPrototypeOrInitialMapOffset)); |
+ bind(&done); |
+} |
+ |
void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
// Load the global or builtins object from the current context. |
mov(function, |