diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-05-02 10:50:00 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-05-06 20:02:35 +0200 |
commit | 60d1aac8d225e844e68ae48e8f3d58802e635fbe (patch) | |
tree | 922f347dd054db18d88666fad7181e5a777f4022 /deps/v8/src/property.cc | |
parent | 73d9c0f903ae371cd5011af64c3a6f69a1bda978 (diff) | |
download | android-node-v8-60d1aac8d225e844e68ae48e8f3d58802e635fbe.tar.gz android-node-v8-60d1aac8d225e844e68ae48e8f3d58802e635fbe.tar.bz2 android-node-v8-60d1aac8d225e844e68ae48e8f3d58802e635fbe.zip |
deps: update V8 to 5.8.283.38
PR-URL: https://github.com/nodejs/node/pull/12784
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'deps/v8/src/property.cc')
-rw-r--r-- | deps/v8/src/property.cc | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/deps/v8/src/property.cc b/deps/v8/src/property.cc index 1c2666b00a..339076dbb4 100644 --- a/deps/v8/src/property.cc +++ b/deps/v8/src/property.cc @@ -25,13 +25,39 @@ std::ostream& operator<<(std::ostream& os, Descriptor Descriptor::DataField(Handle<Name> key, int field_index, PropertyAttributes attributes, Representation representation) { - return DataField(key, field_index, FieldType::Any(key->GetIsolate()), - attributes, representation); + return DataField(key, field_index, attributes, kMutable, representation, + FieldType::Any(key->GetIsolate())); +} + +Descriptor Descriptor::DataField(Handle<Name> key, int field_index, + PropertyAttributes attributes, + PropertyConstness constness, + Representation representation, + Handle<Object> wrapped_field_type) { + DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell()); + PropertyDetails details(kData, attributes, kField, constness, representation, + field_index); + return Descriptor(key, wrapped_field_type, details); +} + +Descriptor Descriptor::DataConstant(Handle<Name> key, int field_index, + Handle<Object> value, + PropertyAttributes attributes) { + if (FLAG_track_constant_fields) { + Handle<Object> any_type(FieldType::Any(), key->GetIsolate()); + return DataField(key, field_index, attributes, kConst, + Representation::Tagged(), any_type); + + } else { + return Descriptor(key, value, kData, attributes, kDescriptor, kConst, + value->OptimalRepresentation(), field_index); + } } // Outputs PropertyDetails as a dictionary details. void PropertyDetails::PrintAsSlowTo(std::ostream& os) { os << "("; + if (constness() == kConst) os << "const "; os << (kind() == kData ? "data" : "accessor"); os << ", dictionary_index: " << dictionary_index(); os << ", attrs: " << attributes() << ")"; @@ -40,6 +66,7 @@ void PropertyDetails::PrintAsSlowTo(std::ostream& os) { // Outputs PropertyDetails as a descriptor array details. void PropertyDetails::PrintAsFastTo(std::ostream& os, PrintMode mode) { os << "("; + if (constness() == kConst) os << "const "; os << (kind() == kData ? "data" : "accessor"); if (location() == kField) { os << " field"; |