Reviewers: rossberg,
Message:
rossberg, ptal
Description:
Parser cleanup: Cached data cannot contain errors.
We no longer store the errors in cached data (see Parser::ParseProgram())
and
storing them is an unnecessary optimization. In addition, the code which
extracts errors from cached data is wrong, since it stores the result of
BuildArgs (in ReportMessageAt) and then deletes it.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/367373007/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+1, -14 lines):
M src/parser.cc
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
7566bc3e34851a992d5cad8dda4b8e22cfd01557..261de4eed78e2021a3c8ff4dfa21dd7513bcb977
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4857,20 +4857,7 @@ bool Parser::Parse() {
}
} else {
SetCachedData(info()->cached_data(), info()->cached_data_mode());
- if (info()->cached_data_mode() == CONSUME_CACHED_DATA &&
- (*info()->cached_data())->has_error()) {
- ScriptData* cached_data = *(info()->cached_data());
- Scanner::Location loc = cached_data->MessageLocation();
- const char* message = cached_data->BuildMessage();
- const char* arg = cached_data->BuildArg();
- ParserTraits::ReportMessageAt(loc, message, arg,
- cached_data->IsReferenceError());
- DeleteArray(message);
- DeleteArray(arg);
- ASSERT(info()->isolate()->has_pending_exception());
- } else {
- result = ParseProgram();
- }
+ result = ParseProgram();
}
info()->SetFunction(result);
ASSERT(ast_value_factory_->IsInternalized());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.