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 { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 struct FastPropertyDetails { | 45 struct FastPropertyDetails { |
46 explicit FastPropertyDetails(const PropertyDetails& v) : details(v) {} | 46 explicit FastPropertyDetails(const PropertyDetails& v) : details(v) {} |
47 const PropertyDetails details; | 47 const PropertyDetails details; |
48 }; | 48 }; |
49 | 49 |
50 | 50 |
51 // Outputs PropertyDetails as a dictionary details. | 51 // Outputs PropertyDetails as a dictionary details. |
52 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) { | 52 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) { |
53 os << "("; | 53 os << "("; |
54 if (details.location() == IN_DESCRIPTOR) { | 54 if (details.location() == kDescriptor) { |
55 os << "immutable "; | 55 os << "immutable "; |
56 } | 56 } |
57 os << (details.kind() == DATA ? "data" : "accessor"); | 57 os << (details.kind() == kData ? "data" : "accessor"); |
58 return os << ", dictionary_index: " << details.dictionary_index() | 58 return os << ", dictionary_index: " << details.dictionary_index() |
59 << ", attrs: " << details.attributes() << ")"; | 59 << ", attrs: " << details.attributes() << ")"; |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 // Outputs PropertyDetails as a descriptor array details. | 63 // Outputs PropertyDetails as a descriptor array details. |
64 std::ostream& operator<<(std::ostream& os, | 64 std::ostream& operator<<(std::ostream& os, |
65 const FastPropertyDetails& details_fast) { | 65 const FastPropertyDetails& details_fast) { |
66 const PropertyDetails& details = details_fast.details; | 66 const PropertyDetails& details = details_fast.details; |
67 os << "("; | 67 os << "("; |
68 if (details.location() == IN_DESCRIPTOR) { | 68 if (details.location() == kDescriptor) { |
69 os << "immutable "; | 69 os << "immutable "; |
70 } | 70 } |
71 os << (details.kind() == DATA ? "data" : "accessor"); | 71 os << (details.kind() == kData ? "data" : "accessor"); |
72 if (details.location() == IN_OBJECT) { | 72 if (details.location() == kField) { |
73 os << ": " << details.representation().Mnemonic() | 73 os << ": " << details.representation().Mnemonic() |
74 << ", field_index: " << details.field_index(); | 74 << ", field_index: " << details.field_index(); |
75 } | 75 } |
76 return os << ", p: " << details.pointer() | 76 return os << ", p: " << details.pointer() |
77 << ", attrs: " << details.attributes() << ")"; | 77 << ", attrs: " << details.attributes() << ")"; |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 #ifdef OBJECT_PRINT | 81 #ifdef OBJECT_PRINT |
82 void PropertyDetails::Print(bool dictionary_mode) { | 82 void PropertyDetails::Print(bool dictionary_mode) { |
(...skipping 14 matching lines...) Expand all Loading... |
97 if (value->IsAccessorPair()) { | 97 if (value->IsAccessorPair()) { |
98 AccessorPair* pair = AccessorPair::cast(value); | 98 AccessorPair* pair = AccessorPair::cast(value); |
99 os << "(get: " << Brief(pair->getter()) | 99 os << "(get: " << Brief(pair->getter()) |
100 << ", set: " << Brief(pair->setter()) << ") "; | 100 << ", set: " << Brief(pair->setter()) << ") "; |
101 } | 101 } |
102 os << FastPropertyDetails(d.GetDetails()); | 102 os << FastPropertyDetails(d.GetDetails()); |
103 return os; | 103 return os; |
104 } | 104 } |
105 | 105 |
106 } } // namespace v8::internal | 106 } } // namespace v8::internal |
OLD | NEW |