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

Side by Side Diff: src/preparse-data.h

Issue 376223002: Refactor ScriptData class for cached compile data. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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_PREPARSE_DATA_H_ 5 #ifndef V8_PREPARSE_DATA_H_
6 #define V8_PREPARSE_DATA_H_ 6 #define V8_PREPARSE_DATA_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/compiler.h"
vogelheim 2014/07/09 17:23:36 If this is only for CompleteParserRecorder::GetScr
Yang 2014/07/10 08:28:46 Done.
9 #include "src/hashmap.h" 10 #include "src/hashmap.h"
10 #include "src/preparse-data-format.h" 11 #include "src/preparse-data-format.h"
11 #include "src/utils-inl.h" 12 #include "src/utils-inl.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
15 16
16 17
17 // Abstract interface for preparse data recorder. 18 // Abstract interface for preparse data recorder.
18 class ParserRecorder { 19 class ParserRecorder {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 143 }
143 144
144 // Logs an error message and marks the log as containing an error. 145 // Logs an error message and marks the log as containing an error.
145 // Further logging will be ignored, and ExtractData will return a vector 146 // Further logging will be ignored, and ExtractData will return a vector
146 // representing the error only. 147 // representing the error only.
147 virtual void LogMessage(int start, 148 virtual void LogMessage(int start,
148 int end, 149 int end,
149 const char* message, 150 const char* message,
150 const char* argument_opt, 151 const char* argument_opt,
151 bool is_reference_error_); 152 bool is_reference_error_);
152 Vector<unsigned> ExtractData(); 153 ScriptData* GetScriptData();
153 154
154 private: 155 private:
155 bool has_error() { 156 bool has_error() {
156 return static_cast<bool>(preamble_[PreparseDataConstants::kHasErrorOffset]); 157 return static_cast<bool>(preamble_[PreparseDataConstants::kHasErrorOffset]);
157 } 158 }
158 159
159 void WriteString(Vector<const char> str); 160 void WriteString(Vector<const char> str);
160 161
161 // Write a non-negative number to the symbol store. 162 // Write a non-negative number to the symbol store.
162 void WriteNumber(int number); 163 void WriteNumber(int number);
163 164
164 Collector<unsigned> function_store_; 165 Collector<unsigned> function_store_;
165 unsigned preamble_[PreparseDataConstants::kHeaderSize]; 166 unsigned preamble_[PreparseDataConstants::kHeaderSize];
166 167
167 #ifdef DEBUG 168 #ifdef DEBUG
168 int prev_start_; 169 int prev_start_;
169 #endif 170 #endif
170 }; 171 };
171 172
172 173
173 } } // namespace v8::internal. 174 } } // namespace v8::internal.
174 175
175 #endif // V8_PREPARSE_DATA_H_ 176 #endif // V8_PREPARSE_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698