OLD | NEW |
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_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
7 | 7 |
8 #include "src/heap/objects-visiting.h" | 8 #include "src/heap/objects-visiting.h" |
9 #include "src/ic/ic-state.h" | 9 #include "src/ic/ic-state.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
| 15 |
| 16 template <typename Callback> |
| 17 Callback VisitorDispatchTable<Callback>::GetVisitor(Map* map) { |
| 18 return reinterpret_cast<Callback>(callbacks_[map->visitor_id()]); |
| 19 } |
| 20 |
| 21 |
15 template <typename StaticVisitor> | 22 template <typename StaticVisitor> |
16 void StaticNewSpaceVisitor<StaticVisitor>::Initialize() { | 23 void StaticNewSpaceVisitor<StaticVisitor>::Initialize() { |
17 table_.Register( | 24 table_.Register( |
18 kVisitShortcutCandidate, | 25 kVisitShortcutCandidate, |
19 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, int>::Visit); | 26 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, int>::Visit); |
20 | 27 |
21 table_.Register( | 28 table_.Register( |
22 kVisitConsString, | 29 kVisitConsString, |
23 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, int>::Visit); | 30 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, int>::Visit); |
24 | 31 |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 | 871 |
865 RelocIterator it(this, mode_mask); | 872 RelocIterator it(this, mode_mask); |
866 for (; !it.done(); it.next()) { | 873 for (; !it.done(); it.next()) { |
867 it.rinfo()->template Visit<StaticVisitor>(heap); | 874 it.rinfo()->template Visit<StaticVisitor>(heap); |
868 } | 875 } |
869 } | 876 } |
870 } | 877 } |
871 } // namespace v8::internal | 878 } // namespace v8::internal |
872 | 879 |
873 #endif // V8_OBJECTS_VISITING_INL_H_ | 880 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |