Index: src/ast/ast.h |
diff --git a/src/ast/ast.h b/src/ast/ast.h |
index d182b399f7e6c00f47f47258a888334833a478f4..b2103b04e32d747afbc44070fe9e3b5bdba276af 100644 |
--- a/src/ast/ast.h |
+++ b/src/ast/ast.h |
@@ -1517,6 +1517,9 @@ class ObjectLiteral final : public MaterializedLiteral { |
bool may_store_doubles() const { return may_store_doubles_; } |
bool has_function() const { return has_function_; } |
bool has_elements() const { return has_elements_; } |
+ bool has_shallow_properties() const { |
+ return depth() == 1 && !has_elements() && !may_store_doubles(); |
+ } |
// Decide if a property should be in the object boilerplate. |
static bool IsBoilerplateProperty(Property* property); |
@@ -1533,7 +1536,7 @@ class ObjectLiteral final : public MaterializedLiteral { |
int ComputeFlags(bool disable_mementos = false) const { |
int flags = fast_elements() ? kFastElements : kNoFlags; |
flags |= has_function() ? kHasFunction : kNoFlags; |
- if (depth() == 1 && !has_elements() && !may_store_doubles()) { |
+ if (has_shallow_properties()) { |
flags |= kShallowProperties; |
} |
if (disable_mementos) { |