| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 pending_deoptimization_env_ = NULL; | 278 pending_deoptimization_env_ = NULL; |
| 279 EmitInstructionEpilogue(instr); | 279 EmitInstructionEpilogue(instr); |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 set_current_block(NULL); | 283 set_current_block(NULL); |
| 284 } | 284 } |
| 285 | 285 |
| 286 | 286 |
| 287 void FlowGraphCompiler::Bailout(const char* reason) { | 287 void FlowGraphCompiler::Bailout(const char* reason) { |
| 288 const char* kFormat = "FlowGraphCompiler Bailout: %s %s."; | 288 const Function& function = parsed_function_.function(); |
| 289 const char* function_name = parsed_function().function().ToCString(); | |
| 290 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | |
| 291 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | |
| 292 OS::SNPrint(chars, len, kFormat, function_name, reason); | |
| 293 const Error& error = Error::Handle( | 289 const Error& error = Error::Handle( |
| 294 LanguageError::New(String::Handle(String::New(chars)))); | 290 LanguageError::NewFormatted(Error::Handle(), // No previous error. |
| 291 Script::Handle(function.script()), |
| 292 function.token_pos(), |
| 293 LanguageError::kError, |
| 294 Heap::kNew, |
| 295 "FlowGraphCompiler Bailout: %s %s", |
| 296 String::Handle(function.name()).ToCString(), |
| 297 reason)); |
| 295 Isolate::Current()->long_jump_base()->Jump(1, error); | 298 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 296 } | 299 } |
| 297 | 300 |
| 298 | 301 |
| 299 intptr_t FlowGraphCompiler::StackSize() const { | 302 intptr_t FlowGraphCompiler::StackSize() const { |
| 300 if (is_optimizing_) { | 303 if (is_optimizing_) { |
| 301 return flow_graph_.graph_entry()->spill_slot_count(); | 304 return flow_graph_.graph_entry()->spill_slot_count(); |
| 302 } else { | 305 } else { |
| 303 return parsed_function_.num_stack_locals() + | 306 return parsed_function_.num_stack_locals() + |
| 304 parsed_function_.num_copied_params(); | 307 parsed_function_.num_copied_params(); |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 | 1207 |
| 1205 for (int i = 0; i < len; i++) { | 1208 for (int i = 0; i < len; i++) { |
| 1206 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1209 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
| 1207 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1210 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
| 1208 ic_data.GetCountAt(i))); | 1211 ic_data.GetCountAt(i))); |
| 1209 } | 1212 } |
| 1210 sorted->Sort(HighestCountFirst); | 1213 sorted->Sort(HighestCountFirst); |
| 1211 } | 1214 } |
| 1212 | 1215 |
| 1213 } // namespace dart | 1216 } // namespace dart |
| OLD | NEW |