Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index 7040ff78350bcfdc524114752ca33e559b0f1199..1c78adb6aa0f1d87bca6d061249444d683b56cf9 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -1507,6 +1507,9 @@ 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()) { |
+ flags |= kShallowProperties; |
+ } |
if (disable_mementos) { |
flags |= kDisableMementos; |
} |
@@ -1517,7 +1520,8 @@ class ObjectLiteral FINAL : public MaterializedLiteral { |
kNoFlags = 0, |
kFastElements = 1, |
kHasFunction = 1 << 1, |
- kDisableMementos = 1 << 2 |
+ kShallowProperties = 1 << 2, |
+ kDisableMementos = 1 << 3 |
}; |
struct Accessors: public ZoneObject { |