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

Side by Side Diff: vm/freelist.h

Issue 8898034: - Implement the old sweeper. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « tests/vm/vm.status ('k') | vm/gc_marker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_FREELIST_H_ 5 #ifndef VM_FREELIST_H_
6 #define VM_FREELIST_H_ 6 #define VM_FREELIST_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assert.h" 9 #include "vm/assert.h"
10 #include "vm/raw_object.h" 10 #include "vm/raw_object.h"
(...skipping 15 matching lines...) Expand all
26 intptr_t Size() const { 26 intptr_t Size() const {
27 if (class_ == minimal_element_class_) { 27 if (class_ == minimal_element_class_) {
28 return kObjectAlignment; 28 return kObjectAlignment;
29 } 29 }
30 ASSERT(class_ == element_class_); 30 ASSERT(class_ == element_class_);
31 return *SizeAddress(); 31 return *SizeAddress();
32 } 32 }
33 33
34 static FreeListElement* AsElement(uword addr, intptr_t size); 34 static FreeListElement* AsElement(uword addr, intptr_t size);
35 35
36 static bool IsSpecialClass(RawObject* raw_obj) {
37 return (raw_obj == minimal_element_class_) || (raw_obj == element_class_);
38 }
39
36 static void InitOnce(); 40 static void InitOnce();
37 41
38 private: 42 private:
39 // This layout mirrors the layout of RawObject. 43 // This layout mirrors the layout of RawObject.
40 RawClass* class_; 44 RawClass* class_;
41 FreeListElement* next_; 45 FreeListElement* next_;
42 46
43 // Returns the address of the embedded size. 47 // Returns the address of the embedded size.
44 intptr_t* SizeAddress() const { 48 intptr_t* SizeAddress() const {
45 ASSERT(class_ == element_class_); 49 ASSERT(class_ == element_class_);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size); 89 void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size);
86 90
87 FreeListElement* free_lists_[kNumLists + 1]; 91 FreeListElement* free_lists_[kNumLists + 1];
88 92
89 DISALLOW_COPY_AND_ASSIGN(FreeList); 93 DISALLOW_COPY_AND_ASSIGN(FreeList);
90 }; 94 };
91 95
92 } // namespace dart 96 } // namespace dart
93 97
94 #endif // VM_FREELIST_H_ 98 #endif // VM_FREELIST_H_
OLDNEW
« no previous file with comments | « tests/vm/vm.status ('k') | vm/gc_marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698