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 GetMaximumMisalignment(AllocationAlignment alignment); |
720 // before the object if the given object is not double aligned, otherwise | 720 static int GetMisalignment(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 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, |
| 723 int filler_size); |
726 | 724 |
727 // Clear the Instanceof cache (used when a prototype changes). | 725 // Clear the Instanceof cache (used when a prototype changes). |
728 inline void ClearInstanceofCache(); | 726 inline void ClearInstanceofCache(); |
729 | 727 |
730 // Iterates the whole code space to clear all ICs of the given kind. | 728 // Iterates the whole code space to clear all ICs of the given kind. |
731 void ClearAllICsByKind(Code::Kind kind); | 729 void ClearAllICsByKind(Code::Kind kind); |
732 | 730 |
733 // FreeSpace objects have a null map after deserialization. Update the map. | 731 // FreeSpace objects have a null map after deserialization. Update the map. |
734 void RepairFreeListsAfterDeserialization(); | 732 void RepairFreeListsAfterDeserialization(); |
735 | 733 |
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2694 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2692 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2695 | 2693 |
2696 private: | 2694 private: |
2697 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2695 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2698 }; | 2696 }; |
2699 #endif // DEBUG | 2697 #endif // DEBUG |
2700 } | 2698 } |
2701 } // namespace v8::internal | 2699 } // namespace v8::internal |
2702 | 2700 |
2703 #endif // V8_HEAP_HEAP_H_ | 2701 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |