OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // For visitors that allow specialization by size calculate VisitorId based | 137 // For visitors that allow specialization by size calculate VisitorId based |
138 // on size, base visitor id and generic visitor id. | 138 // on size, base visitor id and generic visitor id. |
139 static VisitorId GetVisitorIdForSize(VisitorId base, | 139 static VisitorId GetVisitorIdForSize(VisitorId base, |
140 VisitorId generic, | 140 VisitorId generic, |
141 int object_size) { | 141 int object_size) { |
142 ASSERT((base == kVisitDataObject) || | 142 ASSERT((base == kVisitDataObject) || |
143 (base == kVisitStruct) || | 143 (base == kVisitStruct) || |
144 (base == kVisitJSObject)); | 144 (base == kVisitJSObject)); |
145 ASSERT(IsAligned(object_size, kPointerSize)); | 145 ASSERT(IsAligned(object_size, kPointerSize)); |
146 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); | 146 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); |
147 ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); | 147 ASSERT(object_size <= Page::kMaxRegularHeapObjectSize); |
148 | 148 |
149 const VisitorId specialization = static_cast<VisitorId>( | 149 const VisitorId specialization = static_cast<VisitorId>( |
150 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); | 150 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); |
151 | 151 |
152 return Min(specialization, generic); | 152 return Min(specialization, generic); |
153 } | 153 } |
154 }; | 154 }; |
155 | 155 |
156 | 156 |
157 template<typename Callback> | 157 template<typename Callback> |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 | 478 |
479 template<typename StaticVisitor> | 479 template<typename StaticVisitor> |
480 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> | 480 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> |
481 StaticMarkingVisitor<StaticVisitor>::table_; | 481 StaticMarkingVisitor<StaticVisitor>::table_; |
482 | 482 |
483 | 483 |
484 } } // namespace v8::internal | 484 } } // namespace v8::internal |
485 | 485 |
486 #endif // V8_OBJECTS_VISITING_H_ | 486 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |