OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/property.h" | 5 #include "src/property.h" |
6 | 6 |
7 #include "src/handles-inl.h" | 7 #include "src/handles-inl.h" |
8 #include "src/ostreams.h" | 8 #include "src/ostreams.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 void LookupResult::Iterate(ObjectVisitor* visitor) { | 13 void LookupResult::Iterate(ObjectVisitor* visitor) { |
14 LookupResult* current = this; // Could be NULL. | 14 LookupResult* current = this; // Could be NULL. |
15 while (current != NULL) { | 15 while (current != NULL) { |
16 visitor->VisitPointer(BitCast<Object**>(¤t->holder_)); | 16 visitor->VisitPointer(BitCast<Object**>(¤t->holder_)); |
17 visitor->VisitPointer(BitCast<Object**>(¤t->transition_)); | 17 visitor->VisitPointer(BitCast<Object**>(¤t->transition_)); |
18 current = current->next_; | 18 current = current->next_; |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 | 22 |
23 OStream& operator<<(OStream& os, const LookupResult& r) { | 23 OStream& operator<<(OStream& os, const LookupResult& r) { |
24 if (!r.IsFound()) return os << "Not Found\n"; | 24 if (!r.IsFound()) return os << "Not Found\n"; |
25 | 25 |
26 os << "LookupResult:\n"; | 26 os << "LookupResult:\n"; |
27 os << " -cacheable = " << (r.IsCacheable() ? "true" : "false") << "\n"; | |
28 os << " -attributes = " << hex << r.GetAttributes() << dec << "\n"; | |
29 if (r.IsTransition()) { | 27 if (r.IsTransition()) { |
30 os << " -transition target:\n" << Brief(r.GetTransitionTarget()) << "\n"; | 28 os << " -transition target:\n" << Brief(r.GetTransitionTarget()) << "\n"; |
31 } | 29 } |
32 switch (r.type()) { | |
33 case NORMAL: | |
34 return os << " -type = normal\n" | |
35 << " -entry = " << r.GetDictionaryEntry() << "\n"; | |
36 case CONSTANT: | |
37 return os << " -type = constant\n"; | |
38 case FIELD: | |
39 os << " -type = field\n" | |
40 << " -index = " << r.GetFieldIndex().property_index() << "\n" | |
41 << " -field type:"; | |
42 r.GetFieldType()->PrintTo(os); | |
43 return os << "\n"; | |
44 case CALLBACKS: | |
45 return os << " -type = call backs\n"; | |
46 case HANDLER: | |
47 return os << " -type = lookup proxy\n"; | |
48 case INTERCEPTOR: | |
49 return os << " -type = lookup interceptor\n"; | |
50 } | |
51 return os; | 30 return os; |
52 } | 31 } |
53 | 32 |
54 | 33 |
55 OStream& operator<<(OStream& os, const Descriptor& d) { | 34 OStream& operator<<(OStream& os, const Descriptor& d) { |
56 return os << "Descriptor " << Brief(*d.GetKey()) << " @ " | 35 return os << "Descriptor " << Brief(*d.GetKey()) << " @ " |
57 << Brief(*d.GetValue()); | 36 << Brief(*d.GetValue()); |
58 } | 37 } |
59 | 38 |
60 } } // namespace v8::internal | 39 } } // namespace v8::internal |
OLD | NEW |