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

Side by Side Diff: src/heap/objects-visiting.h

Issue 1288413002: Make some foo.h headers usable without foo-inl.h header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 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
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | src/heap/objects-visiting.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_OBJECTS_VISITING_H_ 5 #ifndef V8_OBJECTS_VISITING_H_
6 #define V8_OBJECTS_VISITING_H_ 6 #define V8_OBJECTS_VISITING_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/layout-descriptor.h" 9 #include "src/layout-descriptor.h"
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 // Visitor ID should fit in one byte. 104 // Visitor ID should fit in one byte.
105 STATIC_ASSERT(kVisitorIdCount <= 256); 105 STATIC_ASSERT(kVisitorIdCount <= 256);
106 106
107 // Determine which specialized visitor should be used for given instance type 107 // Determine which specialized visitor should be used for given instance type
108 // and instance type. 108 // and instance type.
109 static VisitorId GetVisitorId(int instance_type, int instance_size, 109 static VisitorId GetVisitorId(int instance_type, int instance_size,
110 bool has_unboxed_fields); 110 bool has_unboxed_fields);
111 111
112 // Determine which specialized visitor should be used for given map. 112 // Determine which specialized visitor should be used for given map.
113 static VisitorId GetVisitorId(Map* map) { 113 static VisitorId GetVisitorId(Map* map);
114 return GetVisitorId(
115 map->instance_type(), map->instance_size(),
116 FLAG_unbox_double_fields && !map->HasFastPointerLayout());
117 }
118 114
119 // For visitors that allow specialization by size calculate VisitorId based 115 // For visitors that allow specialization by size calculate VisitorId based
120 // on size, base visitor id and generic visitor id. 116 // on size, base visitor id and generic visitor id.
121 static VisitorId GetVisitorIdForSize(VisitorId base, VisitorId generic, 117 static VisitorId GetVisitorIdForSize(VisitorId base, VisitorId generic,
122 int object_size, 118 int object_size,
123 bool has_unboxed_fields) { 119 bool has_unboxed_fields) {
124 DCHECK((base == kVisitDataObject) || (base == kVisitStruct) || 120 DCHECK((base == kVisitDataObject) || (base == kVisitStruct) ||
125 (base == kVisitJSObject)); 121 (base == kVisitJSObject));
126 DCHECK(IsAligned(object_size, kPointerSize)); 122 DCHECK(IsAligned(object_size, kPointerSize));
127 DCHECK(kMinObjectSizeInWords * kPointerSize <= object_size); 123 DCHECK(kMinObjectSizeInWords * kPointerSize <= object_size);
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // the next element. Given the head of the list, this function removes dead 492 // the next element. Given the head of the list, this function removes dead
497 // elements from the list and if requested records slots for next-element 493 // elements from the list and if requested records slots for next-element
498 // pointers. The template parameter T is a WeakListVisitor that defines how to 494 // pointers. The template parameter T is a WeakListVisitor that defines how to
499 // access the next-element pointers. 495 // access the next-element pointers.
500 template <class T> 496 template <class T>
501 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); 497 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer);
502 } 498 }
503 } // namespace v8::internal 499 } // namespace v8::internal
504 500
505 #endif // V8_OBJECTS_VISITING_H_ 501 #endif // V8_OBJECTS_VISITING_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698