@@ -1295,11 +1295,14 @@ class MaterializedLiteral : public Expression {
12951295 return depth_;
12961296 }
12971297
1298+ bool is_strong () const { return is_strong_; }
1299+
12981300 protected:
1299- MaterializedLiteral (Zone* zone, int literal_index, int pos)
1301+ MaterializedLiteral (Zone* zone, int literal_index, bool is_strong, int pos)
13001302 : Expression(zone, pos),
13011303 literal_index_ (literal_index),
13021304 is_simple_(false ),
1305+ is_strong_(is_strong),
13031306 depth_(0 ) {}
13041307
13051308 // A materialized literal is simple if the values consist of only
@@ -1328,6 +1331,7 @@ class MaterializedLiteral : public Expression {
13281331 private:
13291332 int literal_index_;
13301333 bool is_simple_;
1334+ bool is_strong_;
13311335 int depth_;
13321336};
13331337
@@ -1422,6 +1426,9 @@ class ObjectLiteral final : public MaterializedLiteral {
14221426 if (disable_mementos) {
14231427 flags |= kDisableMementos ;
14241428 }
1429+ if (is_strong ()) {
1430+ flags |= kIsStrong ;
1431+ }
14251432 return flags;
14261433 }
14271434
@@ -1430,7 +1437,8 @@ class ObjectLiteral final : public MaterializedLiteral {
14301437 kFastElements = 1 ,
14311438 kHasFunction = 1 << 1 ,
14321439 kShallowProperties = 1 << 2 ,
1433- kDisableMementos = 1 << 3
1440+ kDisableMementos = 1 << 3 ,
1441+ kIsStrong = 1 << 4
14341442 };
14351443
14361444 struct Accessors : public ZoneObject {
@@ -1450,8 +1458,9 @@ class ObjectLiteral final : public MaterializedLiteral {
14501458
14511459 protected:
14521460 ObjectLiteral (Zone* zone, ZoneList<Property*>* properties, int literal_index,
1453- int boilerplate_properties, bool has_function, int pos)
1454- : MaterializedLiteral(zone, literal_index, pos),
1461+ int boilerplate_properties, bool has_function,
1462+ bool is_strong, int pos)
1463+ : MaterializedLiteral(zone, literal_index, is_strong, pos),
14551464 properties_ (properties),
14561465 boilerplate_properties_(boilerplate_properties),
14571466 fast_elements_(false ),
@@ -1482,8 +1491,9 @@ class RegExpLiteral final : public MaterializedLiteral {
14821491
14831492 protected:
14841493 RegExpLiteral (Zone* zone, const AstRawString* pattern,
1485- const AstRawString* flags, int literal_index, int pos)
1486- : MaterializedLiteral(zone, literal_index, pos),
1494+ const AstRawString* flags, int literal_index, bool is_strong,
1495+ int pos)
1496+ : MaterializedLiteral(zone, literal_index, is_strong, pos),
14871497 pattern_ (pattern),
14881498 flags_(flags) {
14891499 set_depth (1 );
@@ -1528,19 +1538,24 @@ class ArrayLiteral final : public MaterializedLiteral {
15281538 if (disable_mementos) {
15291539 flags |= kDisableMementos ;
15301540 }
1541+ if (is_strong ()) {
1542+ flags |= kIsStrong ;
1543+ }
15311544 return flags;
15321545 }
15331546
15341547 enum Flags {
15351548 kNoFlags = 0 ,
15361549 kShallowElements = 1 ,
1537- kDisableMementos = 1 << 1
1550+ kDisableMementos = 1 << 1 ,
1551+ kIsStrong = 1 << 2
15381552 };
15391553
15401554 protected:
15411555 ArrayLiteral (Zone* zone, ZoneList<Expression*>* values, int literal_index,
1542- int pos)
1543- : MaterializedLiteral(zone, literal_index, pos), values_(values) {}
1556+ bool is_strong, int pos)
1557+ : MaterializedLiteral(zone, literal_index, is_strong, pos),
1558+ values_ (values) {}
15441559 static int parent_num_ids () { return MaterializedLiteral::num_ids (); }
15451560
15461561 private:
@@ -3305,9 +3320,11 @@ class AstNodeFactory final BASE_EMBEDDED {
33053320 int literal_index,
33063321 int boilerplate_properties,
33073322 bool has_function,
3323+ bool is_strong,
33083324 int pos) {
33093325 return new (zone_) ObjectLiteral (zone_, properties, literal_index,
3310- boilerplate_properties, has_function, pos);
3326+ boilerplate_properties, has_function,
3327+ is_strong, pos);
33113328 }
33123329
33133330 ObjectLiteral::Property* NewObjectLiteralProperty (
@@ -3328,14 +3345,18 @@ class AstNodeFactory final BASE_EMBEDDED {
33283345 RegExpLiteral* NewRegExpLiteral (const AstRawString* pattern,
33293346 const AstRawString* flags,
33303347 int literal_index,
3348+ bool is_strong,
33313349 int pos) {
3332- return new (zone_) RegExpLiteral (zone_, pattern, flags, literal_index, pos);
3350+ return new (zone_) RegExpLiteral (zone_, pattern, flags, literal_index,
3351+ is_strong, pos);
33333352 }
33343353
33353354 ArrayLiteral* NewArrayLiteral (ZoneList<Expression*>* values,
33363355 int literal_index,
3356+ bool is_strong,
33373357 int pos) {
3338- return new (zone_) ArrayLiteral (zone_, values, literal_index, pos);
3358+ return new (zone_) ArrayLiteral (zone_, values, literal_index, is_strong,
3359+ pos);
33393360 }
33403361
33413362 VariableProxy* NewVariableProxy (Variable* var,
0 commit comments