OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 __ CmpInstanceType(ebx, JS_FUNCTION_TYPE); | 1776 __ CmpInstanceType(ebx, JS_FUNCTION_TYPE); |
1777 __ Assert(not_equal, "Function constructed by construct stub."); | 1777 __ Assert(not_equal, "Function constructed by construct stub."); |
1778 #endif | 1778 #endif |
1779 | 1779 |
1780 // Now allocate the JSObject on the heap by moving the new space allocation | 1780 // Now allocate the JSObject on the heap by moving the new space allocation |
1781 // top forward. | 1781 // top forward. |
1782 // edi: constructor | 1782 // edi: constructor |
1783 // ebx: initial map | 1783 // ebx: initial map |
1784 __ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset)); | 1784 __ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset)); |
1785 __ shl(ecx, kPointerSizeLog2); | 1785 __ shl(ecx, kPointerSizeLog2); |
1786 // Make sure that the maximum heap object size will never cause us | |
1787 // problems here. | |
1788 ASSERT(Heap::MaxObjectSizeInPagedSpace() >= JSObject::kMaxInstanceSize); | |
1789 __ AllocateObjectInNewSpace(ecx, | 1786 __ AllocateObjectInNewSpace(ecx, |
1790 edx, | 1787 edx, |
1791 ecx, | 1788 ecx, |
1792 no_reg, | 1789 no_reg, |
1793 &generic_stub_call, | 1790 &generic_stub_call, |
1794 NO_ALLOCATION_FLAGS); | 1791 NO_ALLOCATION_FLAGS); |
1795 | 1792 |
1796 // Allocated the JSObject, now initialize the fields and add the heap tag. | 1793 // Allocated the JSObject, now initialize the fields and add the heap tag. |
1797 // ebx: initial map | 1794 // ebx: initial map |
1798 // edx: JSObject (untagged) | 1795 // edx: JSObject (untagged) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 1867 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
1871 | 1868 |
1872 // Return the generated code. | 1869 // Return the generated code. |
1873 return GetCode(); | 1870 return GetCode(); |
1874 } | 1871 } |
1875 | 1872 |
1876 | 1873 |
1877 #undef __ | 1874 #undef __ |
1878 | 1875 |
1879 } } // namespace v8::internal | 1876 } } // namespace v8::internal |
OLD | NEW |