OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 bool CanExpandOldGeneration(int size) { | 709 bool CanExpandOldGeneration(int size) { |
710 return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize(); | 710 return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize(); |
711 } | 711 } |
712 | 712 |
713 // Returns a deep copy of the JavaScript object. | 713 // Returns a deep copy of the JavaScript object. |
714 // Properties and elements are copied too. | 714 // Properties and elements are copied too. |
715 // Optionally takes an AllocationSite to be appended in an AllocationMemento. | 715 // Optionally takes an AllocationSite to be appended in an AllocationMemento. |
716 MUST_USE_RESULT AllocationResult | 716 MUST_USE_RESULT AllocationResult |
717 CopyJSObject(JSObject* source, AllocationSite* site = NULL); | 717 CopyJSObject(JSObject* source, AllocationSite* site = NULL); |
718 | 718 |
719 // This method assumes overallocation of one word. It will store a filler | 719 static int GetAlignmentSize(Address address, AllocationAlignment alignment); |
720 // before the object if the given object is not double aligned, otherwise | |
721 // it will place the filler after the object. | |
722 MUST_USE_RESULT HeapObject* EnsureAligned(HeapObject* object, int size, | |
723 AllocationAlignment alignment); | |
724 | 720 |
725 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object); | 721 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, |
| 722 int fill_size); |
726 | 723 |
727 // Clear the Instanceof cache (used when a prototype changes). | 724 // Clear the Instanceof cache (used when a prototype changes). |
728 inline void ClearInstanceofCache(); | 725 inline void ClearInstanceofCache(); |
729 | 726 |
730 // Iterates the whole code space to clear all ICs of the given kind. | 727 // Iterates the whole code space to clear all ICs of the given kind. |
731 void ClearAllICsByKind(Code::Kind kind); | 728 void ClearAllICsByKind(Code::Kind kind); |
732 | 729 |
733 // FreeSpace objects have a null map after deserialization. Update the map. | 730 // FreeSpace objects have a null map after deserialization. Update the map. |
734 void RepairFreeListsAfterDeserialization(); | 731 void RepairFreeListsAfterDeserialization(); |
735 | 732 |
(...skipping 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2662 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2659 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2663 | 2660 |
2664 private: | 2661 private: |
2665 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2662 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2666 }; | 2663 }; |
2667 #endif // DEBUG | 2664 #endif // DEBUG |
2668 } | 2665 } |
2669 } // namespace v8::internal | 2666 } // namespace v8::internal |
2670 | 2667 |
2671 #endif // V8_HEAP_HEAP_H_ | 2668 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |