| 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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 3976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3987 CatchClauseNode::kInvalidTryIndex); | 3987 CatchClauseNode::kInvalidTryIndex); |
| 3988 graph_entry_ = new GraphEntryInstr(parsed_function(), normal_entry, osr_id_); | 3988 graph_entry_ = new GraphEntryInstr(parsed_function(), normal_entry, osr_id_); |
| 3989 EffectGraphVisitor for_effect(this); | 3989 EffectGraphVisitor for_effect(this); |
| 3990 // This check may be deleted if the generated code is leaf. | 3990 // This check may be deleted if the generated code is leaf. |
| 3991 // Native functions don't need a stack check at entry. | 3991 // Native functions don't need a stack check at entry. |
| 3992 if (!function.is_native()) { | 3992 if (!function.is_native()) { |
| 3993 CheckStackOverflowInstr* check = | 3993 CheckStackOverflowInstr* check = |
| 3994 new CheckStackOverflowInstr(function.token_pos(), 0); | 3994 new CheckStackOverflowInstr(function.token_pos(), 0); |
| 3995 // If we are inlining don't actually attach the stack check. We must still | 3995 // If we are inlining don't actually attach the stack check. We must still |
| 3996 // create the stack check in order to allocate a deopt id. | 3996 // create the stack check in order to allocate a deopt id. |
| 3997 if (!IsInlining()) for_effect.AddInstruction(check); | 3997 if (!IsInlining()) { |
| 3998 for_effect.AddInstruction(check); |
| 3999 } |
| 3998 } | 4000 } |
| 3999 parsed_function()->node_sequence()->Visit(&for_effect); | 4001 parsed_function()->node_sequence()->Visit(&for_effect); |
| 4000 AppendFragment(normal_entry, for_effect); | 4002 AppendFragment(normal_entry, for_effect); |
| 4001 // Check that the graph is properly terminated. | 4003 // Check that the graph is properly terminated. |
| 4002 ASSERT(!for_effect.is_open()); | 4004 ASSERT(!for_effect.is_open()); |
| 4003 | 4005 |
| 4004 // When compiling for OSR, use a depth first search to prune instructions | 4006 // When compiling for OSR, use a depth first search to prune instructions |
| 4005 // unreachable from the OSR entry. Catch entries are not (yet) properly | 4007 // unreachable from the OSR entry. Catch entries are not (yet) properly |
| 4006 // recognized as reachable. | 4008 // recognized as reachable. |
| 4007 if (osr_id_ != Isolate::kNoDeoptId) { | 4009 if (osr_id_ != Isolate::kNoDeoptId) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 4034 LanguageError::kError, | 4036 LanguageError::kError, |
| 4035 Heap::kNew, | 4037 Heap::kNew, |
| 4036 "FlowGraphBuilder Bailout: %s %s", | 4038 "FlowGraphBuilder Bailout: %s %s", |
| 4037 String::Handle(function.name()).ToCString(), | 4039 String::Handle(function.name()).ToCString(), |
| 4038 reason)); | 4040 reason)); |
| 4039 Isolate::Current()->long_jump_base()->Jump(1, error); | 4041 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 4040 } | 4042 } |
| 4041 | 4043 |
| 4042 | 4044 |
| 4043 } // namespace dart | 4045 } // namespace dart |
| OLD | NEW |