| 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 19 matching lines...) Expand all Loading... |
| 30 "Propagate IC data from unoptimized to optimized IC calls."); | 30 "Propagate IC data from unoptimized to optimized IC calls."); |
| 31 DEFINE_FLAG(bool, two_args_smi_icd, true, | 31 DEFINE_FLAG(bool, two_args_smi_icd, true, |
| 32 "Generate special IC stubs for two args Smi operations"); | 32 "Generate special IC stubs for two args Smi operations"); |
| 33 DEFINE_FLAG(bool, unbox_numeric_fields, true, | 33 DEFINE_FLAG(bool, unbox_numeric_fields, true, |
| 34 "Support unboxed double and float32x4 fields."); | 34 "Support unboxed double and float32x4 fields."); |
| 35 DECLARE_FLAG(bool, enable_type_checks); | 35 DECLARE_FLAG(bool, enable_type_checks); |
| 36 DECLARE_FLAG(bool, eliminate_type_checks); | 36 DECLARE_FLAG(bool, eliminate_type_checks); |
| 37 DECLARE_FLAG(bool, trace_optimization); | 37 DECLARE_FLAG(bool, trace_optimization); |
| 38 DECLARE_FLAG(bool, trace_constant_propagation); | 38 DECLARE_FLAG(bool, trace_constant_propagation); |
| 39 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 39 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 40 DECLARE_FLAG(bool, prune_dead_locals); |
| 40 | 41 |
| 41 Definition::Definition(intptr_t deopt_id) | 42 Definition::Definition(intptr_t deopt_id) |
| 42 : Instruction(deopt_id), | 43 : Instruction(deopt_id), |
| 43 range_(NULL), | 44 range_(NULL), |
| 44 type_(NULL), | 45 type_(NULL), |
| 45 temp_index_(-1), | 46 temp_index_(-1), |
| 46 ssa_temp_index_(-1), | 47 ssa_temp_index_(-1), |
| 47 input_use_list_(NULL), | 48 input_use_list_(NULL), |
| 48 env_use_list_(NULL), | 49 env_use_list_(NULL), |
| 49 constant_value_(Object::ZoneHandle(ConstantPropagator::Unknown())) { | 50 constant_value_(Object::ZoneHandle(ConstantPropagator::Unknown())) { |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 // Currently, phis are stored in a sparse array that holds the phi | 1061 // Currently, phis are stored in a sparse array that holds the phi |
| 1061 // for variable with index i at position i. | 1062 // for variable with index i at position i. |
| 1062 // TODO(fschneider): Store phis in a more compact way. | 1063 // TODO(fschneider): Store phis in a more compact way. |
| 1063 if (phis_ == NULL) { | 1064 if (phis_ == NULL) { |
| 1064 phis_ = new ZoneGrowableArray<PhiInstr*>(var_count); | 1065 phis_ = new ZoneGrowableArray<PhiInstr*>(var_count); |
| 1065 for (intptr_t i = 0; i < var_count; i++) { | 1066 for (intptr_t i = 0; i < var_count; i++) { |
| 1066 phis_->Add(NULL); | 1067 phis_->Add(NULL); |
| 1067 } | 1068 } |
| 1068 } | 1069 } |
| 1069 ASSERT((*phis_)[var_index] == NULL); | 1070 ASSERT((*phis_)[var_index] == NULL); |
| 1070 (*phis_)[var_index] = new PhiInstr(this, PredecessorCount()); | 1071 PhiInstr* phi = new PhiInstr(this, PredecessorCount()); |
| 1072 (*phis_)[var_index] = phi; |
| 1073 if (!FLAG_prune_dead_locals) { |
| 1074 phi->mark_alive(); |
| 1075 } |
| 1071 } | 1076 } |
| 1072 | 1077 |
| 1073 | 1078 |
| 1074 void JoinEntryInstr::InsertPhi(PhiInstr* phi) { | 1079 void JoinEntryInstr::InsertPhi(PhiInstr* phi) { |
| 1075 // Lazily initialize the array of phis. | 1080 // Lazily initialize the array of phis. |
| 1076 if (phis_ == NULL) { | 1081 if (phis_ == NULL) { |
| 1077 phis_ = new ZoneGrowableArray<PhiInstr*>(1); | 1082 phis_ = new ZoneGrowableArray<PhiInstr*>(1); |
| 1078 } | 1083 } |
| 1079 phis_->Add(phi); | 1084 phis_->Add(phi); |
| 1080 } | 1085 } |
| (...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3358 case Token::kTRUNCDIV: return 0; | 3363 case Token::kTRUNCDIV: return 0; |
| 3359 case Token::kMOD: return 1; | 3364 case Token::kMOD: return 1; |
| 3360 default: UNIMPLEMENTED(); return -1; | 3365 default: UNIMPLEMENTED(); return -1; |
| 3361 } | 3366 } |
| 3362 } | 3367 } |
| 3363 | 3368 |
| 3364 | 3369 |
| 3365 #undef __ | 3370 #undef __ |
| 3366 | 3371 |
| 3367 } // namespace dart | 3372 } // namespace dart |
| OLD | NEW |