| 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/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 use->instruction()->GetBlock()->InsideTryBlock()) { | 2137 use->instruction()->GetBlock()->InsideTryBlock()) { |
| 2138 return true; | 2138 return true; |
| 2139 } | 2139 } |
| 2140 } | 2140 } |
| 2141 return false; | 2141 return false; |
| 2142 } | 2142 } |
| 2143 | 2143 |
| 2144 | 2144 |
| 2145 Definition* BoxInstr::Canonicalize(FlowGraph* flow_graph) { | 2145 Definition* BoxInstr::Canonicalize(FlowGraph* flow_graph) { |
| 2146 if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) { | 2146 if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) { |
| 2147 // Environments can accomodate any representation. No need to box. | 2147 // Environments can accommodate any representation. No need to box. |
| 2148 return value()->definition(); | 2148 return value()->definition(); |
| 2149 } | 2149 } |
| 2150 | 2150 |
| 2151 // Fold away Box<rep>(Unbox<rep>(v)) if value is known to be of the | 2151 // Fold away Box<rep>(Unbox<rep>(v)) if value is known to be of the |
| 2152 // right class. | 2152 // right class. |
| 2153 UnboxInstr* unbox_defn = value()->definition()->AsUnbox(); | 2153 UnboxInstr* unbox_defn = value()->definition()->AsUnbox(); |
| 2154 if ((unbox_defn != NULL) && | 2154 if ((unbox_defn != NULL) && |
| 2155 (unbox_defn->representation() == from_representation()) && | 2155 (unbox_defn->representation() == from_representation()) && |
| 2156 (unbox_defn->value()->Type()->ToCid() == Type()->ToCid())) { | 2156 (unbox_defn->value()->Type()->ToCid() == Type()->ToCid())) { |
| 2157 return unbox_defn->value()->definition(); | 2157 return unbox_defn->value()->definition(); |
| (...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4002 "native function '%s' (%" Pd " arguments) cannot be found", | 4002 "native function '%s' (%" Pd " arguments) cannot be found", |
| 4003 native_name().ToCString(), function().NumParameters()); | 4003 native_name().ToCString(), function().NumParameters()); |
| 4004 } | 4004 } |
| 4005 set_is_auto_scope(auto_setup_scope); | 4005 set_is_auto_scope(auto_setup_scope); |
| 4006 set_native_c_function(native_function); | 4006 set_native_c_function(native_function); |
| 4007 } | 4007 } |
| 4008 | 4008 |
| 4009 #undef __ | 4009 #undef __ |
| 4010 | 4010 |
| 4011 } // namespace dart | 4011 } // namespace dart |
| OLD | NEW |