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

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

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 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
« no previous file with comments | « src/perf-jit.cc ('k') | src/preparse-data.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 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/hashmap.h" 9 #include "src/hashmap.h"
10 #include "src/preparse-data-format.h" 10 #include "src/preparse-data-format.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 : has_error_(false), start_(-1), end_(-1), is_reference_error_(false) {} 48 : has_error_(false), start_(-1), end_(-1), is_reference_error_(false) {}
49 virtual ~SingletonLogger() {} 49 virtual ~SingletonLogger() {}
50 50
51 void Reset() { has_error_ = false; } 51 void Reset() { has_error_ = false; }
52 52
53 virtual void LogFunction(int start, 53 virtual void LogFunction(int start,
54 int end, 54 int end,
55 int literals, 55 int literals,
56 int properties, 56 int properties,
57 StrictMode strict_mode) { 57 StrictMode strict_mode) {
58 ASSERT(!has_error_); 58 DCHECK(!has_error_);
59 start_ = start; 59 start_ = start;
60 end_ = end; 60 end_ = end;
61 literals_ = literals; 61 literals_ = literals;
62 properties_ = properties; 62 properties_ = properties;
63 strict_mode_ = strict_mode; 63 strict_mode_ = strict_mode;
64 } 64 }
65 65
66 // Logs an error message and marks the log as containing an error. 66 // Logs an error message and marks the log as containing an error.
67 // Further logging will be ignored, and ExtractData will return a vector 67 // Further logging will be ignored, and ExtractData will return a vector
68 // representing the error only. 68 // representing the error only.
69 virtual void LogMessage(int start, 69 virtual void LogMessage(int start,
70 int end, 70 int end,
71 const char* message, 71 const char* message,
72 const char* argument_opt, 72 const char* argument_opt,
73 bool is_reference_error) { 73 bool is_reference_error) {
74 if (has_error_) return; 74 if (has_error_) return;
75 has_error_ = true; 75 has_error_ = true;
76 start_ = start; 76 start_ = start;
77 end_ = end; 77 end_ = end;
78 message_ = message; 78 message_ = message;
79 argument_opt_ = argument_opt; 79 argument_opt_ = argument_opt;
80 is_reference_error_ = is_reference_error; 80 is_reference_error_ = is_reference_error;
81 } 81 }
82 82
83 bool has_error() const { return has_error_; } 83 bool has_error() const { return has_error_; }
84 84
85 int start() const { return start_; } 85 int start() const { return start_; }
86 int end() const { return end_; } 86 int end() const { return end_; }
87 int literals() const { 87 int literals() const {
88 ASSERT(!has_error_); 88 DCHECK(!has_error_);
89 return literals_; 89 return literals_;
90 } 90 }
91 int properties() const { 91 int properties() const {
92 ASSERT(!has_error_); 92 DCHECK(!has_error_);
93 return properties_; 93 return properties_;
94 } 94 }
95 StrictMode strict_mode() const { 95 StrictMode strict_mode() const {
96 ASSERT(!has_error_); 96 DCHECK(!has_error_);
97 return strict_mode_; 97 return strict_mode_;
98 } 98 }
99 int is_reference_error() const { return is_reference_error_; } 99 int is_reference_error() const { return is_reference_error_; }
100 const char* message() { 100 const char* message() {
101 ASSERT(has_error_); 101 DCHECK(has_error_);
102 return message_; 102 return message_;
103 } 103 }
104 const char* argument_opt() const { 104 const char* argument_opt() const {
105 ASSERT(has_error_); 105 DCHECK(has_error_);
106 return argument_opt_; 106 return argument_opt_;
107 } 107 }
108 108
109 private: 109 private:
110 bool has_error_; 110 bool has_error_;
111 int start_; 111 int start_;
112 int end_; 112 int end_;
113 // For function entries. 113 // For function entries.
114 int literals_; 114 int literals_;
115 int properties_; 115 int properties_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 int end, 150 int end,
151 const char* message, 151 const char* message,
152 const char* argument_opt, 152 const char* argument_opt,
153 bool is_reference_error_); 153 bool is_reference_error_);
154 ScriptData* GetScriptData(); 154 ScriptData* GetScriptData();
155 155
156 bool HasError() { 156 bool HasError() {
157 return static_cast<bool>(preamble_[PreparseDataConstants::kHasErrorOffset]); 157 return static_cast<bool>(preamble_[PreparseDataConstants::kHasErrorOffset]);
158 } 158 }
159 Vector<unsigned> ErrorMessageData() { 159 Vector<unsigned> ErrorMessageData() {
160 ASSERT(HasError()); 160 DCHECK(HasError());
161 return function_store_.ToVector(); 161 return function_store_.ToVector();
162 } 162 }
163 163
164 private: 164 private:
165 void WriteString(Vector<const char> str); 165 void WriteString(Vector<const char> str);
166 166
167 // Write a non-negative number to the symbol store. 167 // Write a non-negative number to the symbol store.
168 void WriteNumber(int number); 168 void WriteNumber(int number);
169 169
170 Collector<unsigned> function_store_; 170 Collector<unsigned> function_store_;
171 unsigned preamble_[PreparseDataConstants::kHeaderSize]; 171 unsigned preamble_[PreparseDataConstants::kHeaderSize];
172 172
173 #ifdef DEBUG 173 #ifdef DEBUG
174 int prev_start_; 174 int prev_start_;
175 #endif 175 #endif
176 }; 176 };
177 177
178 178
179 } } // namespace v8::internal. 179 } } // namespace v8::internal.
180 180
181 #endif // V8_PREPARSE_DATA_H_ 181 #endif // V8_PREPARSE_DATA_H_
OLDNEW
« no previous file with comments | « src/perf-jit.cc ('k') | src/preparse-data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698