Commit c30c2298 authored by marja@chromium.org's avatar marja@chromium.org

Parser cleanup: Cached data cannot contain errors (removed dead code)

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.

R=rossberg@chromium.org
BUG=

Review URL: https://codereview.chromium.org/367373007

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent fec1dd12
...@@ -4857,20 +4857,7 @@ bool Parser::Parse() { ...@@ -4857,20 +4857,7 @@ bool Parser::Parse() {
} }
} else { } else {
SetCachedData(info()->cached_data(), info()->cached_data_mode()); SetCachedData(info()->cached_data(), info()->cached_data_mode());
if (info()->cached_data_mode() == CONSUME_CACHED_DATA && result = ParseProgram();
(*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();
}
} }
info()->SetFunction(result); info()->SetFunction(result);
ASSERT(ast_value_factory_->IsInternalized()); ASSERT(ast_value_factory_->IsInternalized());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment