| 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/jit_optimizer.h" | 5 #include "vm/jit_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
| 9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 3100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3111 const String& field_name = | 3111 const String& field_name = |
| 3112 String::Handle(Z, Field::NameFromSetter(instr->function_name())); | 3112 String::Handle(Z, Field::NameFromSetter(instr->function_name())); |
| 3113 const Field& field = | 3113 const Field& field = |
| 3114 Field::ZoneHandle(Z, GetField(class_id, field_name)); | 3114 Field::ZoneHandle(Z, GetField(class_id, field_name)); |
| 3115 ASSERT(!field.IsNull()); | 3115 ASSERT(!field.IsNull()); |
| 3116 | 3116 |
| 3117 if (InstanceCallNeedsClassCheck(instr, RawFunction::kImplicitSetter)) { | 3117 if (InstanceCallNeedsClassCheck(instr, RawFunction::kImplicitSetter)) { |
| 3118 AddReceiverCheck(instr); | 3118 AddReceiverCheck(instr); |
| 3119 } | 3119 } |
| 3120 if (field.guarded_cid() != kDynamicCid) { | 3120 if (field.guarded_cid() != kDynamicCid) { |
| 3121 ASSERT(!FLAG_use_field_guards); |
| 3121 InsertBefore(instr, | 3122 InsertBefore(instr, |
| 3122 new(Z) GuardFieldClassInstr( | 3123 new(Z) GuardFieldClassInstr( |
| 3123 new(Z) Value(instr->ArgumentAt(1)), | 3124 new(Z) Value(instr->ArgumentAt(1)), |
| 3124 field, | 3125 field, |
| 3125 instr->deopt_id()), | 3126 instr->deopt_id()), |
| 3126 instr->env(), | 3127 instr->env(), |
| 3127 FlowGraph::kEffect); | 3128 FlowGraph::kEffect); |
| 3128 } | 3129 } |
| 3129 | 3130 |
| 3130 if (field.needs_length_check()) { | 3131 if (field.needs_length_check()) { |
| 3132 ASSERT(!FLAG_use_field_guards); |
| 3131 InsertBefore(instr, | 3133 InsertBefore(instr, |
| 3132 new(Z) GuardFieldLengthInstr( | 3134 new(Z) GuardFieldLengthInstr( |
| 3133 new(Z) Value(instr->ArgumentAt(1)), | 3135 new(Z) Value(instr->ArgumentAt(1)), |
| 3134 field, | 3136 field, |
| 3135 instr->deopt_id()), | 3137 instr->deopt_id()), |
| 3136 instr->env(), | 3138 instr->env(), |
| 3137 FlowGraph::kEffect); | 3139 FlowGraph::kEffect); |
| 3138 } | 3140 } |
| 3139 | 3141 |
| 3140 // Field guard was detached. | 3142 // Field guard was detached. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3151 | 3153 |
| 3152 // Discard the environment from the original instruction because the store | 3154 // Discard the environment from the original instruction because the store |
| 3153 // can't deoptimize. | 3155 // can't deoptimize. |
| 3154 instr->RemoveEnvironment(); | 3156 instr->RemoveEnvironment(); |
| 3155 ReplaceCall(instr, store); | 3157 ReplaceCall(instr, store); |
| 3156 return true; | 3158 return true; |
| 3157 } | 3159 } |
| 3158 | 3160 |
| 3159 | 3161 |
| 3160 } // namespace dart | 3162 } // namespace dart |
| OLD | NEW |