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/deopt_instructions.h" | 5 #include "vm/deopt_instructions.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/intermediate_language.h" | 10 #include "vm/intermediate_language.h" |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { | 659 void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) { |
660 Function& function = Function::Handle(deopt_context->zone()); | 660 Function& function = Function::Handle(deopt_context->zone()); |
661 function ^= deopt_context->ObjectAt(object_table_index_); | 661 function ^= deopt_context->ObjectAt(object_table_index_); |
662 if (function.IsNull()) { | 662 if (function.IsNull()) { |
663 *reinterpret_cast<RawObject**>(dest_addr) = deopt_context->is_lazy_deopt() | 663 *reinterpret_cast<RawObject**>(dest_addr) = deopt_context->is_lazy_deopt() |
664 ? StubCode::DeoptimizeLazy_entry()->code() | 664 ? StubCode::DeoptimizeLazy_entry()->code() |
665 : StubCode::Deoptimize_entry()->code(); | 665 : StubCode::Deoptimize_entry()->code(); |
666 return; | 666 return; |
667 } | 667 } |
668 | 668 |
669 *dest_addr = reinterpret_cast<intptr_t>(Object::null()); | 669 // We don't always have the Code object for the frame's corresponding |
670 deopt_context->DeferPcMarkerMaterialization( | 670 // unoptimized code as it may have been collected. Use a stub as the pc |
671 object_table_index_, dest_addr); | 671 // marker until we can recreate that Code object during deferred |
| 672 // materialization to maintain the invariant that Dart frames always have |
| 673 // a pc marker. |
| 674 *reinterpret_cast<RawObject**>(dest_addr) = |
| 675 StubCode::FrameAwaitingMaterialization_entry()->code(); |
| 676 deopt_context->DeferPcMarkerMaterialization(object_table_index_, dest_addr); |
672 } | 677 } |
673 | 678 |
674 private: | 679 private: |
675 intptr_t object_table_index_; | 680 intptr_t object_table_index_; |
676 | 681 |
677 DISALLOW_COPY_AND_ASSIGN(DeoptPcMarkerInstr); | 682 DISALLOW_COPY_AND_ASSIGN(DeoptPcMarkerInstr); |
678 }; | 683 }; |
679 | 684 |
680 | 685 |
681 // Deoptimization instruction creating a pool pointer for the code of | 686 // Deoptimization instruction creating a pool pointer for the code of |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 Smi* offset, | 1314 Smi* offset, |
1310 TypedData* info, | 1315 TypedData* info, |
1311 Smi* reason) { | 1316 Smi* reason) { |
1312 intptr_t i = index * kEntrySize; | 1317 intptr_t i = index * kEntrySize; |
1313 *offset ^= table.At(i); | 1318 *offset ^= table.At(i); |
1314 *info ^= table.At(i + 1); | 1319 *info ^= table.At(i + 1); |
1315 *reason ^= table.At(i + 2); | 1320 *reason ^= table.At(i + 2); |
1316 } | 1321 } |
1317 | 1322 |
1318 } // namespace dart | 1323 } // namespace dart |
OLD | NEW |