OLD | NEW |
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 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 } | 2707 } |
2708 } | 2708 } |
2709 } | 2709 } |
2710 } | 2710 } |
2711 | 2711 |
2712 | 2712 |
2713 void FlowGraphBuilder::Bailout(const char* reason) { | 2713 void FlowGraphBuilder::Bailout(const char* reason) { |
2714 const char* kFormat = "FlowGraphBuilder Bailout: %s %s"; | 2714 const char* kFormat = "FlowGraphBuilder Bailout: %s %s"; |
2715 const char* function_name = parsed_function_.function().ToCString(); | 2715 const char* function_name = parsed_function_.function().ToCString(); |
2716 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2716 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
2717 char* chars = reinterpret_cast<char*>( | 2717 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
2718 Isolate::Current()->current_zone()->Allocate(len)); | |
2719 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2718 OS::SNPrint(chars, len, kFormat, function_name, reason); |
2720 const Error& error = Error::Handle( | 2719 const Error& error = Error::Handle( |
2721 LanguageError::New(String::Handle(String::New(chars)))); | 2720 LanguageError::New(String::Handle(String::New(chars)))); |
2722 Isolate::Current()->long_jump_base()->Jump(1, error); | 2721 Isolate::Current()->long_jump_base()->Jump(1, error); |
2723 } | 2722 } |
2724 | 2723 |
2725 | 2724 |
2726 } // namespace dart | 2725 } // namespace dart |
OLD | NEW |