Parser cleanup: Cached data cannot contain errors (removed dead code)
authormarja@chromium.org <marja@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Jul 2014 09:31:58 +0000 (09:31 +0000)
committermarja@chromium.org <marja@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Jul 2014 09:31:58 +0000 (09:31 +0000)
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

src/parser.cc

index 7566bc3..261de4e 100644 (file)
@@ -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());