OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/globals.h" // Needed here to get TARGET_ARCH_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 | 177 |
178 | 178 |
179 void FlowGraphCompiler::RecordAfterCallHelper(TokenPosition token_pos, | 179 void FlowGraphCompiler::RecordAfterCallHelper(TokenPosition token_pos, |
180 intptr_t deopt_id, | 180 intptr_t deopt_id, |
181 intptr_t argument_count, | 181 intptr_t argument_count, |
182 CallResult result, | 182 CallResult result, |
183 LocationSummary* locs) { | 183 LocationSummary* locs) { |
184 RecordSafepoint(locs); | 184 RecordSafepoint(locs); |
185 // Marks either the continuation point in unoptimized code or the | 185 // Marks either the continuation point in unoptimized code or the |
186 // deoptimization point in optimized code, after call. | 186 // deoptimization point in optimized code, after call. |
187 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | |
188 if (is_optimizing()) { | 187 if (is_optimizing()) { |
189 // Return/ReturnTOS instruction drops incoming arguments so | 188 // Return/ReturnTOS instruction drops incoming arguments so |
190 // we have to drop outgoing arguments from the innermost environment. | 189 // we have to drop outgoing arguments from the innermost environment. |
191 // On all other architectures caller drops outgoing arguments itself | 190 // On all other architectures caller drops outgoing arguments itself |
192 // hence the difference. | 191 // hence the difference. |
193 pending_deoptimization_env_->DropArguments(argument_count); | 192 pending_deoptimization_env_->DropArguments(argument_count); |
194 CompilerDeoptInfo* info = AddDeoptIndexAtCall(deopt_id_after); | 193 intptr_t deopt_id_after; |
Vyacheslav Egorov (Google)
2017/05/24 19:14:05
This is a bit suspicious. What kind of instruction
rmacnak
2017/05/24 19:17:31
A CreateArrayInstr. The other architectures are fa
Vyacheslav Egorov (Google)
2017/05/24 19:25:17
I think it is possible to cause lazy deoptimizatio
Vyacheslav Egorov (Google)
2017/05/24 19:50:32
Actually these days a simplest repro like this wou
| |
195 if (result == kHasResult) { | 194 if (deopt_id == Thread::kNoDeoptId) { |
196 info->mark_lazy_deopt_with_result(); | 195 deopt_id_after = deopt_id; |
196 } else { | |
197 deopt_id_after = Thread::ToDeoptAfter(deopt_id); | |
198 CompilerDeoptInfo* info = AddDeoptIndexAtCall(deopt_id_after); | |
199 if (result == kHasResult) { | |
200 info->mark_lazy_deopt_with_result(); | |
201 } | |
197 } | 202 } |
198 // This descriptor is needed for exception handling in optimized code. | 203 // This descriptor is needed for exception handling in optimized code. |
199 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id_after, token_pos); | 204 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id_after, token_pos); |
200 } else { | 205 } else { |
201 // Add deoptimization continuation point after the call and before the | 206 // Add deoptimization continuation point after the call and before the |
202 // arguments are removed. | 207 // arguments are removed. |
208 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | |
203 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 209 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
204 } | 210 } |
205 } | 211 } |
206 | 212 |
207 | 213 |
208 void FlowGraphCompiler::RecordAfterCall(Instruction* instr, CallResult result) { | 214 void FlowGraphCompiler::RecordAfterCall(Instruction* instr, CallResult result) { |
209 RecordAfterCallHelper(instr->token_pos(), instr->deopt_id(), | 215 RecordAfterCallHelper(instr->token_pos(), instr->deopt_id(), |
210 instr->ArgumentCount(), result, instr->locs()); | 216 instr->ArgumentCount(), result, instr->locs()); |
211 } | 217 } |
212 | 218 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 581 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
576 UNIMPLEMENTED(); | 582 UNIMPLEMENTED(); |
577 } | 583 } |
578 | 584 |
579 | 585 |
580 #undef __ | 586 #undef __ |
581 | 587 |
582 } // namespace dart | 588 } // namespace dart |
583 | 589 |
584 #endif // defined TARGET_ARCH_DBC | 590 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |