Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 4a517c94c840fc1245bf4d45faf004cc63ee0f70..cb42341cc9f9507c43d635d01c4dfea1f7af1b86 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3327,11 +3327,20 @@ Context* JSReceiver::GetCreationContext() { |
return function->context()->native_context(); |
} |
-Handle<Object> Map::WrapType(Handle<FieldType> type) { |
+Handle<Object> Map::WrapFieldType(Handle<FieldType> type) { |
if (type->IsClass()) return Map::WeakCellForMap(type->AsClass()); |
return type; |
} |
+FieldType* Map::UnwrapFieldType(Object* wrapped_type) { |
+ Object* value = wrapped_type; |
+ if (value->IsWeakCell()) { |
+ if (WeakCell::cast(value)->cleared()) return FieldType::None(); |
+ value = WeakCell::cast(value)->value(); |
+ } |
+ return FieldType::cast(value); |
+} |
+ |
MaybeHandle<Map> Map::CopyWithField(Handle<Map> map, Handle<Name> name, |
Handle<FieldType> type, |
PropertyAttributes attributes, |
@@ -3356,7 +3365,7 @@ MaybeHandle<Map> Map::CopyWithField(Handle<Map> map, Handle<Name> name, |
type = FieldType::Any(isolate); |
} |
- Handle<Object> wrapped_type(WrapType(type)); |
+ Handle<Object> wrapped_type(WrapFieldType(type)); |
Descriptor d = Descriptor::DataField(name, index, wrapped_type, attributes, |
representation); |
@@ -4139,7 +4148,7 @@ void Map::GeneralizeField(Handle<Map> map, int modify_index, |
PropertyDetails details = descriptors->GetDetails(modify_index); |
Handle<Name> name(descriptors->GetKey(modify_index)); |
- Handle<Object> wrapped_type(WrapType(new_field_type)); |
+ Handle<Object> wrapped_type(WrapFieldType(new_field_type)); |
field_owner->UpdateFieldType(modify_index, name, new_representation, |
wrapped_type); |
field_owner->dependent_code()->DeoptimizeDependentCodeGroup( |
@@ -9109,16 +9118,6 @@ Handle<Map> Map::CopyForPreventExtensions(Handle<Map> map, |
return new_map; |
} |
-FieldType* DescriptorArray::GetFieldType(int descriptor_number) { |
- DCHECK(GetDetails(descriptor_number).location() == kField); |
- Object* value = GetValue(descriptor_number); |
- if (value->IsWeakCell()) { |
- if (WeakCell::cast(value)->cleared()) return FieldType::None(); |
- value = WeakCell::cast(value)->value(); |
- } |
- return FieldType::cast(value); |
-} |
- |
namespace { |
bool CanHoldValue(DescriptorArray* descriptors, int descriptor, Object* value) { |
@@ -15790,7 +15789,8 @@ void Dictionary<Derived, Shape, Key>::Print(std::ostream& os) { // NOLINT |
} else { |
os << Brief(k); |
} |
- os << ": " << Brief(this->ValueAt(i)) << " " << this->DetailsAt(i); |
+ os << ": " << Brief(this->ValueAt(i)) << " "; |
+ this->DetailsAt(i).PrintAsSlowTo(os); |
} |
} |
} |