OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class ParserRecorder { | 42 class ParserRecorder { |
43 public: | 43 public: |
44 ParserRecorder() { } | 44 ParserRecorder() { } |
45 virtual ~ParserRecorder() { } | 45 virtual ~ParserRecorder() { } |
46 | 46 |
47 // Logs the scope and some details of a function literal in the source. | 47 // Logs the scope and some details of a function literal in the source. |
48 virtual void LogFunction(int start, | 48 virtual void LogFunction(int start, |
49 int end, | 49 int end, |
50 int literals, | 50 int literals, |
51 int properties, | 51 int properties, |
52 int strict_mode) = 0; | 52 StrictModeFlag strict_mode) = 0; |
53 | 53 |
54 // Logs a symbol creation of a literal or identifier. | 54 // Logs a symbol creation of a literal or identifier. |
55 virtual void LogAsciiSymbol(int start, Vector<const char> literal) { } | 55 virtual void LogAsciiSymbol(int start, Vector<const char> literal) { } |
56 virtual void LogUC16Symbol(int start, Vector<const uc16> literal) { } | 56 virtual void LogUC16Symbol(int start, Vector<const uc16> literal) { } |
57 | 57 |
58 // Logs an error message and marks the log as containing an error. | 58 // Logs an error message and marks the log as containing an error. |
59 // Further logging will be ignored, and ExtractData will return a vector | 59 // Further logging will be ignored, and ExtractData will return a vector |
60 // representing the error only. | 60 // representing the error only. |
61 virtual void LogMessage(int start, | 61 virtual void LogMessage(int start, |
62 int end, | 62 int end, |
(...skipping 19 matching lines...) Expand all Loading... |
82 | 82 |
83 class FunctionLoggingParserRecorder : public ParserRecorder { | 83 class FunctionLoggingParserRecorder : public ParserRecorder { |
84 public: | 84 public: |
85 FunctionLoggingParserRecorder(); | 85 FunctionLoggingParserRecorder(); |
86 virtual ~FunctionLoggingParserRecorder() {} | 86 virtual ~FunctionLoggingParserRecorder() {} |
87 | 87 |
88 virtual void LogFunction(int start, | 88 virtual void LogFunction(int start, |
89 int end, | 89 int end, |
90 int literals, | 90 int literals, |
91 int properties, | 91 int properties, |
92 int strict_mode) { | 92 StrictModeFlag strict_mode) { |
93 function_store_.Add(start); | 93 function_store_.Add(start); |
94 function_store_.Add(end); | 94 function_store_.Add(end); |
95 function_store_.Add(literals); | 95 function_store_.Add(literals); |
96 function_store_.Add(properties); | 96 function_store_.Add(properties); |
97 function_store_.Add(strict_mode); | 97 function_store_.Add(strict_mode); |
98 } | 98 } |
99 | 99 |
100 // Logs an error message and marks the log as containing an error. | 100 // Logs an error message and marks the log as containing an error. |
101 // Further logging will be ignored, and ExtractData will return a vector | 101 // Further logging will be ignored, and ExtractData will return a vector |
102 // representing the error only. | 102 // representing the error only. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 Collector<byte> symbol_store_; | 222 Collector<byte> symbol_store_; |
223 Collector<Key> symbol_keys_; | 223 Collector<Key> symbol_keys_; |
224 HashMap symbol_table_; | 224 HashMap symbol_table_; |
225 int symbol_id_; | 225 int symbol_id_; |
226 }; | 226 }; |
227 | 227 |
228 | 228 |
229 } } // namespace v8::internal. | 229 } } // namespace v8::internal. |
230 | 230 |
231 #endif // V8_PREPARSE_DATA_H_ | 231 #endif // V8_PREPARSE_DATA_H_ |
OLD | NEW |