| 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 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 void SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { | 1576 void SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { |
| 1577 ASSERT(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); | 1577 ASSERT(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); |
| 1578 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); | 1578 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 void SetConstructStubDeoptPCOffset(int pc_offset) { | 1581 void SetConstructStubDeoptPCOffset(int pc_offset) { |
| 1582 ASSERT(construct_stub_deopt_pc_offset() == Smi::FromInt(0)); | 1582 ASSERT(construct_stub_deopt_pc_offset() == Smi::FromInt(0)); |
| 1583 set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); | 1583 set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); |
| 1584 } | 1584 } |
| 1585 | 1585 |
| 1586 // For post mortem debugging. |
| 1587 void RememberUnmappedPage(Address page, bool compacted); |
| 1588 |
| 1586 private: | 1589 private: |
| 1587 Heap(); | 1590 Heap(); |
| 1588 | 1591 |
| 1589 // This can be calculated directly from a pointer to the heap; however, it is | 1592 // This can be calculated directly from a pointer to the heap; however, it is |
| 1590 // more expedient to get at the isolate directly from within Heap methods. | 1593 // more expedient to get at the isolate directly from within Heap methods. |
| 1591 Isolate* isolate_; | 1594 Isolate* isolate_; |
| 1592 | 1595 |
| 1593 intptr_t code_range_size_; | 1596 intptr_t code_range_size_; |
| 1594 int reserved_semispace_size_; | 1597 int reserved_semispace_size_; |
| 1595 int max_semispace_size_; | 1598 int max_semispace_size_; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 LargeObjectSpace* lo_space_; | 1630 LargeObjectSpace* lo_space_; |
| 1628 HeapState gc_state_; | 1631 HeapState gc_state_; |
| 1629 int gc_post_processing_depth_; | 1632 int gc_post_processing_depth_; |
| 1630 | 1633 |
| 1631 // Returns the amount of external memory registered since last global gc. | 1634 // Returns the amount of external memory registered since last global gc. |
| 1632 int PromotedExternalMemorySize(); | 1635 int PromotedExternalMemorySize(); |
| 1633 | 1636 |
| 1634 int ms_count_; // how many mark-sweep collections happened | 1637 int ms_count_; // how many mark-sweep collections happened |
| 1635 unsigned int gc_count_; // how many gc happened | 1638 unsigned int gc_count_; // how many gc happened |
| 1636 | 1639 |
| 1640 // For post mortem debugging. |
| 1641 static const int kRememberedUnmappedPages = 128; |
| 1642 int remembered_unmapped_pages_index_; |
| 1643 Address remembered_unmapped_pages_[kRememberedUnmappedPages]; |
| 1644 |
| 1637 // Total length of the strings we failed to flatten since the last GC. | 1645 // Total length of the strings we failed to flatten since the last GC. |
| 1638 int unflattened_strings_length_; | 1646 int unflattened_strings_length_; |
| 1639 | 1647 |
| 1640 #define ROOT_ACCESSOR(type, name, camel_name) \ | 1648 #define ROOT_ACCESSOR(type, name, camel_name) \ |
| 1641 inline void set_##name(type* value) { \ | 1649 inline void set_##name(type* value) { \ |
| 1642 /* The deserializer makes use of the fact that these common roots are */ \ | 1650 /* The deserializer makes use of the fact that these common roots are */ \ |
| 1643 /* never in new space and never on a page that is being compacted. */ \ | 1651 /* never in new space and never on a page that is being compacted. */ \ |
| 1644 ASSERT(k##camel_name##RootIndex >= kOldSpaceRoots || !InNewSpace(value)); \ | 1652 ASSERT(k##camel_name##RootIndex >= kOldSpaceRoots || !InNewSpace(value)); \ |
| 1645 roots_[k##camel_name##RootIndex] = value; \ | 1653 roots_[k##camel_name##RootIndex] = value; \ |
| 1646 } | 1654 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 | 1782 |
| 1775 // Performs garbage collection | 1783 // Performs garbage collection |
| 1776 // Returns whether there is a chance another major GC could | 1784 // Returns whether there is a chance another major GC could |
| 1777 // collect more garbage. | 1785 // collect more garbage. |
| 1778 bool PerformGarbageCollection(GarbageCollector collector, | 1786 bool PerformGarbageCollection(GarbageCollector collector, |
| 1779 GCTracer* tracer); | 1787 GCTracer* tracer); |
| 1780 | 1788 |
| 1781 | 1789 |
| 1782 inline void UpdateOldSpaceLimits(); | 1790 inline void UpdateOldSpaceLimits(); |
| 1783 | 1791 |
| 1784 | |
| 1785 // Allocate an uninitialized object in map space. The behavior is identical | 1792 // Allocate an uninitialized object in map space. The behavior is identical |
| 1786 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't | 1793 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't |
| 1787 // have to test the allocation space argument and (b) can reduce code size | 1794 // have to test the allocation space argument and (b) can reduce code size |
| 1788 // (since both AllocateRaw and AllocateRawMap are inlined). | 1795 // (since both AllocateRaw and AllocateRawMap are inlined). |
| 1789 MUST_USE_RESULT inline MaybeObject* AllocateRawMap(); | 1796 MUST_USE_RESULT inline MaybeObject* AllocateRawMap(); |
| 1790 | 1797 |
| 1791 // Allocate an uninitialized object in the global property cell space. | 1798 // Allocate an uninitialized object in the global property cell space. |
| 1792 MUST_USE_RESULT inline MaybeObject* AllocateRawCell(); | 1799 MUST_USE_RESULT inline MaybeObject* AllocateRawCell(); |
| 1793 | 1800 |
| 1794 // Initializes a JSObject based on its map. | 1801 // Initializes a JSObject based on its map. |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2671 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2678 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
| 2672 | 2679 |
| 2673 private: | 2680 private: |
| 2674 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2681 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2675 }; | 2682 }; |
| 2676 #endif // DEBUG || LIVE_OBJECT_LIST | 2683 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2677 | 2684 |
| 2678 } } // namespace v8::internal | 2685 } } // namespace v8::internal |
| 2679 | 2686 |
| 2680 #endif // V8_HEAP_H_ | 2687 #endif // V8_HEAP_H_ |
| OLD | NEW |