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/cpu.h" | 8 #include "vm/cpu.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 TargetEntryInstr* normal_entry, | 458 TargetEntryInstr* normal_entry, |
459 intptr_t osr_id) | 459 intptr_t osr_id) |
460 : BlockEntryInstr(0, CatchClauseNode::kInvalidTryIndex), | 460 : BlockEntryInstr(0, CatchClauseNode::kInvalidTryIndex), |
461 parsed_function_(parsed_function), | 461 parsed_function_(parsed_function), |
462 normal_entry_(normal_entry), | 462 normal_entry_(normal_entry), |
463 catch_entries_(), | 463 catch_entries_(), |
464 initial_definitions_(), | 464 initial_definitions_(), |
465 osr_id_(osr_id), | 465 osr_id_(osr_id), |
466 entry_count_(0), | 466 entry_count_(0), |
467 spill_slot_count_(0), | 467 spill_slot_count_(0), |
468 fixed_slot_count_(0) { | 468 fixed_slot_count_(0), |
469 jump_cnt_(0), | |
470 await_joins_(), | |
471 await_levels_() { | |
469 } | 472 } |
470 | 473 |
471 | 474 |
472 ConstantInstr* GraphEntryInstr::constant_null() { | 475 ConstantInstr* GraphEntryInstr::constant_null() { |
473 ASSERT(initial_definitions_.length() > 0); | 476 ASSERT(initial_definitions_.length() > 0); |
474 for (intptr_t i = 0; i < initial_definitions_.length(); ++i) { | 477 for (intptr_t i = 0; i < initial_definitions_.length(); ++i) { |
475 ConstantInstr* defn = initial_definitions_[i]->AsConstant(); | 478 ConstantInstr* defn = initial_definitions_[i]->AsConstant(); |
476 if (defn != NULL && defn->value().IsNull()) return defn; | 479 if (defn != NULL && defn->value().IsNull()) return defn; |
477 } | 480 } |
478 UNREACHABLE(); | 481 UNREACHABLE(); |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1112 | 1115 |
1113 BlockEntryInstr* Instruction::SuccessorAt(intptr_t index) const { | 1116 BlockEntryInstr* Instruction::SuccessorAt(intptr_t index) const { |
1114 // Called only if index is in range. Only control-transfer instructions | 1117 // Called only if index is in range. Only control-transfer instructions |
1115 // can have non-zero successor counts and they override this function. | 1118 // can have non-zero successor counts and they override this function. |
1116 UNREACHABLE(); | 1119 UNREACHABLE(); |
1117 return NULL; | 1120 return NULL; |
1118 } | 1121 } |
1119 | 1122 |
1120 | 1123 |
1121 intptr_t GraphEntryInstr::SuccessorCount() const { | 1124 intptr_t GraphEntryInstr::SuccessorCount() const { |
1122 return 1 + catch_entries_.length(); | 1125 return 1 + catch_entries_.length() + await_joins_.length(); |
Florian Schneider
2014/10/09 11:29:31
After looking into the issue I don't think this ne
hausner
2014/10/13 23:41:26
Done.
| |
1123 } | 1126 } |
1124 | 1127 |
1125 | 1128 |
1126 BlockEntryInstr* GraphEntryInstr::SuccessorAt(intptr_t index) const { | 1129 BlockEntryInstr* GraphEntryInstr::SuccessorAt(intptr_t index) const { |
1127 if (index == 0) return normal_entry_; | 1130 if (index == 0) return normal_entry_; |
1128 return catch_entries_[index - 1]; | 1131 index--; |
Florian Schneider
2014/10/09 11:29:31
Revert this to the original code as well.
hausner
2014/10/13 23:41:26
Done.
| |
1132 if (index < catch_entries_.length()) { | |
1133 return catch_entries_[index]; | |
1134 } else { | |
1135 return await_joins_[index - catch_entries_.length()]; | |
1136 } | |
1129 } | 1137 } |
1130 | 1138 |
1131 | 1139 |
1132 intptr_t BranchInstr::SuccessorCount() const { | 1140 intptr_t BranchInstr::SuccessorCount() const { |
1133 return 2; | 1141 return 2; |
1134 } | 1142 } |
1135 | 1143 |
1136 | 1144 |
1137 BlockEntryInstr* BranchInstr::SuccessorAt(intptr_t index) const { | 1145 BlockEntryInstr* BranchInstr::SuccessorAt(intptr_t index) const { |
1138 if (index == 0) return true_successor_; | 1146 if (index == 0) return true_successor_; |
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3335 case Token::kTRUNCDIV: return 0; | 3343 case Token::kTRUNCDIV: return 0; |
3336 case Token::kMOD: return 1; | 3344 case Token::kMOD: return 1; |
3337 default: UNIMPLEMENTED(); return -1; | 3345 default: UNIMPLEMENTED(); return -1; |
3338 } | 3346 } |
3339 } | 3347 } |
3340 | 3348 |
3341 | 3349 |
3342 #undef __ | 3350 #undef __ |
3343 | 3351 |
3344 } // namespace dart | 3352 } // namespace dart |
OLD | NEW |