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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 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 "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/code_descriptors.h" 9 #include "vm/code_descriptors.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2740 } 2740 }
2741 } 2741 }
2742 } 2742 }
2743 } 2743 }
2744 2744
2745 2745
2746 void FlowGraphBuilder::Bailout(const char* reason) { 2746 void FlowGraphBuilder::Bailout(const char* reason) {
2747 const char* kFormat = "FlowGraphBuilder Bailout: %s %s"; 2747 const char* kFormat = "FlowGraphBuilder Bailout: %s %s";
2748 const char* function_name = parsed_function_.function().ToCString(); 2748 const char* function_name = parsed_function_.function().ToCString();
2749 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2749 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2750 char* chars = reinterpret_cast<char*>( 2750 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2751 Isolate::Current()->current_zone()->Allocate(len));
2752 OS::SNPrint(chars, len, kFormat, function_name, reason); 2751 OS::SNPrint(chars, len, kFormat, function_name, reason);
2753 const Error& error = Error::Handle( 2752 const Error& error = Error::Handle(
2754 LanguageError::New(String::Handle(String::New(chars)))); 2753 LanguageError::New(String::Handle(String::New(chars))));
2755 Isolate::Current()->long_jump_base()->Jump(1, error); 2754 Isolate::Current()->long_jump_base()->Jump(1, error);
2756 } 2755 }
2757 2756
2758 2757
2759 } // namespace dart 2758 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698