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

Side by Side Diff: src/parser.h

Issue 792083002: Add materialized literals for tagged templates in preparser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 6 years 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/preparser.h » ('j') | src/preparser.h » ('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_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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 625
626 typedef TemplateLiteral* TemplateLiteralState; 626 typedef TemplateLiteral* TemplateLiteralState;
627 627
628 V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos); 628 V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos);
629 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail); 629 V8_INLINE void AddTemplateSpan(TemplateLiteralState* state, bool tail);
630 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state, 630 V8_INLINE void AddTemplateExpression(TemplateLiteralState* state,
631 Expression* expression); 631 Expression* expression);
632 V8_INLINE Expression* CloseTemplateLiteral(TemplateLiteralState* state, 632 V8_INLINE Expression* CloseTemplateLiteral(TemplateLiteralState* state,
633 int start, Expression* tag); 633 int start, Expression* tag);
634 V8_INLINE Expression* NoTemplateTag() { return NULL; } 634 V8_INLINE Expression* NoTemplateTag() { return NULL; }
635 V8_INLINE static bool IsTaggedTemplate(const Expression* tag) {
636 return tag != NULL;
637 }
635 638
636 private: 639 private:
637 Parser* parser_; 640 Parser* parser_;
638 }; 641 };
639 642
640 643
641 class Parser : public ParserBase<ParserTraits> { 644 class Parser : public ParserBase<ParserTraits> {
642 public: 645 public:
643 // Note that the hash seed in ParseInfo must be the hash seed from the 646 // Note that the hash seed in ParseInfo must be the hash seed from the
644 // Isolate's heap, otherwise the heap will be in an inconsistent state once 647 // Isolate's heap, otherwise the heap will be in an inconsistent state once
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 } 1003 }
1001 1004
1002 1005
1003 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 1006 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
1004 int start, Expression* tag) { 1007 int start, Expression* tag) {
1005 return parser_->CloseTemplateLiteral(state, start, tag); 1008 return parser_->CloseTemplateLiteral(state, start, tag);
1006 } 1009 }
1007 } } // namespace v8::internal 1010 } } // namespace v8::internal
1008 1011
1009 #endif // V8_PARSER_H_ 1012 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/preparser.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698