OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_PARSING_PREPARSE_DATA_H_ | 5 #ifndef V8_PARSING_PREPARSE_DATA_H_ |
6 #define V8_PARSING_PREPARSE_DATA_H_ | 6 #define V8_PARSING_PREPARSE_DATA_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
10 #include "src/collector.h" | 10 #include "src/collector.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 SingletonLogger() | 74 SingletonLogger() |
75 : has_error_(false), start_(-1), end_(-1), error_type_(kSyntaxError) {} | 75 : has_error_(false), start_(-1), end_(-1), error_type_(kSyntaxError) {} |
76 virtual ~SingletonLogger() {} | 76 virtual ~SingletonLogger() {} |
77 | 77 |
78 void Reset() { has_error_ = false; } | 78 void Reset() { has_error_ = false; } |
79 | 79 |
80 virtual void LogFunction(int start, int end, int literals, int properties, | 80 virtual void LogFunction(int start, int end, int literals, int properties, |
81 LanguageMode language_mode, bool uses_super_property, | 81 LanguageMode language_mode, bool uses_super_property, |
82 bool calls_eval) { | 82 bool calls_eval) { |
83 DCHECK(!has_error_); | 83 DCHECK(!has_error_); |
| 84 // Check that we only log at most one function. |
| 85 DCHECK(start_ == -1 && end_ == -1); |
84 start_ = start; | 86 start_ = start; |
85 end_ = end; | 87 end_ = end; |
86 literals_ = literals; | 88 literals_ = literals; |
87 properties_ = properties; | 89 properties_ = properties; |
88 language_mode_ = language_mode; | 90 language_mode_ = language_mode; |
89 uses_super_property_ = uses_super_property; | 91 uses_super_property_ = uses_super_property; |
90 calls_eval_ = calls_eval; | 92 calls_eval_ = calls_eval; |
91 } | 93 } |
92 | 94 |
93 // Logs an error message and marks the log as containing an error. | 95 // Logs an error message and marks the log as containing an error. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 #ifdef DEBUG | 206 #ifdef DEBUG |
205 int prev_start_; | 207 int prev_start_; |
206 #endif | 208 #endif |
207 }; | 209 }; |
208 | 210 |
209 | 211 |
210 } // namespace internal | 212 } // namespace internal |
211 } // namespace v8. | 213 } // namespace v8. |
212 | 214 |
213 #endif // V8_PARSING_PREPARSE_DATA_H_ | 215 #endif // V8_PARSING_PREPARSE_DATA_H_ |
OLD | NEW |