| Index: src/ast/ast.h
|
| diff --git a/src/ast/ast.h b/src/ast/ast.h
|
| index c3790b34b377fe448289a171d066207cdb8e998e..89bf0428a891d266ff4e28d0011cbed9c16d9ef7 100644
|
| --- a/src/ast/ast.h
|
| +++ b/src/ast/ast.h
|
| @@ -1353,6 +1353,11 @@ class ObjectLiteralProperty final : public LiteralProperty {
|
|
|
| void set_receiver_type(Handle<Map> map) { receiver_type_ = map; }
|
|
|
| + bool IsNullPrototype() const {
|
| + return IsPrototype() && value()->IsNullLiteral();
|
| + }
|
| + bool IsPrototype() const { return kind() == PROTOTYPE; }
|
| +
|
| private:
|
| friend class AstNodeFactory;
|
|
|
| @@ -1390,7 +1395,13 @@ class ObjectLiteral final : public MaterializedLiteral {
|
| bool has_rest_property() const {
|
| return HasRestPropertyField::decode(bit_field_);
|
| }
|
| -
|
| + bool HasNullPrototype() const {
|
| + for (int i = 0; i < properties()->length(); i++) {
|
| + const ObjectLiteral::Property* property = properties()->at(i);
|
| + if (property->IsNullPrototype()) return true;
|
| + }
|
| + return false;
|
| + }
|
| // Decide if a property should be in the object boilerplate.
|
| static bool IsBoilerplateProperty(Property* property);
|
|
|
| @@ -1420,12 +1431,9 @@ class ObjectLiteral final : public MaterializedLiteral {
|
| // Assemble bitfield of flags for the CreateObjectLiteral helper.
|
| int ComputeFlags(bool disable_mementos = false) const {
|
| int flags = fast_elements() ? kFastElements : kNoFlags;
|
| - if (has_shallow_properties()) {
|
| - flags |= kShallowProperties;
|
| - }
|
| - if (disable_mementos) {
|
| - flags |= kDisableMementos;
|
| - }
|
| + if (HasNullPrototype()) flags |= kHasNullPrototype;
|
| + if (has_shallow_properties()) flags |= kShallowProperties;
|
| + if (disable_mementos) flags |= kDisableMementos;
|
| return flags;
|
| }
|
|
|
| @@ -1435,6 +1443,7 @@ class ObjectLiteral final : public MaterializedLiteral {
|
| kShallowProperties = 1 << 1,
|
| kDisableMementos = 1 << 2,
|
| kHasRestProperty = 1 << 3,
|
| + kHasNullPrototype = 1 << 4,
|
| };
|
|
|
| struct Accessors: public ZoneObject {
|
|
|