| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 | 157 |
| 158 void DeferredPcMarker::Materialize(DeoptContext* deopt_context) { | 158 void DeferredPcMarker::Materialize(DeoptContext* deopt_context) { |
| 159 Thread* thread = deopt_context->thread(); | 159 Thread* thread = deopt_context->thread(); |
| 160 Zone* zone = deopt_context->zone(); | 160 Zone* zone = deopt_context->zone(); |
| 161 uword* dest_addr = reinterpret_cast<uword*>(slot()); | 161 uword* dest_addr = reinterpret_cast<uword*>(slot()); |
| 162 Function& function = Function::Handle(zone); | 162 Function& function = Function::Handle(zone); |
| 163 function ^= deopt_context->ObjectAt(index_); | 163 function ^= deopt_context->ObjectAt(index_); |
| 164 // Null case is already handled in DeoptPcMarkerInstr::Execute. | 164 if (function.IsNull()) { |
| 165 ASSERT(!function.IsNull()); | 165 // Callee's PC marker is not used (pc of Deoptimize stub). Set to 0. |
| 166 *dest_addr = 0; |
| 167 return; |
| 168 } |
| 166 const Error& error = Error::Handle(zone, | 169 const Error& error = Error::Handle(zone, |
| 167 Compiler::EnsureUnoptimizedCode(thread, function)); | 170 Compiler::EnsureUnoptimizedCode(thread, function)); |
| 168 if (!error.IsNull()) { | 171 if (!error.IsNull()) { |
| 169 Exceptions::PropagateError(error); | 172 Exceptions::PropagateError(error); |
| 170 } | 173 } |
| 171 const Code& code = Code::Handle(zone, function.unoptimized_code()); | 174 const Code& code = Code::Handle(zone, function.unoptimized_code()); |
| 172 ASSERT(!code.IsNull()); | 175 ASSERT(!code.IsNull()); |
| 173 ASSERT(function.HasCode()); | 176 ASSERT(function.HasCode()); |
| 174 const intptr_t pc_marker = | 177 const intptr_t pc_marker = |
| 175 code.EntryPoint() + Assembler::EntryPointToPcMarkerOffset(); | 178 code.EntryPoint() + Assembler::EntryPointToPcMarkerOffset(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 OS::PrintErr(" null Field @ offset(%" Pd ") <- %s\n", | 335 OS::PrintErr(" null Field @ offset(%" Pd ") <- %s\n", |
| 333 offset.Value(), | 336 offset.Value(), |
| 334 value.ToCString()); | 337 value.ToCString()); |
| 335 } | 338 } |
| 336 } | 339 } |
| 337 } | 340 } |
| 338 } | 341 } |
| 339 } | 342 } |
| 340 | 343 |
| 341 } // namespace dart | 344 } // namespace dart |
| OLD | NEW |