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

Unified Diff: src/parsing/preparse-data.cc

Issue 2474393003: [parser] Give preparser and parser independent loggers (Closed)
Patch Set: Addressed comment Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/preparse-data.h ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparse-data.cc
diff --git a/src/parsing/preparse-data.cc b/src/parsing/preparse-data.cc
index c3170a2161de5a9ed4e51980baa6d9c78ba1ba21..c3eb306c7b6dc60706ab6894810994868cb1d5c0 100644
--- a/src/parsing/preparse-data.cc
+++ b/src/parsing/preparse-data.cc
@@ -12,10 +12,11 @@
namespace v8 {
namespace internal {
-void CompleteParserRecorder::LogFunction(
- int start, int end, int num_parameters, int function_length,
- bool has_duplicate_parameters, int literals, int properties,
- LanguageMode language_mode, bool uses_super_property, bool calls_eval) {
+void ParserLogger::LogFunction(int start, int end, int num_parameters,
+ int function_length,
+ bool has_duplicate_parameters, int literals,
+ int properties, LanguageMode language_mode,
+ bool uses_super_property, bool calls_eval) {
function_store_.Add(start);
function_store_.Add(end);
function_store_.Add(num_parameters);
@@ -27,7 +28,7 @@ void CompleteParserRecorder::LogFunction(
has_duplicate_parameters));
}
-CompleteParserRecorder::CompleteParserRecorder() {
+ParserLogger::ParserLogger() {
preamble_[PreparseDataConstants::kMagicOffset] =
PreparseDataConstants::kMagicNumber;
preamble_[PreparseDataConstants::kVersionOffset] =
@@ -41,11 +42,9 @@ CompleteParserRecorder::CompleteParserRecorder() {
#endif
}
-
-void CompleteParserRecorder::LogMessage(int start_pos, int end_pos,
- MessageTemplate::Template message,
- const char* arg_opt,
- ParseErrorType error_type) {
+void ParserLogger::LogMessage(int start_pos, int end_pos,
+ MessageTemplate::Template message,
+ const char* arg_opt, ParseErrorType error_type) {
if (HasError()) return;
preamble_[PreparseDataConstants::kHasErrorOffset] = true;
function_store_.Reset();
@@ -63,16 +62,14 @@ void CompleteParserRecorder::LogMessage(int start_pos, int end_pos,
if (arg_opt != NULL) WriteString(CStrVector(arg_opt));
}
-
-void CompleteParserRecorder::WriteString(Vector<const char> str) {
+void ParserLogger::WriteString(Vector<const char> str) {
function_store_.Add(str.length());
for (int i = 0; i < str.length(); i++) {
function_store_.Add(str[i]);
}
}
-
-ScriptData* CompleteParserRecorder::GetScriptData() {
+ScriptData* ParserLogger::GetScriptData() {
int function_size = function_store_.size();
int total_size = PreparseDataConstants::kHeaderSize + function_size;
unsigned* data = NewArray<unsigned>(total_size);
« no previous file with comments | « src/parsing/preparse-data.h ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698