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

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
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3874 void FlowGraphBuilder::PruneUnreachable() { 3874 void FlowGraphBuilder::PruneUnreachable() {
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 Function& function = parsed_function_->function();
3885 const char* function_name = parsed_function_->function().ToCString();
3886 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3887 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3888 OS::SNPrint(chars, len, kFormat, function_name, reason);
3889 const Error& error = Error::Handle( 3885 const Error& error = Error::Handle(
3890 LanguageError::New(String::Handle(String::New(chars)))); 3886 LanguageError::NewFormatted(Error::Handle(), // No previous error.
3887 Script::Handle(function.script()),
3888 function.token_pos(),
3889 LanguageError::kError,
3890 Heap::kNew,
3891 "FlowGraphBuilder Bailout: %s %s",
3892 String::Handle(function.name()).ToCString(),
3893 reason));
3891 Isolate::Current()->long_jump_base()->Jump(1, error); 3894 Isolate::Current()->long_jump_base()->Jump(1, error);
3892 } 3895 }
3893 3896
3894 3897
3895 } // namespace dart 3898 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698