Chromium Code Reviews| 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..ef89362a904ed7dbe219e407faa44edad6aa6f47 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 transitioned cached |
|
Jakob Kummerow
2012/01/23 17:16:55
nit: += "map."
danno
2012/01/26 21:32:34
Done.
|
| + 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))); |