| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 __ j(equal, &rt_call); | 533 __ j(equal, &rt_call); |
| 534 | 534 |
| 535 // Now allocate the JSObject on the heap. | 535 // Now allocate the JSObject on the heap. |
| 536 __ movzxbq(rdi, FieldOperand(rax, Map::kInstanceSizeOffset)); | 536 __ movzxbq(rdi, FieldOperand(rax, Map::kInstanceSizeOffset)); |
| 537 __ shl(rdi, Immediate(kPointerSizeLog2)); | 537 __ shl(rdi, Immediate(kPointerSizeLog2)); |
| 538 // rdi: size of new object | 538 // rdi: size of new object |
| 539 // Make sure that the maximum heap object size will never cause us | 539 // Make sure that the maximum heap object size will never cause us |
| 540 // problem here, because it is always greater than the maximum | 540 // problem here, because it is always greater than the maximum |
| 541 // instance size that can be represented in a byte. | 541 // instance size that can be represented in a byte. |
| 542 ASSERT(Heap::MaxObjectSizeInPagedSpace() >= (1 << kBitsPerByte)); | 542 ASSERT(Heap::MaxObjectSizeInPagedSpace() >= (1 << kBitsPerByte)); |
| 543 __ AllocateObjectInNewSpace(rdi, rbx, rdi, no_reg, &rt_call, false); | 543 __ AllocateObjectInNewSpace(rdi, |
| 544 rbx, |
| 545 rdi, |
| 546 no_reg, |
| 547 &rt_call, |
| 548 NO_ALLOCATION_FLAGS); |
| 544 // Allocated the JSObject, now initialize the fields. | 549 // Allocated the JSObject, now initialize the fields. |
| 545 // rax: initial map | 550 // rax: initial map |
| 546 // rbx: JSObject (not HeapObject tagged - the actual address). | 551 // rbx: JSObject (not HeapObject tagged - the actual address). |
| 547 // rdi: start of next object | 552 // rdi: start of next object |
| 548 __ movq(Operand(rbx, JSObject::kMapOffset), rax); | 553 __ movq(Operand(rbx, JSObject::kMapOffset), rax); |
| 549 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex); | 554 __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex); |
| 550 __ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx); | 555 __ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx); |
| 551 __ movq(Operand(rbx, JSObject::kElementsOffset), rcx); | 556 __ movq(Operand(rbx, JSObject::kElementsOffset), rcx); |
| 552 // Set extra fields in the newly allocated object. | 557 // Set extra fields in the newly allocated object. |
| 553 // rax: initial map | 558 // rax: initial map |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 // rdx: number of elements in properties array | 602 // rdx: number of elements in properties array |
| 598 ASSERT(Heap::MaxObjectSizeInPagedSpace() > | 603 ASSERT(Heap::MaxObjectSizeInPagedSpace() > |
| 599 (FixedArray::kHeaderSize + 255*kPointerSize)); | 604 (FixedArray::kHeaderSize + 255*kPointerSize)); |
| 600 __ AllocateObjectInNewSpace(FixedArray::kHeaderSize, | 605 __ AllocateObjectInNewSpace(FixedArray::kHeaderSize, |
| 601 times_pointer_size, | 606 times_pointer_size, |
| 602 rdx, | 607 rdx, |
| 603 rdi, | 608 rdi, |
| 604 rax, | 609 rax, |
| 605 no_reg, | 610 no_reg, |
| 606 &undo_allocation, | 611 &undo_allocation, |
| 607 true); | 612 RESULT_CONTAINS_TOP); |
| 608 | 613 |
| 609 // Initialize the FixedArray. | 614 // Initialize the FixedArray. |
| 610 // rbx: JSObject | 615 // rbx: JSObject |
| 611 // rdi: FixedArray | 616 // rdi: FixedArray |
| 612 // rdx: number of elements | 617 // rdx: number of elements |
| 613 // rax: start of next object | 618 // rax: start of next object |
| 614 __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex); | 619 __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex); |
| 615 __ movq(Operand(rdi, JSObject::kMapOffset), rcx); // setup the map | 620 __ movq(Operand(rdi, JSObject::kMapOffset), rcx); // setup the map |
| 616 __ movl(Operand(rdi, FixedArray::kLengthOffset), rdx); // and length | 621 __ movl(Operand(rdi, FixedArray::kLengthOffset), rdx); // and length |
| 617 | 622 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { | 852 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { |
| 848 Generate_JSEntryTrampolineHelper(masm, false); | 853 Generate_JSEntryTrampolineHelper(masm, false); |
| 849 } | 854 } |
| 850 | 855 |
| 851 | 856 |
| 852 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { | 857 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
| 853 Generate_JSEntryTrampolineHelper(masm, true); | 858 Generate_JSEntryTrampolineHelper(masm, true); |
| 854 } | 859 } |
| 855 | 860 |
| 856 } } // namespace v8::internal | 861 } } // namespace v8::internal |
| OLD | NEW |