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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/constant_propagator.h" | 8 #include "vm/constant_propagator.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 | 967 |
968 // 5. Iterate straight-line successors to record assigned variables and | 968 // 5. Iterate straight-line successors to record assigned variables and |
969 // find the last instruction in the block. The graph entry block consists | 969 // find the last instruction in the block. The graph entry block consists |
970 // of only the entry instruction, so that is the last instruction in the | 970 // of only the entry instruction, so that is the last instruction in the |
971 // block. | 971 // block. |
972 Instruction* last = this; | 972 Instruction* last = this; |
973 for (ForwardInstructionIterator it(this); !it.Done(); it.Advance()) { | 973 for (ForwardInstructionIterator it(this); !it.Done(); it.Advance()) { |
974 last = it.Current(); | 974 last = it.Current(); |
975 } | 975 } |
976 set_last_instruction(last); | 976 set_last_instruction(last); |
| 977 if (last->IsGoto()) last->AsGoto()->set_block(this); |
977 | 978 |
978 return true; | 979 return true; |
979 } | 980 } |
980 | 981 |
981 | 982 |
982 bool BlockEntryInstr::PruneUnreachable(FlowGraphBuilder* builder, | 983 bool BlockEntryInstr::PruneUnreachable(FlowGraphBuilder* builder, |
983 GraphEntryInstr* graph_entry, | 984 GraphEntryInstr* graph_entry, |
984 Instruction* parent, | 985 Instruction* parent, |
985 intptr_t osr_id, | 986 intptr_t osr_id, |
986 BitVector* block_marks) { | 987 BitVector* block_marks) { |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2718 bool optimizing) const { | 2719 bool optimizing) const { |
2719 UNREACHABLE(); | 2720 UNREACHABLE(); |
2720 return NULL; | 2721 return NULL; |
2721 } | 2722 } |
2722 | 2723 |
2723 | 2724 |
2724 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2725 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2725 __ Bind(compiler->GetJumpLabel(this)); | 2726 __ Bind(compiler->GetJumpLabel(this)); |
2726 if (!compiler->is_optimizing()) { | 2727 if (!compiler->is_optimizing()) { |
2727 if (compiler->NeedsEdgeCounter(this)) { | 2728 if (compiler->NeedsEdgeCounter(this)) { |
2728 compiler->EmitEdgeCounter(); | 2729 compiler->EmitEdgeCounter(preorder_number()); |
2729 } | 2730 } |
2730 // The deoptimization descriptor points after the edge counter code for | 2731 // The deoptimization descriptor points after the edge counter code for |
2731 // uniformity with ARM and MIPS, where we can reuse pattern matching | 2732 // uniformity with ARM and MIPS, where we can reuse pattern matching |
2732 // code that matches backwards from the end of the pattern. | 2733 // code that matches backwards from the end of the pattern. |
2733 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 2734 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
2734 GetDeoptId(), | 2735 GetDeoptId(), |
2735 Scanner::kNoSourcePos); | 2736 Scanner::kNoSourcePos); |
2736 } | 2737 } |
2737 if (HasParallelMove()) { | 2738 if (HasParallelMove()) { |
2738 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 2739 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3644 case Token::kTRUNCDIV: return 0; | 3645 case Token::kTRUNCDIV: return 0; |
3645 case Token::kMOD: return 1; | 3646 case Token::kMOD: return 1; |
3646 default: UNIMPLEMENTED(); return -1; | 3647 default: UNIMPLEMENTED(); return -1; |
3647 } | 3648 } |
3648 } | 3649 } |
3649 | 3650 |
3650 | 3651 |
3651 #undef __ | 3652 #undef __ |
3652 | 3653 |
3653 } // namespace dart | 3654 } // namespace dart |
OLD | NEW |