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/deferred_objects.h" | 5 #include "vm/deferred_objects.h" |
6 | 6 |
7 #include "vm/code_patcher.h" | 7 #include "vm/code_patcher.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/deopt_instructions.h" | 9 #include "vm/deopt_instructions.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 uword pc = code.GetPcForDeoptId(deopt_id_, RawPcDescriptors::kIcCall); | 132 uword pc = code.GetPcForDeoptId(deopt_id_, RawPcDescriptors::kIcCall); |
133 if (pc != 0) { | 133 if (pc != 0) { |
134 // If the deoptimization happened at an IC call, update the IC data | 134 // If the deoptimization happened at an IC call, update the IC data |
135 // to avoid repeated deoptimization at the same site next time around. | 135 // to avoid repeated deoptimization at the same site next time around. |
136 ICData& ic_data = ICData::Handle(zone); | 136 ICData& ic_data = ICData::Handle(zone); |
137 CodePatcher::GetInstanceCallAt(pc, code, &ic_data); | 137 CodePatcher::GetInstanceCallAt(pc, code, &ic_data); |
138 if (!ic_data.IsNull()) { | 138 if (!ic_data.IsNull()) { |
139 ic_data.AddDeoptReason(deopt_context->deopt_reason()); | 139 ic_data.AddDeoptReason(deopt_context->deopt_reason()); |
| 140 // Propagate the reason to all ICData-s with same deopt_id since |
| 141 // only unoptimized-code ICData (IC calls) are propagated. |
| 142 function.SetDeoptReasonForAll(ic_data.deopt_id(), |
| 143 deopt_context->deopt_reason()); |
140 } | 144 } |
141 } else { | 145 } else { |
142 if (deopt_context->HasDeoptFlag(ICData::kHoisted)) { | 146 if (deopt_context->HasDeoptFlag(ICData::kHoisted)) { |
143 // Prevent excessive deoptimization. | 147 // Prevent excessive deoptimization. |
144 function.set_allows_hoisting_check_class(false); | 148 function.set_allows_hoisting_check_class(false); |
145 } | 149 } |
146 | 150 |
147 if (deopt_context->HasDeoptFlag(ICData::kGeneralized)) { | 151 if (deopt_context->HasDeoptFlag(ICData::kGeneralized)) { |
148 function.set_allows_bounds_check_generalization(false); | 152 function.set_allows_bounds_check_generalization(false); |
149 } | 153 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 OS::PrintErr(" null Field @ offset(%" Pd ") <- %s\n", | 335 OS::PrintErr(" null Field @ offset(%" Pd ") <- %s\n", |
332 offset.Value(), | 336 offset.Value(), |
333 value.ToCString()); | 337 value.ToCString()); |
334 } | 338 } |
335 } | 339 } |
336 } | 340 } |
337 } | 341 } |
338 } | 342 } |
339 | 343 |
340 } // namespace dart | 344 } // namespace dart |
OLD | NEW |