Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: src/ast/ast.h

Issue 2620943002: [ESnext] Implement Object Rest (Closed)
Patch Set: Remove comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 12e8de97158c3d44c8b6c28f469aec59b3642461..c05d303e2d1a26e94831278907b2933c0b50b16f 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -1454,14 +1454,18 @@ class ObjectLiteral final : public MaterializedLiteral {
void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
FeedbackVectorSlotCache* cache);
+ bool has_rest_property() const { return has_rest_property_; }
+
private:
friend class AstNodeFactory;
ObjectLiteral(ZoneList<Property*>* properties, int literal_index,
- uint32_t boilerplate_properties, int pos)
+ uint32_t boilerplate_properties, int pos,
+ bool has_rest_property)
: MaterializedLiteral(literal_index, pos, kObjectLiteral),
boilerplate_properties_(boilerplate_properties),
- properties_(properties) {
+ properties_(properties),
+ has_rest_property_(has_rest_property) {
bit_field_ |= FastElementsField::encode(false) |
HasElementsField::encode(false) |
MayStoreDoublesField::encode(false);
@@ -1473,6 +1477,7 @@ class ObjectLiteral final : public MaterializedLiteral {
uint32_t boilerplate_properties_;
Handle<FixedArray> constant_properties_;
ZoneList<Property*>* properties_;
+ bool has_rest_property_;
adamk 2017/01/10 23:22:55 This should be stored in the bit_field_, like the
gsathya 2017/01/12 21:27:41 Done.
class FastElementsField
: public BitField<bool, MaterializedLiteral::kNextBitFieldIndex, 1> {};
@@ -3311,9 +3316,10 @@ class AstNodeFactory final BASE_EMBEDDED {
ObjectLiteral* NewObjectLiteral(
ZoneList<ObjectLiteral::Property*>* properties, int literal_index,
- uint32_t boilerplate_properties, int pos) {
+ uint32_t boilerplate_properties, int pos, bool has_rest_property) {
return new (zone_)
- ObjectLiteral(properties, literal_index, boilerplate_properties, pos);
+ ObjectLiteral(properties, literal_index, boilerplate_properties, pos,
+ has_rest_property);
}
ObjectLiteral::Property* NewObjectLiteralProperty(
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698