| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 __ j(equal, &rt_call); | 106 __ j(equal, &rt_call); |
| 107 | 107 |
| 108 // Now allocate the JSObject on the heap. | 108 // Now allocate the JSObject on the heap. |
| 109 // edi: constructor | 109 // edi: constructor |
| 110 // eax: initial map | 110 // eax: initial map |
| 111 __ movzx_b(edi, FieldOperand(eax, Map::kInstanceSizeOffset)); | 111 __ movzx_b(edi, FieldOperand(eax, Map::kInstanceSizeOffset)); |
| 112 __ shl(edi, kPointerSizeLog2); | 112 __ shl(edi, kPointerSizeLog2); |
| 113 // Make sure that the maximum heap object size will never cause us | 113 // Make sure that the maximum heap object size will never cause us |
| 114 // problem here, because it is always greater than the maximum | 114 // problem here, because it is always greater than the maximum |
| 115 // instance size that can be represented in a byte. | 115 // instance size that can be represented in a byte. |
| 116 ASSERT(Heap::MaxHeapObjectSize() >= (1 << kBitsPerByte)); | 116 ASSERT(Heap::MaxObjectSizeInPagedSpace() >= (1 << kBitsPerByte)); |
| 117 ExternalReference new_space_allocation_top = | 117 ExternalReference new_space_allocation_top = |
| 118 ExternalReference::new_space_allocation_top_address(); | 118 ExternalReference::new_space_allocation_top_address(); |
| 119 __ mov(ebx, Operand::StaticVariable(new_space_allocation_top)); | 119 __ mov(ebx, Operand::StaticVariable(new_space_allocation_top)); |
| 120 __ add(edi, Operand(ebx)); // Calculate new top | 120 __ add(edi, Operand(ebx)); // Calculate new top |
| 121 ExternalReference new_space_allocation_limit = | 121 ExternalReference new_space_allocation_limit = |
| 122 ExternalReference::new_space_allocation_limit_address(); | 122 ExternalReference::new_space_allocation_limit_address(); |
| 123 __ cmp(edi, Operand::StaticVariable(new_space_allocation_limit)); | 123 __ cmp(edi, Operand::StaticVariable(new_space_allocation_limit)); |
| 124 __ j(greater_equal, &rt_call); | 124 __ j(greater_equal, &rt_call); |
| 125 // Allocated the JSObject, now initialize the fields. | 125 // Allocated the JSObject, now initialize the fields. |
| 126 // eax: initial map | 126 // eax: initial map |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 __ test(edx, Operand(edx)); | 168 __ test(edx, Operand(edx)); |
| 169 // Done if no extra properties are to be allocated. | 169 // Done if no extra properties are to be allocated. |
| 170 __ j(zero, &allocated); | 170 __ j(zero, &allocated); |
| 171 | 171 |
| 172 // Scale the number of elements by pointer size and add the header for | 172 // Scale the number of elements by pointer size and add the header for |
| 173 // FixedArrays to the start of the next object calculation from above. | 173 // FixedArrays to the start of the next object calculation from above. |
| 174 // eax: initial map | 174 // eax: initial map |
| 175 // ebx: JSObject | 175 // ebx: JSObject |
| 176 // edi: start of next object (will be start of FixedArray) | 176 // edi: start of next object (will be start of FixedArray) |
| 177 // edx: number of elements in properties array | 177 // edx: number of elements in properties array |
| 178 ASSERT(Heap::MaxHeapObjectSize() > | 178 ASSERT(Heap::MaxObjectSizeInPagedSpace() > |
| 179 (FixedArray::kHeaderSize + 255*kPointerSize)); | 179 (FixedArray::kHeaderSize + 255*kPointerSize)); |
| 180 __ lea(ecx, Operand(edi, edx, times_4, FixedArray::kHeaderSize)); | 180 __ lea(ecx, Operand(edi, edx, times_4, FixedArray::kHeaderSize)); |
| 181 __ cmp(ecx, Operand::StaticVariable(new_space_allocation_limit)); | 181 __ cmp(ecx, Operand::StaticVariable(new_space_allocation_limit)); |
| 182 __ j(greater_equal, &undo_allocation); | 182 __ j(greater_equal, &undo_allocation); |
| 183 __ mov(Operand::StaticVariable(new_space_allocation_top), ecx); | 183 __ mov(Operand::StaticVariable(new_space_allocation_top), ecx); |
| 184 | 184 |
| 185 // Initialize the FixedArray. | 185 // Initialize the FixedArray. |
| 186 // ebx: JSObject | 186 // ebx: JSObject |
| 187 // edi: FixedArray | 187 // edi: FixedArray |
| 188 // edx: number of elements | 188 // edx: number of elements |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 // Dont adapt arguments. | 762 // Dont adapt arguments. |
| 763 // ------------------------------------------- | 763 // ------------------------------------------- |
| 764 __ bind(&dont_adapt_arguments); | 764 __ bind(&dont_adapt_arguments); |
| 765 __ jmp(Operand(edx)); | 765 __ jmp(Operand(edx)); |
| 766 } | 766 } |
| 767 | 767 |
| 768 | 768 |
| 769 #undef __ | 769 #undef __ |
| 770 | 770 |
| 771 } } // namespace v8::internal | 771 } } // namespace v8::internal |
| OLD | NEW |