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

Side by Side Diff: runtime/vm/flow_graph_builder.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 3864 matching lines...) Expand 10 before | Expand all | Expand 10 after
3875 ASSERT(osr_id_ != Isolate::kNoDeoptId); 3875 ASSERT(osr_id_ != Isolate::kNoDeoptId);
3876 BitVector* block_marks = new BitVector(last_used_block_id_ + 1); 3876 BitVector* block_marks = new BitVector(last_used_block_id_ + 1);
3877 bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_, 3877 bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_,
3878 block_marks); 3878 block_marks);
3879 ASSERT(found); 3879 ASSERT(found);
3880 } 3880 }
3881 3881
3882 3882
3883 void FlowGraphBuilder::Bailout(const char* reason) { 3883 void FlowGraphBuilder::Bailout(const char* reason) {
3884 const char* kFormat = "FlowGraphBuilder Bailout: %s %s"; 3884 const char* kFormat = "FlowGraphBuilder Bailout: %s %s";
3885 const char* function_name = parsed_function_->function().ToCString(); 3885 const Function& function = parsed_function_->function();
3886 const char* function_name = function.ToCString();
3886 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3887 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3887 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3888 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3888 OS::SNPrint(chars, len, kFormat, function_name, reason); 3889 OS::SNPrint(chars, len, kFormat, function_name, reason);
3889 const Error& error = Error::Handle( 3890 const Error& error = Error::Handle(
3890 LanguageError::New(String::Handle(String::New(chars)))); 3891 LanguageError::New(Error::Handle(), // No previous error.
3892 Script::Handle(function.script()),
3893 function.token_pos(),
3894 LanguageError::kError,
3895 String::Handle(String::New(chars))));
Ivan Posva 2013/11/15 04:42:13 ditto.
regis 2013/11/15 18:27:38 Done.
3891 Isolate::Current()->long_jump_base()->Jump(1, error); 3896 Isolate::Current()->long_jump_base()->Jump(1, error);
3892 } 3897 }
3893 3898
3894 3899
3895 } // namespace dart 3900 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698