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

Side by Side Diff: runtime/vm/freelist.h

Issue 792163003: Deletion barrier preparation: validate overwritten references. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/freelist.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/bit_set.h" 10 #include "vm/bit_set.h"
11 #include "vm/raw_object.h" 11 #include "vm/raw_object.h"
12 #include "vm/thread.h" 12 #include "vm/thread.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 // FreeListElement describes a freelist element. Smallest FreeListElement is 16 // FreeListElement describes a freelist element. Smallest FreeListElement is
17 // two words in size. Second word of the raw object is used to keep a next_ 17 // two words in size. Second word of the raw object is used to keep a next_
18 // pointer to chain elements of the list together. For objects larger than the 18 // pointer to chain elements of the list together. For objects larger than the
19 // object size encodable in tags field, the size of the element is embedded in 19 // object size encodable in tags field, the size of the element is embedded in
20 // the element at the address following the next_ field. 20 // the element at the address following the next_ field. All words written by
21 // the freelist are guaranteed to look like smis, as required by
22 // TryAllocateSmiInitializedLocked.
21 class FreeListElement { 23 class FreeListElement {
22 public: 24 public:
23 FreeListElement* next() const { 25 FreeListElement* next() const {
24 return next_; 26 return next_;
25 } 27 }
26 uword next_address() const { 28 uword next_address() const {
27 return reinterpret_cast<uword>(&next_); 29 return reinterpret_cast<uword>(&next_);
28 } 30 }
29 31
30 void set_next(FreeListElement* next) { 32 void set_next(FreeListElement* next) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 128
127 // The largest available small size in bytes, or negative if there is none. 129 // The largest available small size in bytes, or negative if there is none.
128 intptr_t last_free_small_size_; 130 intptr_t last_free_small_size_;
129 131
130 DISALLOW_COPY_AND_ASSIGN(FreeList); 132 DISALLOW_COPY_AND_ASSIGN(FreeList);
131 }; 133 };
132 134
133 } // namespace dart 135 } // namespace dart
134 136
135 #endif // VM_FREELIST_H_ 137 #endif // VM_FREELIST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/freelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698