Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: src/heap/heap.h

Issue 1150593003: Clean up aligned allocation code in preparation for SIMD alignments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle filler after object. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« src/globals.h ('K') | « src/globals.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698