| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); | 125 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); |
| 126 | 126 |
| 127 // Setup the object header. | 127 // Setup the object header. |
| 128 __ LoadRoot(kScratchRegister, Heap::kFunctionContextMapRootIndex); | 128 __ LoadRoot(kScratchRegister, Heap::kFunctionContextMapRootIndex); |
| 129 __ movq(FieldOperand(rax, HeapObject::kMapOffset), kScratchRegister); | 129 __ movq(FieldOperand(rax, HeapObject::kMapOffset), kScratchRegister); |
| 130 __ Move(FieldOperand(rax, FixedArray::kLengthOffset), Smi::FromInt(length)); | 130 __ Move(FieldOperand(rax, FixedArray::kLengthOffset), Smi::FromInt(length)); |
| 131 | 131 |
| 132 // Setup the fixed slots. | 132 // Setup the fixed slots. |
| 133 __ Set(rbx, 0); // Set to NULL. | 133 __ Set(rbx, 0); // Set to NULL. |
| 134 __ movq(Operand(rax, Context::SlotOffset(Context::CLOSURE_INDEX)), rcx); | 134 __ movq(Operand(rax, Context::SlotOffset(Context::CLOSURE_INDEX)), rcx); |
| 135 __ movq(Operand(rax, Context::SlotOffset(Context::FCONTEXT_INDEX)), rax); | |
| 136 __ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rsi); | 135 __ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rsi); |
| 137 __ movq(Operand(rax, Context::SlotOffset(Context::EXTENSION_INDEX)), rbx); | 136 __ movq(Operand(rax, Context::SlotOffset(Context::EXTENSION_INDEX)), rbx); |
| 138 | 137 |
| 139 // Copy the global object from the previous context. | 138 // Copy the global object from the previous context. |
| 140 __ movq(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 139 __ movq(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 141 __ movq(Operand(rax, Context::SlotOffset(Context::GLOBAL_INDEX)), rbx); | 140 __ movq(Operand(rax, Context::SlotOffset(Context::GLOBAL_INDEX)), rbx); |
| 142 | 141 |
| 143 // Initialize the rest of the slots to undefined. | 142 // Initialize the rest of the slots to undefined. |
| 144 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); | 143 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); |
| 145 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { | 144 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { |
| (...skipping 5194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5340 __ Drop(1); | 5339 __ Drop(1); |
| 5341 __ ret(2 * kPointerSize); | 5340 __ ret(2 * kPointerSize); |
| 5342 } | 5341 } |
| 5343 | 5342 |
| 5344 | 5343 |
| 5345 #undef __ | 5344 #undef __ |
| 5346 | 5345 |
| 5347 } } // namespace v8::internal | 5346 } } // namespace v8::internal |
| 5348 | 5347 |
| 5349 #endif // V8_TARGET_ARCH_X64 | 5348 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |