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

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

Issue 1399783002: Add a hash map for a raw object to id mapping, this table will be used during snapshot writing in o… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 years, 2 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
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/weak_table.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_WEAK_TABLE_H_ 5 #ifndef VM_WEAK_TABLE_H_
6 #define VM_WEAK_TABLE_H_ 6 #define VM_WEAK_TABLE_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (obj == key) { 85 if (obj == key) {
86 return ValueAt(idx); 86 return ValueAt(idx);
87 } 87 }
88 idx = (idx + 1) & mask; 88 idx = (idx + 1) & mask;
89 obj = ObjectAt(idx); 89 obj = ObjectAt(idx);
90 } 90 }
91 ASSERT(ValueAt(idx) == 0); 91 ASSERT(ValueAt(idx) == 0);
92 return 0; 92 return 0;
93 } 93 }
94 94
95 void Reset();
96
95 private: 97 private:
96 enum { 98 enum {
97 kObjectOffset = 0, 99 kObjectOffset = 0,
98 kValueOffset, 100 kValueOffset,
99 kEntrySize, 101 kEntrySize,
100 }; 102 };
101 103
102 static const intptr_t kDeletedEntry = 1; // Equivalent to a tagged NULL. 104 static const intptr_t kDeletedEntry = 1; // Equivalent to a tagged NULL.
103 static const intptr_t kMinSize = 8; 105 static const intptr_t kMinSize = 8;
104 106
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 intptr_t size_; 165 intptr_t size_;
164 intptr_t used_; 166 intptr_t used_;
165 intptr_t count_; 167 intptr_t count_;
166 168
167 DISALLOW_COPY_AND_ASSIGN(WeakTable); 169 DISALLOW_COPY_AND_ASSIGN(WeakTable);
168 }; 170 };
169 171
170 } // namespace dart 172 } // namespace dart
171 173
172 #endif // VM_WEAK_TABLE_H_ 174 #endif // VM_WEAK_TABLE_H_
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/weak_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698