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 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 if (box_defn != NULL) { | 2058 if (box_defn != NULL) { |
2059 if (box_defn->value()->definition()->representation() == representation()) { | 2059 if (box_defn->value()->definition()->representation() == representation()) { |
2060 return box_defn->value()->definition(); | 2060 return box_defn->value()->definition(); |
2061 } else { | 2061 } else { |
2062 UnboxedIntConverterInstr* converter = new UnboxedIntConverterInstr( | 2062 UnboxedIntConverterInstr* converter = new UnboxedIntConverterInstr( |
2063 box_defn->value()->definition()->representation(), | 2063 box_defn->value()->definition()->representation(), |
2064 representation(), | 2064 representation(), |
2065 box_defn->value()->CopyWithType(), | 2065 box_defn->value()->CopyWithType(), |
2066 (representation() == kUnboxedInt32) ? | 2066 (representation() == kUnboxedInt32) ? |
2067 GetDeoptId() : Isolate::kNoDeoptId); | 2067 GetDeoptId() : Isolate::kNoDeoptId); |
2068 if ((representation() == kUnboxedInt32) && is_truncating()) { | 2068 // TODO(vegorov): marking resulting converted as truncating when |
| 2069 // unboxing can't deoptimize is a work-around missing |
| 2070 // deoptimization environment in case when we insert converter after |
| 2071 // EliminateEnvironments and there is mismatch between predicates |
| 2072 // UnboxIntConverterInstr::CanDeoptimize and UnboxInt32::CanDeoptimize. |
| 2073 if ((representation() == kUnboxedInt32) && |
| 2074 (is_truncating() || !CanDeoptimize())) { |
2069 converter->mark_truncating(); | 2075 converter->mark_truncating(); |
2070 } | 2076 } |
2071 flow_graph->InsertBefore(this, converter, env(), FlowGraph::kValue); | 2077 flow_graph->InsertBefore(this, converter, env(), FlowGraph::kValue); |
2072 return converter; | 2078 return converter; |
2073 } | 2079 } |
2074 } | 2080 } |
2075 | 2081 |
2076 return this; | 2082 return this; |
2077 } | 2083 } |
2078 | 2084 |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3472 case Token::kTRUNCDIV: return 0; | 3478 case Token::kTRUNCDIV: return 0; |
3473 case Token::kMOD: return 1; | 3479 case Token::kMOD: return 1; |
3474 default: UNIMPLEMENTED(); return -1; | 3480 default: UNIMPLEMENTED(); return -1; |
3475 } | 3481 } |
3476 } | 3482 } |
3477 | 3483 |
3478 | 3484 |
3479 #undef __ | 3485 #undef __ |
3480 | 3486 |
3481 } // namespace dart | 3487 } // namespace dart |
OLD | NEW |