Index: src/compiler/linkage.cc |
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc |
index ea7b57f6144fcddbc1d6547092bb7ee5d0c4e191..48a1bb45376c236739c26434bdddd1ecff298ddd 100644 |
--- a/src/compiler/linkage.cc |
+++ b/src/compiler/linkage.cc |
@@ -345,10 +345,10 @@ CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, |
// The target for JS function calls is the JSFunction object. |
MachineType target_type = MachineType::AnyTagged(); |
- // TODO(titzer): When entering into an OSR function from unoptimized code, |
- // the JSFunction is not in a register, but it is on the stack in an |
- // unaddressable spill slot. We hack this in the OSR prologue. Fix. |
- LinkageLocation target_loc = regloc(kJSFunctionRegister); |
+ // When entering into an OSR function from unoptimized code the JSFunction |
+ // is not in a register, but it is on the stack in the marker spill slot. |
+ LinkageLocation target_loc = is_osr ? LinkageLocation::ForSavedCallerMarker() |
+ : regloc(kJSFunctionRegister); |
return new (zone) CallDescriptor( // -- |
CallDescriptor::kCallJSFunction, // kind |
target_type, // target MachineType |