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

Side by Side Diff: src/parser.h

Issue 923683002: Fix lazy parsing for functions that use super. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Increment the PreparserData version 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
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »
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 14 matching lines...) Expand all
25 25
26 26
27 class FunctionEntry BASE_EMBEDDED { 27 class FunctionEntry BASE_EMBEDDED {
28 public: 28 public:
29 enum { 29 enum {
30 kStartPositionIndex, 30 kStartPositionIndex,
31 kEndPositionIndex, 31 kEndPositionIndex,
32 kLiteralCountIndex, 32 kLiteralCountIndex,
33 kPropertyCountIndex, 33 kPropertyCountIndex,
34 kLanguageModeIndex, 34 kLanguageModeIndex,
35 kUsesSuperPropertyIndex,
35 kSize 36 kSize
36 }; 37 };
37 38
38 explicit FunctionEntry(Vector<unsigned> backing) 39 explicit FunctionEntry(Vector<unsigned> backing)
39 : backing_(backing) { } 40 : backing_(backing) { }
40 41
41 FunctionEntry() : backing_() { } 42 FunctionEntry() : backing_() { }
42 43
43 int start_pos() { return backing_[kStartPositionIndex]; } 44 int start_pos() { return backing_[kStartPositionIndex]; }
44 int end_pos() { return backing_[kEndPositionIndex]; } 45 int end_pos() { return backing_[kEndPositionIndex]; }
45 int literal_count() { return backing_[kLiteralCountIndex]; } 46 int literal_count() { return backing_[kLiteralCountIndex]; }
46 int property_count() { return backing_[kPropertyCountIndex]; } 47 int property_count() { return backing_[kPropertyCountIndex]; }
47 LanguageMode language_mode() { 48 LanguageMode language_mode() {
48 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); 49 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex]));
49 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); 50 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]);
50 } 51 }
52 bool uses_super_property() { return backing_[kUsesSuperPropertyIndex]; }
51 53
52 bool is_valid() { return !backing_.is_empty(); } 54 bool is_valid() { return !backing_.is_empty(); }
53 55
54 private: 56 private:
55 Vector<unsigned> backing_; 57 Vector<unsigned> backing_;
56 }; 58 };
57 59
58 60
59 // Wrapper around ScriptData to provide parser-specific functionality. 61 // Wrapper around ScriptData to provide parser-specific functionality.
60 class ParseData { 62 class ParseData {
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 } 980 }
979 981
980 982
981 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 983 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
982 int start, Expression* tag) { 984 int start, Expression* tag) {
983 return parser_->CloseTemplateLiteral(state, start, tag); 985 return parser_->CloseTemplateLiteral(state, start, tag);
984 } 986 }
985 } } // namespace v8::internal 987 } } // namespace v8::internal
986 988
987 #endif // V8_PARSER_H_ 989 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698