| 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 "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/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 3835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3846 void FlowGraphBuilder::PruneUnreachable() { | 3846 void FlowGraphBuilder::PruneUnreachable() { |
| 3847 ASSERT(osr_id_ != Isolate::kNoDeoptId); | 3847 ASSERT(osr_id_ != Isolate::kNoDeoptId); |
| 3848 BitVector* block_marks = new BitVector(last_used_block_id_ + 1); | 3848 BitVector* block_marks = new BitVector(last_used_block_id_ + 1); |
| 3849 bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_, | 3849 bool found = graph_entry_->PruneUnreachable(this, graph_entry_, NULL, osr_id_, |
| 3850 block_marks); | 3850 block_marks); |
| 3851 ASSERT(found); | 3851 ASSERT(found); |
| 3852 } | 3852 } |
| 3853 | 3853 |
| 3854 | 3854 |
| 3855 void FlowGraphBuilder::Bailout(const char* reason) { | 3855 void FlowGraphBuilder::Bailout(const char* reason) { |
| 3856 const char* kFormat = "FlowGraphBuilder Bailout: %s %s"; | 3856 const Function& function = parsed_function_->function(); |
| 3857 const char* function_name = parsed_function_->function().ToCString(); | |
| 3858 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | |
| 3859 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | |
| 3860 OS::SNPrint(chars, len, kFormat, function_name, reason); | |
| 3861 const Error& error = Error::Handle( | 3857 const Error& error = Error::Handle( |
| 3862 LanguageError::New(String::Handle(String::New(chars)))); | 3858 LanguageError::NewFormatted(Error::Handle(), // No previous error. |
| 3859 Script::Handle(function.script()), |
| 3860 function.token_pos(), |
| 3861 LanguageError::kError, |
| 3862 Heap::kNew, |
| 3863 "FlowGraphBuilder Bailout: %s %s", |
| 3864 String::Handle(function.name()).ToCString(), |
| 3865 reason)); |
| 3863 Isolate::Current()->long_jump_base()->Jump(1, error); | 3866 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3864 } | 3867 } |
| 3865 | 3868 |
| 3866 | 3869 |
| 3867 } // namespace dart | 3870 } // namespace dart |
| OLD | NEW |