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