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 4529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4540 // Load the global or builtins object from the current context. | 4540 // Load the global or builtins object from the current context. |
4541 movp(function, | 4541 movp(function, |
4542 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 4542 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
4543 // Load the native context from the global or builtins object. | 4543 // Load the native context from the global or builtins object. |
4544 movp(function, FieldOperand(function, GlobalObject::kNativeContextOffset)); | 4544 movp(function, FieldOperand(function, GlobalObject::kNativeContextOffset)); |
4545 // Load the function from the native context. | 4545 // Load the function from the native context. |
4546 movp(function, Operand(function, Context::SlotOffset(index))); | 4546 movp(function, Operand(function, Context::SlotOffset(index))); |
4547 } | 4547 } |
4548 | 4548 |
4549 | 4549 |
4550 void MacroAssembler::LoadArrayFunction(Register function) { | |
4551 movp(function, | |
4552 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | |
4553 movp(function, FieldOperand(function, GlobalObject::kGlobalContextOffset)); | |
4554 movp(function, | |
4555 Operand(function, Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); | |
4556 } | |
4557 | |
4558 | |
4559 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, | 4550 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, |
4560 Register map) { | 4551 Register map) { |
4561 // Load the initial map. The global functions all have initial maps. | 4552 // Load the initial map. The global functions all have initial maps. |
4562 movp(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 4553 movp(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
4563 if (emit_debug_code()) { | 4554 if (emit_debug_code()) { |
4564 Label ok, fail; | 4555 Label ok, fail; |
4565 CheckMap(map, isolate()->factory()->meta_map(), &fail, DO_SMI_CHECK); | 4556 CheckMap(map, isolate()->factory()->meta_map(), &fail, DO_SMI_CHECK); |
4566 jmp(&ok); | 4557 jmp(&ok); |
4567 bind(&fail); | 4558 bind(&fail); |
4568 Abort(kGlobalFunctionsMustHaveInitialMap); | 4559 Abort(kGlobalFunctionsMustHaveInitialMap); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4984 j(equal, found); | 4975 j(equal, found); |
4985 movp(current, FieldOperand(current, Map::kPrototypeOffset)); | 4976 movp(current, FieldOperand(current, Map::kPrototypeOffset)); |
4986 CompareRoot(current, Heap::kNullValueRootIndex); | 4977 CompareRoot(current, Heap::kNullValueRootIndex); |
4987 j(not_equal, &loop_again); | 4978 j(not_equal, &loop_again); |
4988 } | 4979 } |
4989 | 4980 |
4990 | 4981 |
4991 } } // namespace v8::internal | 4982 } } // namespace v8::internal |
4992 | 4983 |
4993 #endif // V8_TARGET_ARCH_X64 | 4984 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |