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

Side by Side Diff: src/serialize.h

Issue 877753007: Reland "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.". (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: VS201x now happy? Created 5 years, 10 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 | « src/runtime/runtime-array.cc ('k') | src/serialize.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 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_SERIALIZE_H_ 5 #ifndef V8_SERIALIZE_H_
6 #define V8_SERIALIZE_H_ 6 #define V8_SERIALIZE_H_
7 7
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/hashmap.h" 9 #include "src/hashmap.h"
10 #include "src/heap-profiler.h" 10 #include "src/heap-profiler.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 ~BackReferenceMap() { delete map_; } 269 ~BackReferenceMap() { delete map_; }
270 270
271 BackReference Lookup(HeapObject* obj) { 271 BackReference Lookup(HeapObject* obj) {
272 HashMap::Entry* entry = LookupEntry(map_, obj, false); 272 HashMap::Entry* entry = LookupEntry(map_, obj, false);
273 return entry ? BackReference(GetValue(entry)) : BackReference(); 273 return entry ? BackReference(GetValue(entry)) : BackReference();
274 } 274 }
275 275
276 void Add(HeapObject* obj, BackReference b) { 276 void Add(HeapObject* obj, BackReference b) {
277 DCHECK(b.is_valid()); 277 DCHECK(b.is_valid());
278 DCHECK_EQ(NULL, LookupEntry(map_, obj, false)); 278 DCHECK_NULL(LookupEntry(map_, obj, false));
279 HashMap::Entry* entry = LookupEntry(map_, obj, true); 279 HashMap::Entry* entry = LookupEntry(map_, obj, true);
280 SetValue(entry, b.bitfield()); 280 SetValue(entry, b.bitfield());
281 } 281 }
282 282
283 void AddSourceString(String* string) { 283 void AddSourceString(String* string) {
284 Add(string, BackReference::SourceReference()); 284 Add(string, BackReference::SourceReference());
285 } 285 }
286 286
287 void AddGlobalProxy(HeapObject* global_proxy) { 287 void AddGlobalProxy(HeapObject* global_proxy) {
288 Add(global_proxy, BackReference::GlobalProxyReference()); 288 Add(global_proxy, BackReference::GlobalProxyReference());
(...skipping 11 matching lines...) Expand all
300 HotObjectsList() : index_(0) { 300 HotObjectsList() : index_(0) {
301 for (int i = 0; i < kSize; i++) circular_queue_[i] = NULL; 301 for (int i = 0; i < kSize; i++) circular_queue_[i] = NULL;
302 } 302 }
303 303
304 void Add(HeapObject* object) { 304 void Add(HeapObject* object) {
305 circular_queue_[index_] = object; 305 circular_queue_[index_] = object;
306 index_ = (index_ + 1) & kSizeMask; 306 index_ = (index_ + 1) & kSizeMask;
307 } 307 }
308 308
309 HeapObject* Get(int index) { 309 HeapObject* Get(int index) {
310 DCHECK_NE(NULL, circular_queue_[index]); 310 DCHECK_NOT_NULL(circular_queue_[index]);
311 return circular_queue_[index]; 311 return circular_queue_[index];
312 } 312 }
313 313
314 static const int kNotFound = -1; 314 static const int kNotFound = -1;
315 315
316 int Find(HeapObject* object) { 316 int Find(HeapObject* object) {
317 for (int i = 0; i < kSize; i++) { 317 for (int i = 0; i < kSize; i++) {
318 if (circular_queue_[i] == object) return i; 318 if (circular_queue_[i] == object) return i;
319 } 319 }
320 return kNotFound; 320 return kNotFound;
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 static const int kCheckSumOffset = 0; 959 static const int kCheckSumOffset = 0;
960 static const int kNumInternalizedStringsOffset = 1; 960 static const int kNumInternalizedStringsOffset = 1;
961 static const int kReservationsOffset = 2; 961 static const int kReservationsOffset = 2;
962 static const int kNumCodeStubKeysOffset = 3; 962 static const int kNumCodeStubKeysOffset = 3;
963 static const int kPayloadLengthOffset = 4; 963 static const int kPayloadLengthOffset = 4;
964 static const int kHeaderSize = (kPayloadLengthOffset + 1) * kIntSize; 964 static const int kHeaderSize = (kPayloadLengthOffset + 1) * kIntSize;
965 }; 965 };
966 } } // namespace v8::internal 966 } } // namespace v8::internal
967 967
968 #endif // V8_SERIALIZE_H_ 968 #endif // V8_SERIALIZE_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698