OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 // A variable occurring in such a scope should have slot type LOOKUP and | 2161 // A variable occurring in such a scope should have slot type LOOKUP and |
2162 // not CONTEXT. | 2162 // not CONTEXT. |
2163 if (emit_debug_code()) { | 2163 if (emit_debug_code()) { |
2164 cmp(FieldOperand(dst, HeapObject::kMapOffset), | 2164 cmp(FieldOperand(dst, HeapObject::kMapOffset), |
2165 isolate()->factory()->with_context_map()); | 2165 isolate()->factory()->with_context_map()); |
2166 Check(not_equal, "Variable resolved to with context."); | 2166 Check(not_equal, "Variable resolved to with context."); |
2167 } | 2167 } |
2168 } | 2168 } |
2169 | 2169 |
2170 | 2170 |
2171 void MacroAssembler::LoadGlobalInitialConstructedArrayMap( | 2171 void MacroAssembler::LoadTransitionedArrayMapConditional( |
| 2172 ElementsKind expected_kind, |
| 2173 ElementsKind transitioned_kind, |
| 2174 Register map_in_out, |
| 2175 Register scratch, |
| 2176 Label* no_map_match) { |
| 2177 // Load the global or builtins object from the current context. |
| 2178 mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 2179 mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset)); |
| 2180 |
| 2181 // Check that the function's map is the same as the expected cached map. |
| 2182 int expected_index = |
| 2183 Context::GetContextMapIndexFromElementsKind(expected_kind); |
| 2184 cmp(map_in_out, Operand(scratch, Context::SlotOffset(expected_index))); |
| 2185 j(not_equal, no_map_match); |
| 2186 |
| 2187 // Use the transitioned cached map. |
| 2188 int trans_index = |
| 2189 Context::GetContextMapIndexFromElementsKind(transitioned_kind); |
| 2190 mov(map_in_out, Operand(scratch, Context::SlotOffset(trans_index))); |
| 2191 } |
| 2192 |
| 2193 |
| 2194 void MacroAssembler::LoadInitialArrayMap( |
2172 Register function_in, Register scratch, Register map_out) { | 2195 Register function_in, Register scratch, Register map_out) { |
2173 ASSERT(!function_in.is(map_out)); | 2196 ASSERT(!function_in.is(map_out)); |
2174 Label done; | 2197 Label done; |
2175 mov(map_out, FieldOperand(function_in, | 2198 mov(map_out, FieldOperand(function_in, |
2176 JSFunction::kPrototypeOrInitialMapOffset)); | 2199 JSFunction::kPrototypeOrInitialMapOffset)); |
2177 if (!FLAG_smi_only_arrays) { | 2200 if (!FLAG_smi_only_arrays) { |
2178 // Load the global or builtins object from the current context. | 2201 LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
2179 mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 2202 FAST_ELEMENTS, |
2180 mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset)); | 2203 map_out, |
2181 | 2204 scratch, |
2182 // Check that the function's map is same as the cached map. | 2205 &done); |
2183 cmp(map_out, | |
2184 Operand(scratch, | |
2185 Context::SlotOffset(Context::SMI_JS_ARRAY_MAP_INDEX))); | |
2186 j(not_equal, &done); | |
2187 | |
2188 // Use the cached transitioned map. | |
2189 mov(map_out, | |
2190 Operand(scratch, | |
2191 Context::SlotOffset(Context::OBJECT_JS_ARRAY_MAP_INDEX))); | |
2192 } | 2206 } |
2193 bind(&done); | 2207 bind(&done); |
2194 } | 2208 } |
2195 | 2209 |
2196 | 2210 |
2197 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 2211 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
2198 // Load the global or builtins object from the current context. | 2212 // Load the global or builtins object from the current context. |
2199 mov(function, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 2213 mov(function, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
2200 // Load the global context from the global or builtins object. | 2214 // Load the global context from the global or builtins object. |
2201 mov(function, FieldOperand(function, GlobalObject::kGlobalContextOffset)); | 2215 mov(function, FieldOperand(function, GlobalObject::kGlobalContextOffset)); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2776 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2790 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2777 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2791 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2778 } | 2792 } |
2779 | 2793 |
2780 bind(&done); | 2794 bind(&done); |
2781 } | 2795 } |
2782 | 2796 |
2783 } } // namespace v8::internal | 2797 } } // namespace v8::internal |
2784 | 2798 |
2785 #endif // V8_TARGET_ARCH_IA32 | 2799 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |