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

Unified Diff: runtime/vm/flow_graph.cc

Issue 68113028: Lazily format LanguageError messages (fix issue 15069). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
Index: runtime/vm/flow_graph.cc
===================================================================
--- runtime/vm/flow_graph.cc (revision 30298)
+++ runtime/vm/flow_graph.cc (working copy)
@@ -1068,12 +1068,17 @@
void FlowGraph::Bailout(const char* reason) const {
const char* kFormat = "FlowGraph Bailout: %s %s";
- const char* function_name = parsed_function_.function().ToCString();
+ const Function& function = parsed_function_.function();
+ const char* function_name = function.ToCString();
intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
OS::SNPrint(chars, len, kFormat, function_name, reason);
const Error& error = Error::Handle(
- LanguageError::New(String::Handle(String::New(chars))));
+ LanguageError::New(Error::Handle(), // No previous error.
+ Script::Handle(function.script()),
Ivan Posva 2013/11/15 04:42:13 Now that we report script and position, do we real
regis 2013/11/15 18:27:38 Done.
+ function.token_pos(),
+ LanguageError::kError,
+ String::Handle(String::New(chars))));
Isolate::Current()->long_jump_base()->Jump(1, error);
}

Powered by Google App Engine
This is Rietveld 408576698