| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 if (external_string_table_.old_space_strings_.length() > 0) { | 1712 if (external_string_table_.old_space_strings_.length() > 0) { |
| 1713 Object** start = &external_string_table_.old_space_strings_[0]; | 1713 Object** start = &external_string_table_.old_space_strings_[0]; |
| 1714 Object** end = start + external_string_table_.old_space_strings_.length(); | 1714 Object** end = start + external_string_table_.old_space_strings_.length(); |
| 1715 for (Object** p = start; p < end; ++p) *p = updater_func(this, p); | 1715 for (Object** p = start; p < end; ++p) *p = updater_func(this, p); |
| 1716 } | 1716 } |
| 1717 | 1717 |
| 1718 UpdateNewSpaceReferencesInExternalStringTable(updater_func); | 1718 UpdateNewSpaceReferencesInExternalStringTable(updater_func); |
| 1719 } | 1719 } |
| 1720 | 1720 |
| 1721 | 1721 |
| 1722 template <class T> | |
| 1723 struct WeakListVisitor; | |
| 1724 | |
| 1725 | |
| 1726 template <class T> | |
| 1727 static Object* VisitWeakList(Heap* heap, | |
| 1728 Object* list, | |
| 1729 WeakObjectRetainer* retainer, | |
| 1730 bool record_slots) { | |
| 1731 Object* undefined = heap->undefined_value(); | |
| 1732 Object* head = undefined; | |
| 1733 T* tail = NULL; | |
| 1734 MarkCompactCollector* collector = heap->mark_compact_collector(); | |
| 1735 while (list != undefined) { | |
| 1736 // Check whether to keep the candidate in the list. | |
| 1737 T* candidate = reinterpret_cast<T*>(list); | |
| 1738 Object* retained = retainer->RetainAs(list); | |
| 1739 if (retained != NULL) { | |
| 1740 if (head == undefined) { | |
| 1741 // First element in the list. | |
| 1742 head = retained; | |
| 1743 } else { | |
| 1744 // Subsequent elements in the list. | |
| 1745 ASSERT(tail != NULL); | |
| 1746 WeakListVisitor<T>::SetWeakNext(tail, retained); | |
| 1747 if (record_slots) { | |
| 1748 Object** next_slot = | |
| 1749 HeapObject::RawField(tail, WeakListVisitor<T>::WeakNextOffset()); | |
| 1750 collector->RecordSlot(next_slot, next_slot, retained); | |
| 1751 } | |
| 1752 } | |
| 1753 // Retained object is new tail. | |
| 1754 ASSERT(!retained->IsUndefined()); | |
| 1755 candidate = reinterpret_cast<T*>(retained); | |
| 1756 tail = candidate; | |
| 1757 | |
| 1758 | |
| 1759 // tail is a live object, visit it. | |
| 1760 WeakListVisitor<T>::VisitLiveObject( | |
| 1761 heap, tail, retainer, record_slots); | |
| 1762 } else { | |
| 1763 WeakListVisitor<T>::VisitPhantomObject(heap, candidate); | |
| 1764 } | |
| 1765 | |
| 1766 // Move to next element in the list. | |
| 1767 list = WeakListVisitor<T>::WeakNext(candidate); | |
| 1768 } | |
| 1769 | |
| 1770 // Terminate the list if there is one or more elements. | |
| 1771 if (tail != NULL) { | |
| 1772 WeakListVisitor<T>::SetWeakNext(tail, undefined); | |
| 1773 } | |
| 1774 return head; | |
| 1775 } | |
| 1776 | |
| 1777 | |
| 1778 template <class T> | |
| 1779 static void ClearWeakList(Heap* heap, | |
| 1780 Object* list) { | |
| 1781 Object* undefined = heap->undefined_value(); | |
| 1782 while (list != undefined) { | |
| 1783 T* candidate = reinterpret_cast<T*>(list); | |
| 1784 list = WeakListVisitor<T>::WeakNext(candidate); | |
| 1785 WeakListVisitor<T>::SetWeakNext(candidate, undefined); | |
| 1786 } | |
| 1787 } | |
| 1788 | |
| 1789 | |
| 1790 template<> | |
| 1791 struct WeakListVisitor<JSFunction> { | |
| 1792 static void SetWeakNext(JSFunction* function, Object* next) { | |
| 1793 function->set_next_function_link(next); | |
| 1794 } | |
| 1795 | |
| 1796 static Object* WeakNext(JSFunction* function) { | |
| 1797 return function->next_function_link(); | |
| 1798 } | |
| 1799 | |
| 1800 static int WeakNextOffset() { | |
| 1801 return JSFunction::kNextFunctionLinkOffset; | |
| 1802 } | |
| 1803 | |
| 1804 static void VisitLiveObject(Heap*, JSFunction*, | |
| 1805 WeakObjectRetainer*, bool) { | |
| 1806 } | |
| 1807 | |
| 1808 static void VisitPhantomObject(Heap*, JSFunction*) { | |
| 1809 } | |
| 1810 }; | |
| 1811 | |
| 1812 | |
| 1813 template<> | |
| 1814 struct WeakListVisitor<Code> { | |
| 1815 static void SetWeakNext(Code* code, Object* next) { | |
| 1816 code->set_next_code_link(next); | |
| 1817 } | |
| 1818 | |
| 1819 static Object* WeakNext(Code* code) { | |
| 1820 return code->next_code_link(); | |
| 1821 } | |
| 1822 | |
| 1823 static int WeakNextOffset() { | |
| 1824 return Code::kNextCodeLinkOffset; | |
| 1825 } | |
| 1826 | |
| 1827 static void VisitLiveObject(Heap*, Code*, | |
| 1828 WeakObjectRetainer*, bool) { | |
| 1829 } | |
| 1830 | |
| 1831 static void VisitPhantomObject(Heap*, Code*) { | |
| 1832 } | |
| 1833 }; | |
| 1834 | |
| 1835 | |
| 1836 template<> | |
| 1837 struct WeakListVisitor<Context> { | |
| 1838 static void SetWeakNext(Context* context, Object* next) { | |
| 1839 context->set(Context::NEXT_CONTEXT_LINK, | |
| 1840 next, | |
| 1841 UPDATE_WRITE_BARRIER); | |
| 1842 } | |
| 1843 | |
| 1844 static Object* WeakNext(Context* context) { | |
| 1845 return context->get(Context::NEXT_CONTEXT_LINK); | |
| 1846 } | |
| 1847 | |
| 1848 static void VisitLiveObject(Heap* heap, | |
| 1849 Context* context, | |
| 1850 WeakObjectRetainer* retainer, | |
| 1851 bool record_slots) { | |
| 1852 // Process the three weak lists linked off the context. | |
| 1853 DoWeakList<JSFunction>(heap, context, retainer, record_slots, | |
| 1854 Context::OPTIMIZED_FUNCTIONS_LIST); | |
| 1855 DoWeakList<Code>(heap, context, retainer, record_slots, | |
| 1856 Context::OPTIMIZED_CODE_LIST); | |
| 1857 DoWeakList<Code>(heap, context, retainer, record_slots, | |
| 1858 Context::DEOPTIMIZED_CODE_LIST); | |
| 1859 } | |
| 1860 | |
| 1861 template<class T> | |
| 1862 static void DoWeakList(Heap* heap, | |
| 1863 Context* context, | |
| 1864 WeakObjectRetainer* retainer, | |
| 1865 bool record_slots, | |
| 1866 int index) { | |
| 1867 // Visit the weak list, removing dead intermediate elements. | |
| 1868 Object* list_head = VisitWeakList<T>(heap, context->get(index), retainer, | |
| 1869 record_slots); | |
| 1870 | |
| 1871 // Update the list head. | |
| 1872 context->set(index, list_head, UPDATE_WRITE_BARRIER); | |
| 1873 | |
| 1874 if (record_slots) { | |
| 1875 // Record the updated slot if necessary. | |
| 1876 Object** head_slot = HeapObject::RawField( | |
| 1877 context, FixedArray::SizeFor(index)); | |
| 1878 heap->mark_compact_collector()->RecordSlot( | |
| 1879 head_slot, head_slot, list_head); | |
| 1880 } | |
| 1881 } | |
| 1882 | |
| 1883 static void VisitPhantomObject(Heap* heap, Context* context) { | |
| 1884 ClearWeakList<JSFunction>(heap, | |
| 1885 context->get(Context::OPTIMIZED_FUNCTIONS_LIST)); | |
| 1886 ClearWeakList<Code>(heap, context->get(Context::OPTIMIZED_CODE_LIST)); | |
| 1887 ClearWeakList<Code>(heap, context->get(Context::DEOPTIMIZED_CODE_LIST)); | |
| 1888 } | |
| 1889 | |
| 1890 static int WeakNextOffset() { | |
| 1891 return FixedArray::SizeFor(Context::NEXT_CONTEXT_LINK); | |
| 1892 } | |
| 1893 }; | |
| 1894 | |
| 1895 | |
| 1896 void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) { | 1722 void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) { |
| 1897 // We don't record weak slots during marking or scavenges. | 1723 // We don't record weak slots during marking or scavenges. |
| 1898 // Instead we do it once when we complete mark-compact cycle. | 1724 // Instead we do it once when we complete mark-compact cycle. |
| 1899 // Note that write barrier has no effect if we are already in the middle of | 1725 // Note that write barrier has no effect if we are already in the middle of |
| 1900 // compacting mark-sweep cycle and we have to record slots manually. | 1726 // compacting mark-sweep cycle and we have to record slots manually. |
| 1901 bool record_slots = | 1727 bool record_slots = |
| 1902 gc_state() == MARK_COMPACT && | 1728 gc_state() == MARK_COMPACT && |
| 1903 mark_compact_collector()->is_compacting(); | 1729 mark_compact_collector()->is_compacting(); |
| 1904 ProcessArrayBuffers(retainer, record_slots); | 1730 ProcessArrayBuffers(retainer, record_slots); |
| 1905 ProcessNativeContexts(retainer, record_slots); | 1731 ProcessNativeContexts(retainer, record_slots); |
| 1906 // TODO(mvstanton): AllocationSites only need to be processed during | 1732 // TODO(mvstanton): AllocationSites only need to be processed during |
| 1907 // MARK_COMPACT, as they live in old space. Verify and address. | 1733 // MARK_COMPACT, as they live in old space. Verify and address. |
| 1908 ProcessAllocationSites(retainer, record_slots); | 1734 ProcessAllocationSites(retainer, record_slots); |
| 1909 } | 1735 } |
| 1910 | 1736 |
| 1911 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer, | 1737 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer, |
| 1912 bool record_slots) { | 1738 bool record_slots) { |
| 1913 Object* head = | 1739 Object* head = |
| 1914 VisitWeakList<Context>( | 1740 VisitWeakList<Context>( |
| 1915 this, native_contexts_list(), retainer, record_slots); | 1741 this, native_contexts_list(), retainer, record_slots); |
| 1916 // Update the head of the list of contexts. | 1742 // Update the head of the list of contexts. |
| 1917 native_contexts_list_ = head; | 1743 native_contexts_list_ = head; |
| 1918 } | 1744 } |
| 1919 | 1745 |
| 1920 | 1746 |
| 1921 template<> | |
| 1922 struct WeakListVisitor<JSArrayBufferView> { | |
| 1923 static void SetWeakNext(JSArrayBufferView* obj, Object* next) { | |
| 1924 obj->set_weak_next(next); | |
| 1925 } | |
| 1926 | |
| 1927 static Object* WeakNext(JSArrayBufferView* obj) { | |
| 1928 return obj->weak_next(); | |
| 1929 } | |
| 1930 | |
| 1931 static void VisitLiveObject(Heap*, | |
| 1932 JSArrayBufferView* obj, | |
| 1933 WeakObjectRetainer* retainer, | |
| 1934 bool record_slots) {} | |
| 1935 | |
| 1936 static void VisitPhantomObject(Heap*, JSArrayBufferView*) {} | |
| 1937 | |
| 1938 static int WeakNextOffset() { | |
| 1939 return JSArrayBufferView::kWeakNextOffset; | |
| 1940 } | |
| 1941 }; | |
| 1942 | |
| 1943 | |
| 1944 template<> | |
| 1945 struct WeakListVisitor<JSArrayBuffer> { | |
| 1946 static void SetWeakNext(JSArrayBuffer* obj, Object* next) { | |
| 1947 obj->set_weak_next(next); | |
| 1948 } | |
| 1949 | |
| 1950 static Object* WeakNext(JSArrayBuffer* obj) { | |
| 1951 return obj->weak_next(); | |
| 1952 } | |
| 1953 | |
| 1954 static void VisitLiveObject(Heap* heap, | |
| 1955 JSArrayBuffer* array_buffer, | |
| 1956 WeakObjectRetainer* retainer, | |
| 1957 bool record_slots) { | |
| 1958 Object* typed_array_obj = | |
| 1959 VisitWeakList<JSArrayBufferView>( | |
| 1960 heap, | |
| 1961 array_buffer->weak_first_view(), | |
| 1962 retainer, record_slots); | |
| 1963 array_buffer->set_weak_first_view(typed_array_obj); | |
| 1964 if (typed_array_obj != heap->undefined_value() && record_slots) { | |
| 1965 Object** slot = HeapObject::RawField( | |
| 1966 array_buffer, JSArrayBuffer::kWeakFirstViewOffset); | |
| 1967 heap->mark_compact_collector()->RecordSlot(slot, slot, typed_array_obj); | |
| 1968 } | |
| 1969 } | |
| 1970 | |
| 1971 static void VisitPhantomObject(Heap* heap, JSArrayBuffer* phantom) { | |
| 1972 Runtime::FreeArrayBuffer(heap->isolate(), phantom); | |
| 1973 } | |
| 1974 | |
| 1975 static int WeakNextOffset() { | |
| 1976 return JSArrayBuffer::kWeakNextOffset; | |
| 1977 } | |
| 1978 }; | |
| 1979 | |
| 1980 | |
| 1981 void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer, | 1747 void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer, |
| 1982 bool record_slots) { | 1748 bool record_slots) { |
| 1983 Object* array_buffer_obj = | 1749 Object* array_buffer_obj = |
| 1984 VisitWeakList<JSArrayBuffer>(this, | 1750 VisitWeakList<JSArrayBuffer>(this, |
| 1985 array_buffers_list(), | 1751 array_buffers_list(), |
| 1986 retainer, record_slots); | 1752 retainer, record_slots); |
| 1987 set_array_buffers_list(array_buffer_obj); | 1753 set_array_buffers_list(array_buffer_obj); |
| 1988 } | 1754 } |
| 1989 | 1755 |
| 1990 | 1756 |
| 1991 void Heap::TearDownArrayBuffers() { | 1757 void Heap::TearDownArrayBuffers() { |
| 1992 Object* undefined = undefined_value(); | 1758 Object* undefined = undefined_value(); |
| 1993 for (Object* o = array_buffers_list(); o != undefined;) { | 1759 for (Object* o = array_buffers_list(); o != undefined;) { |
| 1994 JSArrayBuffer* buffer = JSArrayBuffer::cast(o); | 1760 JSArrayBuffer* buffer = JSArrayBuffer::cast(o); |
| 1995 Runtime::FreeArrayBuffer(isolate(), buffer); | 1761 Runtime::FreeArrayBuffer(isolate(), buffer); |
| 1996 o = buffer->weak_next(); | 1762 o = buffer->weak_next(); |
| 1997 } | 1763 } |
| 1998 array_buffers_list_ = undefined; | 1764 array_buffers_list_ = undefined; |
| 1999 } | 1765 } |
| 2000 | 1766 |
| 2001 | 1767 |
| 2002 template<> | |
| 2003 struct WeakListVisitor<AllocationSite> { | |
| 2004 static void SetWeakNext(AllocationSite* obj, Object* next) { | |
| 2005 obj->set_weak_next(next); | |
| 2006 } | |
| 2007 | |
| 2008 static Object* WeakNext(AllocationSite* obj) { | |
| 2009 return obj->weak_next(); | |
| 2010 } | |
| 2011 | |
| 2012 static void VisitLiveObject(Heap* heap, | |
| 2013 AllocationSite* site, | |
| 2014 WeakObjectRetainer* retainer, | |
| 2015 bool record_slots) {} | |
| 2016 | |
| 2017 static void VisitPhantomObject(Heap* heap, AllocationSite* phantom) {} | |
| 2018 | |
| 2019 static int WeakNextOffset() { | |
| 2020 return AllocationSite::kWeakNextOffset; | |
| 2021 } | |
| 2022 }; | |
| 2023 | |
| 2024 | |
| 2025 void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer, | 1768 void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer, |
| 2026 bool record_slots) { | 1769 bool record_slots) { |
| 2027 Object* allocation_site_obj = | 1770 Object* allocation_site_obj = |
| 2028 VisitWeakList<AllocationSite>(this, | 1771 VisitWeakList<AllocationSite>(this, |
| 2029 allocation_sites_list(), | 1772 allocation_sites_list(), |
| 2030 retainer, record_slots); | 1773 retainer, record_slots); |
| 2031 set_allocation_sites_list(allocation_site_obj); | 1774 set_allocation_sites_list(allocation_site_obj); |
| 2032 } | 1775 } |
| 2033 | 1776 |
| 2034 | 1777 |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2653 map->set_visitor_id( | 2396 map->set_visitor_id( |
| 2654 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); | 2397 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); |
| 2655 map->set_prototype(null_value(), SKIP_WRITE_BARRIER); | 2398 map->set_prototype(null_value(), SKIP_WRITE_BARRIER); |
| 2656 map->set_constructor(null_value(), SKIP_WRITE_BARRIER); | 2399 map->set_constructor(null_value(), SKIP_WRITE_BARRIER); |
| 2657 map->set_instance_size(instance_size); | 2400 map->set_instance_size(instance_size); |
| 2658 map->set_inobject_properties(0); | 2401 map->set_inobject_properties(0); |
| 2659 map->set_pre_allocated_property_fields(0); | 2402 map->set_pre_allocated_property_fields(0); |
| 2660 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); | 2403 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 2661 map->set_dependent_code(DependentCode::cast(empty_fixed_array()), | 2404 map->set_dependent_code(DependentCode::cast(empty_fixed_array()), |
| 2662 SKIP_WRITE_BARRIER); | 2405 SKIP_WRITE_BARRIER); |
| 2406 map->set_dependent_ic(undefined_value(), SKIP_WRITE_BARRIER); |
| 2663 map->init_back_pointer(undefined_value()); | 2407 map->init_back_pointer(undefined_value()); |
| 2664 map->set_unused_property_fields(0); | 2408 map->set_unused_property_fields(0); |
| 2665 map->set_instance_descriptors(empty_descriptor_array()); | 2409 map->set_instance_descriptors(empty_descriptor_array()); |
| 2666 map->set_bit_field(0); | 2410 map->set_bit_field(0); |
| 2667 map->set_bit_field2(1 << Map::kIsExtensible); | 2411 map->set_bit_field2(1 << Map::kIsExtensible); |
| 2668 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | | 2412 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | |
| 2669 Map::OwnsDescriptors::encode(true); | 2413 Map::OwnsDescriptors::encode(true); |
| 2670 map->set_bit_field3(bit_field3); | 2414 map->set_bit_field3(bit_field3); |
| 2671 map->set_elements_kind(elements_kind); | 2415 map->set_elements_kind(elements_kind); |
| 2672 | 2416 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2801 | 2545 |
| 2802 // Allocate the constant pool array. | 2546 // Allocate the constant pool array. |
| 2803 { MaybeObject* maybe_obj = AllocateEmptyConstantPoolArray(); | 2547 { MaybeObject* maybe_obj = AllocateEmptyConstantPoolArray(); |
| 2804 if (!maybe_obj->ToObject(&obj)) return false; | 2548 if (!maybe_obj->ToObject(&obj)) return false; |
| 2805 } | 2549 } |
| 2806 set_empty_constant_pool_array(ConstantPoolArray::cast(obj)); | 2550 set_empty_constant_pool_array(ConstantPoolArray::cast(obj)); |
| 2807 | 2551 |
| 2808 // Fix the instance_descriptors for the existing maps. | 2552 // Fix the instance_descriptors for the existing maps. |
| 2809 meta_map()->set_code_cache(empty_fixed_array()); | 2553 meta_map()->set_code_cache(empty_fixed_array()); |
| 2810 meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | 2554 meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); |
| 2555 meta_map()->set_dependent_ic(undefined_value()); |
| 2811 meta_map()->init_back_pointer(undefined_value()); | 2556 meta_map()->init_back_pointer(undefined_value()); |
| 2812 meta_map()->set_instance_descriptors(empty_descriptor_array()); | 2557 meta_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2813 | 2558 |
| 2814 fixed_array_map()->set_code_cache(empty_fixed_array()); | 2559 fixed_array_map()->set_code_cache(empty_fixed_array()); |
| 2815 fixed_array_map()->set_dependent_code( | 2560 fixed_array_map()->set_dependent_code( |
| 2816 DependentCode::cast(empty_fixed_array())); | 2561 DependentCode::cast(empty_fixed_array())); |
| 2562 fixed_array_map()->set_dependent_ic(undefined_value()); |
| 2817 fixed_array_map()->init_back_pointer(undefined_value()); | 2563 fixed_array_map()->init_back_pointer(undefined_value()); |
| 2818 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); | 2564 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2819 | 2565 |
| 2820 oddball_map()->set_code_cache(empty_fixed_array()); | 2566 oddball_map()->set_code_cache(empty_fixed_array()); |
| 2821 oddball_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | 2567 oddball_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); |
| 2568 oddball_map()->set_dependent_ic(undefined_value()); |
| 2822 oddball_map()->init_back_pointer(undefined_value()); | 2569 oddball_map()->init_back_pointer(undefined_value()); |
| 2823 oddball_map()->set_instance_descriptors(empty_descriptor_array()); | 2570 oddball_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2824 | 2571 |
| 2825 constant_pool_array_map()->set_code_cache(empty_fixed_array()); | 2572 constant_pool_array_map()->set_code_cache(empty_fixed_array()); |
| 2826 constant_pool_array_map()->set_dependent_code( | 2573 constant_pool_array_map()->set_dependent_code( |
| 2827 DependentCode::cast(empty_fixed_array())); | 2574 DependentCode::cast(empty_fixed_array())); |
| 2575 constant_pool_array_map()->set_dependent_ic(undefined_value()); |
| 2828 constant_pool_array_map()->init_back_pointer(undefined_value()); | 2576 constant_pool_array_map()->init_back_pointer(undefined_value()); |
| 2829 constant_pool_array_map()->set_instance_descriptors(empty_descriptor_array()); | 2577 constant_pool_array_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2830 | 2578 |
| 2831 // Fix prototype object for existing maps. | 2579 // Fix prototype object for existing maps. |
| 2832 meta_map()->set_prototype(null_value()); | 2580 meta_map()->set_prototype(null_value()); |
| 2833 meta_map()->set_constructor(null_value()); | 2581 meta_map()->set_constructor(null_value()); |
| 2834 | 2582 |
| 2835 fixed_array_map()->set_prototype(null_value()); | 2583 fixed_array_map()->set_prototype(null_value()); |
| 2836 fixed_array_map()->set_constructor(null_value()); | 2584 fixed_array_map()->set_constructor(null_value()); |
| 2837 | 2585 |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4174 code->set_raw_kind_specific_flags2(0); | 3922 code->set_raw_kind_specific_flags2(0); |
| 4175 code->set_is_crankshafted(crankshafted); | 3923 code->set_is_crankshafted(crankshafted); |
| 4176 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3924 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 4177 code->set_raw_type_feedback_info(undefined_value()); | 3925 code->set_raw_type_feedback_info(undefined_value()); |
| 4178 code->set_next_code_link(undefined_value()); | 3926 code->set_next_code_link(undefined_value()); |
| 4179 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3927 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 4180 code->set_gc_metadata(Smi::FromInt(0)); | 3928 code->set_gc_metadata(Smi::FromInt(0)); |
| 4181 code->set_ic_age(global_ic_age_); | 3929 code->set_ic_age(global_ic_age_); |
| 4182 code->set_prologue_offset(prologue_offset); | 3930 code->set_prologue_offset(prologue_offset); |
| 4183 if (code->kind() == Code::OPTIMIZED_FUNCTION) { | 3931 if (code->kind() == Code::OPTIMIZED_FUNCTION) { |
| 4184 code->set_marked_for_deoptimization(false); | 3932 ASSERT(!code->marked_for_deoptimization()); |
| 3933 } |
| 3934 if (code->is_inline_cache_stub()) { |
| 3935 ASSERT(!code->is_weak_stub()); |
| 3936 ASSERT(!code->is_invalidated_weak_stub()); |
| 4185 } | 3937 } |
| 4186 | 3938 |
| 4187 if (FLAG_enable_ool_constant_pool) { | 3939 if (FLAG_enable_ool_constant_pool) { |
| 4188 desc.origin->PopulateConstantPool(constant_pool); | 3940 desc.origin->PopulateConstantPool(constant_pool); |
| 4189 } | 3941 } |
| 4190 code->set_constant_pool(constant_pool); | 3942 code->set_constant_pool(constant_pool); |
| 4191 | 3943 |
| 4192 #ifdef ENABLE_DEBUGGER_SUPPORT | 3944 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 4193 if (code->kind() == Code::FUNCTION) { | 3945 if (code->kind() == Code::FUNCTION) { |
| 4194 code->set_has_debug_break_slots( | 3946 code->set_has_debug_break_slots( |
| (...skipping 3670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7865 static_cast<int>(object_sizes_last_time_[index])); | 7617 static_cast<int>(object_sizes_last_time_[index])); |
| 7866 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7618 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7867 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7619 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7868 | 7620 |
| 7869 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7621 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 7870 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7622 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 7871 ClearObjectStats(); | 7623 ClearObjectStats(); |
| 7872 } | 7624 } |
| 7873 | 7625 |
| 7874 } } // namespace v8::internal | 7626 } } // namespace v8::internal |
| OLD | NEW |