| 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/field-type.h" | 7 #include "src/field-type.h" |
| 8 #include "src/handles-inl.h" | 8 #include "src/handles-inl.h" |
| 9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 std::ostream& operator<<(std::ostream& os, | 14 std::ostream& operator<<(std::ostream& os, |
| 15 const PropertyAttributes& attributes) { | 15 const PropertyAttributes& attributes) { |
| 16 os << "["; | 16 os << "["; |
| 17 os << (((attributes & READ_ONLY) == 0) ? "W" : "_"); // writable | 17 os << (((attributes & READ_ONLY) == 0) ? "W" : "_"); // writable |
| 18 os << (((attributes & DONT_ENUM) == 0) ? "E" : "_"); // enumerable | 18 os << (((attributes & DONT_ENUM) == 0) ? "E" : "_"); // enumerable |
| 19 os << (((attributes & DONT_DELETE) == 0) ? "C" : "_"); // configurable | 19 os << (((attributes & DONT_DELETE) == 0) ? "C" : "_"); // configurable |
| 20 os << "]"; | 20 os << "]"; |
| 21 return os; | 21 return os; |
| 22 } | 22 } |
| 23 | 23 |
| 24 DataDescriptor::DataDescriptor(Handle<Name> key, int field_index, | 24 Descriptor Descriptor::DataField(Handle<Name> key, int field_index, |
| 25 PropertyAttributes attributes, | 25 PropertyAttributes attributes, |
| 26 Representation representation) | 26 Representation representation) { |
| 27 : Descriptor(key, FieldType::Any(key->GetIsolate()), attributes, DATA, | 27 return Descriptor(key, FieldType::Any(key->GetIsolate()), attributes, DATA, |
| 28 representation, field_index) {} | 28 representation, field_index); |
| 29 } |
| 29 | 30 |
| 30 struct FastPropertyDetails { | 31 struct FastPropertyDetails { |
| 31 explicit FastPropertyDetails(const PropertyDetails& v) : details(v) {} | 32 explicit FastPropertyDetails(const PropertyDetails& v) : details(v) {} |
| 32 const PropertyDetails details; | 33 const PropertyDetails details; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 | 36 |
| 36 // Outputs PropertyDetails as a dictionary details. | 37 // Outputs PropertyDetails as a dictionary details. |
| 37 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) { | 38 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details) { |
| 38 os << "("; | 39 os << "("; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 AccessorPair* pair = AccessorPair::cast(value); | 84 AccessorPair* pair = AccessorPair::cast(value); |
| 84 os << "(get: " << Brief(pair->getter()) | 85 os << "(get: " << Brief(pair->getter()) |
| 85 << ", set: " << Brief(pair->setter()) << ") "; | 86 << ", set: " << Brief(pair->setter()) << ") "; |
| 86 } | 87 } |
| 87 os << FastPropertyDetails(d.GetDetails()); | 88 os << FastPropertyDetails(d.GetDetails()); |
| 88 return os; | 89 return os; |
| 89 } | 90 } |
| 90 | 91 |
| 91 } // namespace internal | 92 } // namespace internal |
| 92 } // namespace v8 | 93 } // namespace v8 |
| OLD | NEW |