| 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/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 return false; | 1412 return false; |
| 1413 } | 1413 } |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 | 1416 |
| 1417 Definition* ConstantInstr::Canonicalize(FlowGraph* flow_graph) { | 1417 Definition* ConstantInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1418 return HasUses() ? this : NULL; | 1418 return HasUses() ? this : NULL; |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 | 1421 |
| 1422 // A math unary instruction has a side effect (exception |
| 1423 // thrown) if the argument is not a number. |
| 1424 // TODO(srdjan): eliminate if has no uses and input is guaranteed to be number. |
| 1422 Definition* MathUnaryInstr::Canonicalize(FlowGraph* flow_graph) { | 1425 Definition* MathUnaryInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1423 return HasUses() ? this : NULL; | 1426 return this; |
| 1424 } | 1427 } |
| 1425 | 1428 |
| 1426 | 1429 |
| 1427 Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) { | 1430 Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1428 if (!HasUses()) return NULL; | 1431 if (!HasUses()) return NULL; |
| 1429 if (!IsImmutableLengthLoad()) return this; | 1432 if (!IsImmutableLengthLoad()) return this; |
| 1430 | 1433 |
| 1431 // For fixed length arrays if the array is the result of a known constructor | 1434 // For fixed length arrays if the array is the result of a known constructor |
| 1432 // call we can replace the length load with the length argument passed to | 1435 // call we can replace the length load with the length argument passed to |
| 1433 // the constructor. | 1436 // the constructor. |
| (...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3142 case Token::kTRUNCDIV: return 0; | 3145 case Token::kTRUNCDIV: return 0; |
| 3143 case Token::kMOD: return 1; | 3146 case Token::kMOD: return 1; |
| 3144 default: UNIMPLEMENTED(); return -1; | 3147 default: UNIMPLEMENTED(); return -1; |
| 3145 } | 3148 } |
| 3146 } | 3149 } |
| 3147 | 3150 |
| 3148 | 3151 |
| 3149 #undef __ | 3152 #undef __ |
| 3150 | 3153 |
| 3151 } // namespace dart | 3154 } // namespace dart |
| OLD | NEW |