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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 } | 125 } |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 void FlowGraphCompiler::Bailout(const char* reason) { | 130 void FlowGraphCompiler::Bailout(const char* reason) { |
131 const char* kFormat = "FlowGraphCompiler Bailout: %s %s."; | 131 const char* kFormat = "FlowGraphCompiler Bailout: %s %s."; |
132 const char* function_name = parsed_function().function().ToCString(); | 132 const char* function_name = parsed_function().function().ToCString(); |
133 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 133 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
134 char* chars = reinterpret_cast<char*>( | 134 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
135 Isolate::Current()->current_zone()->Allocate(len)); | |
136 OS::SNPrint(chars, len, kFormat, function_name, reason); | 135 OS::SNPrint(chars, len, kFormat, function_name, reason); |
137 const Error& error = Error::Handle( | 136 const Error& error = Error::Handle( |
138 LanguageError::New(String::Handle(String::New(chars)))); | 137 LanguageError::New(String::Handle(String::New(chars)))); |
139 Isolate::Current()->long_jump_base()->Jump(1, error); | 138 Isolate::Current()->long_jump_base()->Jump(1, error); |
140 } | 139 } |
141 | 140 |
142 | 141 |
143 intptr_t FlowGraphCompiler::StackSize() const { | 142 intptr_t FlowGraphCompiler::StackSize() const { |
144 if (is_ssa_) { | 143 if (is_ssa_) { |
145 return block_order_[0]->AsGraphEntry()->spill_slot_count(); | 144 return block_order_[0]->AsGraphEntry()->spill_slot_count(); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 return; | 799 return; |
801 } | 800 } |
802 } | 801 } |
803 | 802 |
804 // This move is not blocked. | 803 // This move is not blocked. |
805 EmitMove(index); | 804 EmitMove(index); |
806 } | 805 } |
807 | 806 |
808 | 807 |
809 } // namespace dart | 808 } // namespace dart |
OLD | NEW |