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 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4262 // Load the global or builtins object from the current context. | 4262 // Load the global or builtins object from the current context. |
4263 movq(function, | 4263 movq(function, |
4264 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 4264 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
4265 // Load the native context from the global or builtins object. | 4265 // Load the native context from the global or builtins object. |
4266 movq(function, FieldOperand(function, GlobalObject::kNativeContextOffset)); | 4266 movq(function, FieldOperand(function, GlobalObject::kNativeContextOffset)); |
4267 // Load the function from the native context. | 4267 // Load the function from the native context. |
4268 movq(function, Operand(function, Context::SlotOffset(index))); | 4268 movq(function, Operand(function, Context::SlotOffset(index))); |
4269 } | 4269 } |
4270 | 4270 |
4271 | 4271 |
| 4272 void MacroAssembler::LoadArrayFunction(Register function) { |
| 4273 movq(function, |
| 4274 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| 4275 movq(function, FieldOperand(function, GlobalObject::kGlobalContextOffset)); |
| 4276 movq(function, |
| 4277 Operand(function, Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); |
| 4278 } |
| 4279 |
| 4280 |
4272 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, | 4281 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, |
4273 Register map) { | 4282 Register map) { |
4274 // Load the initial map. The global functions all have initial maps. | 4283 // Load the initial map. The global functions all have initial maps. |
4275 movq(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 4284 movq(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
4276 if (emit_debug_code()) { | 4285 if (emit_debug_code()) { |
4277 Label ok, fail; | 4286 Label ok, fail; |
4278 CheckMap(map, isolate()->factory()->meta_map(), &fail, DO_SMI_CHECK); | 4287 CheckMap(map, isolate()->factory()->meta_map(), &fail, DO_SMI_CHECK); |
4279 jmp(&ok); | 4288 jmp(&ok); |
4280 bind(&fail); | 4289 bind(&fail); |
4281 Abort("Global functions must have initial map"); | 4290 Abort("Global functions must have initial map"); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 j(greater, &no_info_available); | 4628 j(greater, &no_info_available); |
4620 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4629 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
4621 Heap::kAllocationSiteInfoMapRootIndex); | 4630 Heap::kAllocationSiteInfoMapRootIndex); |
4622 bind(&no_info_available); | 4631 bind(&no_info_available); |
4623 } | 4632 } |
4624 | 4633 |
4625 | 4634 |
4626 } } // namespace v8::internal | 4635 } } // namespace v8::internal |
4627 | 4636 |
4628 #endif // V8_TARGET_ARCH_X64 | 4637 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |