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

Unified Diff: src/parsing/parsing.cc

Issue 2650883002: Reland: [Compiler] Enable handles created during parsing and scope analysis to be deferred. (Closed)
Patch Set: Remove unused variable Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parsing.h ('k') | src/pending-compilation-error-handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parsing.cc
diff --git a/src/parsing/parsing.cc b/src/parsing/parsing.cc
index db07bde7c7a77977727ceb7909a7ade54fcdcaf4..ede13ac9953ec069f0053404a9612ffbc13d66c0 100644
--- a/src/parsing/parsing.cc
+++ b/src/parsing/parsing.cc
@@ -15,7 +15,7 @@ namespace v8 {
namespace internal {
namespace parsing {
-bool ParseProgram(ParseInfo* info) {
+bool ParseProgram(ParseInfo* info, bool internalize) {
DCHECK(info->is_toplevel());
DCHECK_NULL(info->literal());
@@ -29,14 +29,19 @@ bool ParseProgram(ParseInfo* info) {
parser.SetCachedData(info);
result = parser.ParseProgram(isolate, info);
info->set_literal(result);
- parser.Internalize(isolate, info->script(), result == nullptr);
- if (result != nullptr) {
+ if (result == nullptr) {
+ parser.ReportErrors(isolate, info->script());
+ } else {
info->set_language_mode(info->literal()->language_mode());
}
+ parser.UpdateStatistics(isolate, info->script());
+ if (internalize) {
+ info->ast_value_factory()->Internalize(isolate);
+ }
return (result != nullptr);
}
-bool ParseFunction(ParseInfo* info) {
+bool ParseFunction(ParseInfo* info, bool internalize) {
DCHECK(!info->is_toplevel());
DCHECK_NULL(info->literal());
@@ -49,12 +54,19 @@ bool ParseFunction(ParseInfo* info) {
result = parser.ParseFunction(isolate, info);
info->set_literal(result);
- parser.Internalize(isolate, info->script(), result == nullptr);
+ if (result == nullptr) {
+ parser.ReportErrors(isolate, info->script());
+ }
+ parser.UpdateStatistics(isolate, info->script());
+ if (internalize) {
+ info->ast_value_factory()->Internalize(isolate);
+ }
return (result != nullptr);
}
-bool ParseAny(ParseInfo* info) {
- return info->is_toplevel() ? ParseProgram(info) : ParseFunction(info);
+bool ParseAny(ParseInfo* info, bool internalize) {
+ return info->is_toplevel() ? ParseProgram(info, internalize)
+ : ParseFunction(info, internalize);
}
} // namespace parsing
« no previous file with comments | « src/parsing/parsing.h ('k') | src/pending-compilation-error-handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698