| 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 // instance type would be JS_FUNCTION_TYPE. | 529 // instance type would be JS_FUNCTION_TYPE. |
| 530 // rdi: constructor | 530 // rdi: constructor |
| 531 // rax: initial map | 531 // rax: initial map |
| 532 __ CmpInstanceType(rax, JS_FUNCTION_TYPE); | 532 __ CmpInstanceType(rax, JS_FUNCTION_TYPE); |
| 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 | |
| 540 // problem here, because it is always greater than the maximum | |
| 541 // instance size that can be represented in a byte. | |
| 542 ASSERT(Heap::MaxObjectSizeInPagedSpace() >= (1 << kBitsPerByte)); | |
| 543 __ AllocateObjectInNewSpace(rdi, | 539 __ AllocateObjectInNewSpace(rdi, |
| 544 rbx, | 540 rbx, |
| 545 rdi, | 541 rdi, |
| 546 no_reg, | 542 no_reg, |
| 547 &rt_call, | 543 &rt_call, |
| 548 NO_ALLOCATION_FLAGS); | 544 NO_ALLOCATION_FLAGS); |
| 549 // Allocated the JSObject, now initialize the fields. | 545 // Allocated the JSObject, now initialize the fields. |
| 550 // rax: initial map | 546 // rax: initial map |
| 551 // rbx: JSObject (not HeapObject tagged - the actual address). | 547 // rbx: JSObject (not HeapObject tagged - the actual address). |
| 552 // rdi: start of next object | 548 // rdi: start of next object |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 __ subq(rdx, rcx); | 589 __ subq(rdx, rcx); |
| 594 // Done if no extra properties are to be allocated. | 590 // Done if no extra properties are to be allocated. |
| 595 __ j(zero, &allocated); | 591 __ j(zero, &allocated); |
| 596 __ Assert(positive, "Property allocation count failed."); | 592 __ Assert(positive, "Property allocation count failed."); |
| 597 | 593 |
| 598 // Scale the number of elements by pointer size and add the header for | 594 // Scale the number of elements by pointer size and add the header for |
| 599 // FixedArrays to the start of the next object calculation from above. | 595 // FixedArrays to the start of the next object calculation from above. |
| 600 // rbx: JSObject | 596 // rbx: JSObject |
| 601 // rdi: start of next object (will be start of FixedArray) | 597 // rdi: start of next object (will be start of FixedArray) |
| 602 // rdx: number of elements in properties array | 598 // rdx: number of elements in properties array |
| 603 ASSERT(Heap::MaxObjectSizeInPagedSpace() > | |
| 604 (FixedArray::kHeaderSize + 255*kPointerSize)); | |
| 605 __ AllocateObjectInNewSpace(FixedArray::kHeaderSize, | 599 __ AllocateObjectInNewSpace(FixedArray::kHeaderSize, |
| 606 times_pointer_size, | 600 times_pointer_size, |
| 607 rdx, | 601 rdx, |
| 608 rdi, | 602 rdi, |
| 609 rax, | 603 rax, |
| 610 no_reg, | 604 no_reg, |
| 611 &undo_allocation, | 605 &undo_allocation, |
| 612 RESULT_CONTAINS_TOP); | 606 RESULT_CONTAINS_TOP); |
| 613 | 607 |
| 614 // Initialize the FixedArray. | 608 // Initialize the FixedArray. |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { | 846 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { |
| 853 Generate_JSEntryTrampolineHelper(masm, false); | 847 Generate_JSEntryTrampolineHelper(masm, false); |
| 854 } | 848 } |
| 855 | 849 |
| 856 | 850 |
| 857 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { | 851 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
| 858 Generate_JSEntryTrampolineHelper(masm, true); | 852 Generate_JSEntryTrampolineHelper(masm, true); |
| 859 } | 853 } |
| 860 | 854 |
| 861 } } // namespace v8::internal | 855 } } // namespace v8::internal |
| OLD | NEW |