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

Side by Side Diff: src/parser.h

Issue 919703003: WIP: Implement ES6 Spread-calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Flag calls as spread calls in parser, error on spread intrinsics/construct calls Created 5 years, 10 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
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_PARSER_H_ 5 #ifndef V8_PARSER_H_
6 #define V8_PARSER_H_ 6 #define V8_PARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/compiler.h" // For CachedDataMode 10 #include "src/compiler.h" // For CachedDataMode
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail); 621 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail);
622 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state, 622 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state,
623 Expression* expression); 623 Expression* expression);
624 V8_INLINE Expression* CloseTemplateLiteral(TemplateLiteralState* state, 624 V8_INLINE Expression* CloseTemplateLiteral(TemplateLiteralState* state,
625 int start, Expression* tag); 625 int start, Expression* tag);
626 V8_INLINE Expression* NoTemplateTag() { return NULL; } 626 V8_INLINE Expression* NoTemplateTag() { return NULL; }
627 V8_INLINE static bool IsTaggedTemplate(const Expression* tag) { 627 V8_INLINE static bool IsTaggedTemplate(const Expression* tag) {
628 return tag != NULL; 628 return tag != NULL;
629 } 629 }
630 630
631 V8_INLINE void MarkSpreadCall(Expression* call) {
632 // TODO(caitp): support CallNew, CallRuntime
633 DCHECK(call->IsCall());
634 call->AsCall()->MarkSpreadCall();
635 }
636
631 private: 637 private:
632 Parser* parser_; 638 Parser* parser_;
633 }; 639 };
634 640
635 641
636 class Parser : public ParserBase<ParserTraits> { 642 class Parser : public ParserBase<ParserTraits> {
637 public: 643 public:
638 // Note that the hash seed in ParseInfo must be the hash seed from the 644 // Note that the hash seed in ParseInfo must be the hash seed from the
639 // Isolate's heap, otherwise the heap will be in an inconsistent state once 645 // Isolate's heap, otherwise the heap will be in an inconsistent state once
640 // the strings created by the Parser are internalized. 646 // the strings created by the Parser are internalized.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 } 984 }
979 985
980 986
981 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 987 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
982 int start, Expression* tag) { 988 int start, Expression* tag) {
983 return parser_->CloseTemplateLiteral(state, start, tag); 989 return parser_->CloseTemplateLiteral(state, start, tag);
984 } 990 }
985 } } // namespace v8::internal 991 } } // namespace v8::internal
986 992
987 #endif // V8_PARSER_H_ 993 #endif // V8_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698