Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1257)

Unified Diff: runtime/vm/deferred_objects.cc

Issue 1343373003: Revert "VM: New calling convention for generated code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger_x64.cc ('k') | runtime/vm/deopt_instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/deferred_objects.cc
diff --git a/runtime/vm/deferred_objects.cc b/runtime/vm/deferred_objects.cc
index 6aac45a6c392a200830157eb44d2c61baadb3381..a647af1768a356b2db103551cd94df8463f4cd59 100644
--- a/runtime/vm/deferred_objects.cc
+++ b/runtime/vm/deferred_objects.cc
@@ -161,7 +161,11 @@ void DeferredPcMarker::Materialize(DeoptContext* deopt_context) {
uword* dest_addr = reinterpret_cast<uword*>(slot());
Function& function = Function::Handle(zone);
function ^= deopt_context->ObjectAt(index_);
- ASSERT(!function.IsNull());
+ if (function.IsNull()) {
+ // Callee's PC marker is not used (pc of Deoptimize stub). Set to 0.
+ *dest_addr = 0;
+ return;
+ }
const Error& error = Error::Handle(zone,
Compiler::EnsureUnoptimizedCode(thread, function));
if (!error.IsNull()) {
@@ -170,7 +174,9 @@ void DeferredPcMarker::Materialize(DeoptContext* deopt_context) {
const Code& code = Code::Handle(zone, function.unoptimized_code());
ASSERT(!code.IsNull());
ASSERT(function.HasCode());
- *reinterpret_cast<RawObject**>(dest_addr) = code.raw();
+ const intptr_t pc_marker =
+ code.EntryPoint() + Assembler::EntryPointToPcMarkerOffset();
+ *dest_addr = pc_marker;
if (FLAG_trace_deoptimization_verbose) {
OS::PrintErr("materializing pc marker at 0x%" Px ": %s, %s\n",
« no previous file with comments | « runtime/vm/debugger_x64.cc ('k') | runtime/vm/deopt_instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698