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

Unified Diff: runtime/vm/compiler.cc

Issue 9443002: Added LongJump for bailout. When trying to fix all crashes, CHECK_ALIVE did not scale well as bail… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
===================================================================
--- runtime/vm/compiler.cc (revision 4539)
+++ runtime/vm/compiler.cc (working copy)
@@ -32,6 +32,7 @@
" certain optimizations");
DEFINE_FLAG(bool, use_new_compiler, false,
"Try to use the new compiler backend.");
+DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from new compiler.");
// Compile a function. Should call only if the function has not been compiled.
@@ -117,8 +118,22 @@
}
Parser::ParseFunction(&parsed_function);
if (FLAG_use_new_compiler) {
- FlowGraphBuilder graph_builder(parsed_function);
- graph_builder.BuildGraph();
+ LongJump* old_base = isolate->long_jump_base();
+ LongJump bailout_jump;
+ isolate->set_long_jump_base(&bailout_jump);
+ if (setjmp(*bailout_jump.Set()) == 0) {
+ FlowGraphBuilder graph_builder(parsed_function);
+ graph_builder.BuildGraph();
+ } else {
+ // We bailed out.
+ Error& bailout_error = Error::Handle(
+ isolate->object_store()->sticky_error());
+ isolate->object_store()->clear_sticky_error();
+ if (FLAG_trace_bailout) {
+ OS::Print("%s\n", bailout_error.ToErrorCString());
+ }
+ }
+ isolate->set_long_jump_base(old_base);
// Currently, always fails and falls through to the old compiler.
}
CodeIndexTable* code_index_table = isolate->code_index_table();
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698