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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
708 // committed memory size. | 708 // committed memory size. |
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 |
Hannes Payer (out of office)
2015/05/26 09:22:29
Please add comments about what these functions are
bbudge
2015/05/26 11:09:18
Done.
| |
719 // This method assumes overallocation of one word. It will store a filler | 719 static int GetMaximumFillToAlign(AllocationAlignment alignment); |
720 // before the object if the given object is not double aligned, otherwise | 720 static int GetFillToAlign(Address address, AllocationAlignment alignment); |
721 // it will place the filler after the object. | |
722 MUST_USE_RESULT HeapObject* EnsureAligned(HeapObject* object, int size, | |
723 AllocationAlignment alignment); | |
724 | 721 |
725 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object); | 722 // Creates a filler object and returns a heap object immediately after it. |
723 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, | |
724 int filler_size); | |
725 // Creates a filler object if needed for alignment and returns a heap object | |
726 // immediately after it. If any space is left after the returned object, | |
727 // another filler object is created so the over allocated memory is iterable. | |
728 MUST_USE_RESULT HeapObject* AlignWithFiller(HeapObject* object, | |
729 int object_size, | |
730 int allocation_size, | |
731 AllocationAlignment alignment); | |
726 | 732 |
727 // Clear the Instanceof cache (used when a prototype changes). | 733 // Clear the Instanceof cache (used when a prototype changes). |
728 inline void ClearInstanceofCache(); | 734 inline void ClearInstanceofCache(); |
729 | 735 |
730 // Iterates the whole code space to clear all ICs of the given kind. | 736 // Iterates the whole code space to clear all ICs of the given kind. |
731 void ClearAllICsByKind(Code::Kind kind); | 737 void ClearAllICsByKind(Code::Kind kind); |
732 | 738 |
733 // FreeSpace objects have a null map after deserialization. Update the map. | 739 // FreeSpace objects have a null map after deserialization. Update the map. |
734 void RepairFreeListsAfterDeserialization(); | 740 void RepairFreeListsAfterDeserialization(); |
735 | 741 |
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2696 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2702 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2697 | 2703 |
2698 private: | 2704 private: |
2699 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2705 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2700 }; | 2706 }; |
2701 #endif // DEBUG | 2707 #endif // DEBUG |
2702 } | 2708 } |
2703 } // namespace v8::internal | 2709 } // namespace v8::internal |
2704 | 2710 |
2705 #endif // V8_HEAP_HEAP_H_ | 2711 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |