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

Side by Side Diff: src/global-handles.h

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 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 | « src/gdb-jit.cc ('k') | src/global-handles.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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_GLOBAL_HANDLES_H_ 5 #ifndef V8_GLOBAL_HANDLES_H_
6 #define V8_GLOBAL_HANDLES_H_ 6 #define V8_GLOBAL_HANDLES_H_
7 7
8 #include "include/v8.h" 8 #include "include/v8.h"
9 #include "include/v8-profiler.h" 9 #include "include/v8-profiler.h"
10 10
(...skipping 19 matching lines...) Expand all
30 // the group is alive, all objects in the same group are considered alive. 30 // the group is alive, all objects in the same group are considered alive.
31 // An object group is used to simulate object relationship in a DOM tree. 31 // An object group is used to simulate object relationship in a DOM tree.
32 32
33 // An implicit references group consists of two parts: a parent object and a 33 // An implicit references group consists of two parts: a parent object and a
34 // list of children objects. If the parent is alive, all the children are alive 34 // list of children objects. If the parent is alive, all the children are alive
35 // too. 35 // too.
36 36
37 struct ObjectGroup { 37 struct ObjectGroup {
38 explicit ObjectGroup(size_t length) 38 explicit ObjectGroup(size_t length)
39 : info(NULL), length(length) { 39 : info(NULL), length(length) {
40 ASSERT(length > 0); 40 DCHECK(length > 0);
41 objects = new Object**[length]; 41 objects = new Object**[length];
42 } 42 }
43 ~ObjectGroup(); 43 ~ObjectGroup();
44 44
45 v8::RetainedObjectInfo* info; 45 v8::RetainedObjectInfo* info;
46 Object*** objects; 46 Object*** objects;
47 size_t length; 47 size_t length;
48 }; 48 };
49 49
50 50
51 struct ImplicitRefGroup { 51 struct ImplicitRefGroup {
52 ImplicitRefGroup(HeapObject** parent, size_t length) 52 ImplicitRefGroup(HeapObject** parent, size_t length)
53 : parent(parent), length(length) { 53 : parent(parent), length(length) {
54 ASSERT(length > 0); 54 DCHECK(length > 0);
55 children = new Object**[length]; 55 children = new Object**[length];
56 } 56 }
57 ~ImplicitRefGroup(); 57 ~ImplicitRefGroup();
58 58
59 HeapObject** parent; 59 HeapObject** parent;
60 Object*** children; 60 Object*** children;
61 size_t length; 61 size_t length;
62 }; 62 };
63 63
64 64
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // Create an EternalHandle, overwriting the index. 328 // Create an EternalHandle, overwriting the index.
329 void Create(Isolate* isolate, Object* object, int* index); 329 void Create(Isolate* isolate, Object* object, int* index);
330 330
331 // Grab the handle for an existing EternalHandle. 331 // Grab the handle for an existing EternalHandle.
332 inline Handle<Object> Get(int index) { 332 inline Handle<Object> Get(int index) {
333 return Handle<Object>(GetLocation(index)); 333 return Handle<Object>(GetLocation(index));
334 } 334 }
335 335
336 // Grab the handle for an existing SingletonHandle. 336 // Grab the handle for an existing SingletonHandle.
337 inline Handle<Object> GetSingleton(SingletonHandle singleton) { 337 inline Handle<Object> GetSingleton(SingletonHandle singleton) {
338 ASSERT(Exists(singleton)); 338 DCHECK(Exists(singleton));
339 return Get(singleton_handles_[singleton]); 339 return Get(singleton_handles_[singleton]);
340 } 340 }
341 341
342 // Checks whether a SingletonHandle has been assigned. 342 // Checks whether a SingletonHandle has been assigned.
343 inline bool Exists(SingletonHandle singleton) { 343 inline bool Exists(SingletonHandle singleton) {
344 return singleton_handles_[singleton] != kInvalidIndex; 344 return singleton_handles_[singleton] != kInvalidIndex;
345 } 345 }
346 346
347 // Assign a SingletonHandle to an empty slot and returns the handle. 347 // Assign a SingletonHandle to an empty slot and returns the handle.
348 Handle<Object> CreateSingleton(Isolate* isolate, 348 Handle<Object> CreateSingleton(Isolate* isolate,
(...skipping 11 matching lines...) Expand all
360 void PostGarbageCollectionProcessing(Heap* heap); 360 void PostGarbageCollectionProcessing(Heap* heap);
361 361
362 private: 362 private:
363 static const int kInvalidIndex = -1; 363 static const int kInvalidIndex = -1;
364 static const int kShift = 8; 364 static const int kShift = 8;
365 static const int kSize = 1 << kShift; 365 static const int kSize = 1 << kShift;
366 static const int kMask = 0xff; 366 static const int kMask = 0xff;
367 367
368 // Gets the slot for an index 368 // Gets the slot for an index
369 inline Object** GetLocation(int index) { 369 inline Object** GetLocation(int index) {
370 ASSERT(index >= 0 && index < size_); 370 DCHECK(index >= 0 && index < size_);
371 return &blocks_[index >> kShift][index & kMask]; 371 return &blocks_[index >> kShift][index & kMask];
372 } 372 }
373 373
374 int size_; 374 int size_;
375 List<Object**> blocks_; 375 List<Object**> blocks_;
376 List<int> new_space_indices_; 376 List<int> new_space_indices_;
377 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; 377 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES];
378 378
379 DISALLOW_COPY_AND_ASSIGN(EternalHandles); 379 DISALLOW_COPY_AND_ASSIGN(EternalHandles);
380 }; 380 };
381 381
382 382
383 } } // namespace v8::internal 383 } } // namespace v8::internal
384 384
385 #endif // V8_GLOBAL_HANDLES_H_ 385 #endif // V8_GLOBAL_HANDLES_H_
OLDNEW
« no previous file with comments | « src/gdb-jit.cc ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698