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

Side by Side Diff: src/ast/ast.h

Issue 1564083002: Add spread rewriting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase to remove things added in separate CLs Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_AST_H_ 5 #ifndef V8_AST_AST_H_
6 #define V8_AST_AST_H_ 6 #define V8_AST_AST_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/modules.h" 10 #include "src/ast/modules.h"
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 int flags = depth() == 1 ? kShallowElements : kNoFlags; 1676 int flags = depth() == 1 ? kShallowElements : kNoFlags;
1677 if (disable_mementos) { 1677 if (disable_mementos) {
1678 flags |= kDisableMementos; 1678 flags |= kDisableMementos;
1679 } 1679 }
1680 if (is_strong()) { 1680 if (is_strong()) {
1681 flags |= kIsStrong; 1681 flags |= kIsStrong;
1682 } 1682 }
1683 return flags; 1683 return flags;
1684 } 1684 }
1685 1685
1686 // Provide a mechanism for iterating through values to rewrite spreads.
1687 ZoneList<Expression*>::iterator FirstSpread() const {
1688 return (first_spread_index_ >= 0) ? values_->begin() + first_spread_index_
1689 : values_->end();
1690 }
1691 ZoneList<Expression*>::iterator EndValue() const { return values_->end(); }
1692
1693 // Rewind an array literal omitting everything from the first spread on.
1694 void RewindSpreads() {
1695 values_->Rewind(first_spread_index_);
1696 first_spread_index_ = -1;
1697 }
1698
1686 enum Flags { 1699 enum Flags {
1687 kNoFlags = 0, 1700 kNoFlags = 0,
1688 kShallowElements = 1, 1701 kShallowElements = 1,
1689 kDisableMementos = 1 << 1, 1702 kDisableMementos = 1 << 1,
1690 kIsStrong = 1 << 2 1703 kIsStrong = 1 << 2
1691 }; 1704 };
1692 1705
1693 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, 1706 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
1694 FeedbackVectorSlotCache* cache) override; 1707 FeedbackVectorSlotCache* cache) override;
1695 FeedbackVectorSlot LiteralFeedbackSlot() const { return literal_slot_; } 1708 FeedbackVectorSlot LiteralFeedbackSlot() const { return literal_slot_; }
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
3526 // the parser-level zone. 3539 // the parser-level zone.
3527 Zone* parser_zone_; 3540 Zone* parser_zone_;
3528 AstValueFactory* ast_value_factory_; 3541 AstValueFactory* ast_value_factory_;
3529 }; 3542 };
3530 3543
3531 3544
3532 } // namespace internal 3545 } // namespace internal
3533 } // namespace v8 3546 } // namespace v8
3534 3547
3535 #endif // V8_AST_AST_H_ 3548 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698