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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // For visitors that allow specialization by size calculate VisitorId based | 134 // For visitors that allow specialization by size calculate VisitorId based |
135 // on size, base visitor id and generic visitor id. | 135 // on size, base visitor id and generic visitor id. |
136 static VisitorId GetVisitorIdForSize(VisitorId base, | 136 static VisitorId GetVisitorIdForSize(VisitorId base, |
137 VisitorId generic, | 137 VisitorId generic, |
138 int object_size) { | 138 int object_size) { |
139 ASSERT((base == kVisitDataObject) || | 139 ASSERT((base == kVisitDataObject) || |
140 (base == kVisitStruct) || | 140 (base == kVisitStruct) || |
141 (base == kVisitJSObject)); | 141 (base == kVisitJSObject)); |
142 ASSERT(IsAligned(object_size, kPointerSize)); | 142 ASSERT(IsAligned(object_size, kPointerSize)); |
143 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); | 143 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); |
144 ASSERT(object_size < Page::kMaxNonCodeHeapObjectSize); | 144 ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); |
145 | 145 |
146 const VisitorId specialization = static_cast<VisitorId>( | 146 const VisitorId specialization = static_cast<VisitorId>( |
147 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); | 147 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); |
148 | 148 |
149 return Min(specialization, generic); | 149 return Min(specialization, generic); |
150 } | 150 } |
151 }; | 151 }; |
152 | 152 |
153 | 153 |
154 template<typename Callback> | 154 template<typename Callback> |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 468 |
469 | 469 |
470 template<typename StaticVisitor> | 470 template<typename StaticVisitor> |
471 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> | 471 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> |
472 StaticMarkingVisitor<StaticVisitor>::table_; | 472 StaticMarkingVisitor<StaticVisitor>::table_; |
473 | 473 |
474 | 474 |
475 } } // namespace v8::internal | 475 } } // namespace v8::internal |
476 | 476 |
477 #endif // V8_OBJECTS_VISITING_H_ | 477 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |