Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 680abc36ab24be64b8829aeba96155b647f98541..ae0572e5ff5031ad6e285eebec56804437600d57 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -25,8 +25,9 @@ |
#include "src/deoptimizer.h" |
#include "src/elements.h" |
#include "src/execution.h" |
-#include "src/field-index.h" |
#include "src/field-index-inl.h" |
+#include "src/field-index.h" |
+#include "src/field-type.h" |
#include "src/full-codegen/full-codegen.h" |
#include "src/ic/ic.h" |
#include "src/identity-map.h" |
@@ -9906,6 +9907,15 @@ 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); |
+} |
bool DescriptorArray::CanHoldValue(int descriptor, Object* value) { |
PropertyDetails details = GetDetails(descriptor); |