| 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/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/locations.h" | 10 #include "vm/locations.h" |
| (...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 code ^= deopt_context->ObjectAt(object_table_index_); | 1063 code ^= deopt_context->ObjectAt(object_table_index_); |
| 1064 if (code.IsNull()) { | 1064 if (code.IsNull()) { |
| 1065 // Callee's PC marker is not used (pc of Deoptimize stub). Set to 0. | 1065 // Callee's PC marker is not used (pc of Deoptimize stub). Set to 0. |
| 1066 *dest_addr = 0; | 1066 *dest_addr = 0; |
| 1067 return; | 1067 return; |
| 1068 } | 1068 } |
| 1069 const Function& function = | 1069 const Function& function = |
| 1070 Function::Handle(deopt_context->isolate(), code.function()); | 1070 Function::Handle(deopt_context->isolate(), code.function()); |
| 1071 ASSERT(function.HasCode()); | 1071 ASSERT(function.HasCode()); |
| 1072 const intptr_t pc_marker = | 1072 const intptr_t pc_marker = |
| 1073 code.EntryPoint() + Assembler::kEntryPointToPcMarkerOffset; | 1073 code.EntryPoint() + Assembler::EntryPointToPcMarkerOffset(); |
| 1074 *dest_addr = pc_marker; | 1074 *dest_addr = pc_marker; |
| 1075 // Increment the deoptimization counter. This effectively increments each | 1075 // Increment the deoptimization counter. This effectively increments each |
| 1076 // function occurring in the optimized frame. | 1076 // function occurring in the optimized frame. |
| 1077 function.set_deoptimization_counter(function.deoptimization_counter() + 1); | 1077 function.set_deoptimization_counter(function.deoptimization_counter() + 1); |
| 1078 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { | 1078 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
| 1079 OS::PrintErr("Deoptimizing %s (count %d)\n", | 1079 OS::PrintErr("Deoptimizing %s (count %d)\n", |
| 1080 function.ToFullyQualifiedCString(), | 1080 function.ToFullyQualifiedCString(), |
| 1081 function.deoptimization_counter()); | 1081 function.deoptimization_counter()); |
| 1082 } | 1082 } |
| 1083 // Clear invocation counter so that hopefully the function gets reoptimized | 1083 // Clear invocation counter so that hopefully the function gets reoptimized |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 Smi* offset, | 1756 Smi* offset, |
| 1757 DeoptInfo* info, | 1757 DeoptInfo* info, |
| 1758 Smi* reason) { | 1758 Smi* reason) { |
| 1759 intptr_t i = index * kEntrySize; | 1759 intptr_t i = index * kEntrySize; |
| 1760 *offset ^= table.At(i); | 1760 *offset ^= table.At(i); |
| 1761 *info ^= table.At(i + 1); | 1761 *info ^= table.At(i + 1); |
| 1762 *reason ^= table.At(i + 2); | 1762 *reason ^= table.At(i + 2); |
| 1763 } | 1763 } |
| 1764 | 1764 |
| 1765 } // namespace dart | 1765 } // namespace dart |
| OLD | NEW |