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

Unified Diff: runtime/vm/compiler.cc

Issue 1843253003: Fix disassembly with background compilation: parsing can report 'errors' in background compilation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index cd6208852615f9181c49291e4170cd94a473c42b..890338473ae1edbc84c50300a17a9713e9664926 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1375,15 +1375,20 @@ void Compiler::ComputeLocalVarDescriptors(const Code& code) {
ASSERT(var_descs.IsNull());
// IsIrregexpFunction have eager var descriptors generation.
ASSERT(!function.IsIrregexpFunction());
- // Parser should not produce any errors, therefore no LongJumpScope needed.
- // (exception is background compilation).
- ASSERT(!Compiler::IsBackgroundCompilation());
- Parser::ParseFunction(parsed_function);
- parsed_function->AllocateVariables();
- var_descs = parsed_function->node_sequence()->scope()->
- GetVarDescriptors(function);
- ASSERT(!var_descs.IsNull());
- code.set_var_descriptors(var_descs);
+ // In background compilation, parser can produce 'errors": bailouts
+ // if state changed while compiling in background.
+ LongJumpScope jump;
+ if (setjmp(*jump.Set()) == 0) {
+ Parser::ParseFunction(parsed_function);
+ parsed_function->AllocateVariables();
+ var_descs = parsed_function->node_sequence()->scope()->
+ GetVarDescriptors(function);
+ ASSERT(!var_descs.IsNull());
+ code.set_var_descriptors(var_descs);
+ } else {
+ // Only possible with background compilation.
+ ASSERT(Compiler::IsBackgroundCompilation());
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698