OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // For visitors that allow specialization by size calculate VisitorId based | 128 // For visitors that allow specialization by size calculate VisitorId based |
129 // on size, base visitor id and generic visitor id. | 129 // on size, base visitor id and generic visitor id. |
130 static VisitorId GetVisitorIdForSize(VisitorId base, | 130 static VisitorId GetVisitorIdForSize(VisitorId base, |
131 VisitorId generic, | 131 VisitorId generic, |
132 int object_size) { | 132 int object_size) { |
133 ASSERT((base == kVisitDataObject) || | 133 ASSERT((base == kVisitDataObject) || |
134 (base == kVisitStruct) || | 134 (base == kVisitStruct) || |
135 (base == kVisitJSObject)); | 135 (base == kVisitJSObject)); |
136 ASSERT(IsAligned(object_size, kPointerSize)); | 136 ASSERT(IsAligned(object_size, kPointerSize)); |
137 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); | 137 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); |
138 ASSERT(object_size < Page::kMaxHeapObjectSize); | 138 ASSERT(object_size < Page::kMaxNonCodeHeapObjectSize); |
139 | 139 |
140 const VisitorId specialization = static_cast<VisitorId>( | 140 const VisitorId specialization = static_cast<VisitorId>( |
141 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); | 141 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); |
142 | 142 |
143 return Min(specialization, generic); | 143 return Min(specialization, generic); |
144 } | 144 } |
145 }; | 145 }; |
146 | 146 |
147 | 147 |
148 template<typename Callback> | 148 template<typename Callback> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 343 |
344 | 344 |
345 template<typename StaticVisitor> | 345 template<typename StaticVisitor> |
346 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> | 346 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> |
347 StaticNewSpaceVisitor<StaticVisitor>::table_; | 347 StaticNewSpaceVisitor<StaticVisitor>::table_; |
348 | 348 |
349 | 349 |
350 } } // namespace v8::internal | 350 } } // namespace v8::internal |
351 | 351 |
352 #endif // V8_OBJECTS_VISITING_H_ | 352 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |