Index: src/compiler/linkage.cc |
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc |
index 915ff09c14fac194774bd9ca7257eb10d92a9076..9c3fae1a59d0cd2e96a907408f344d82ebf6c240 100644 |
--- a/src/compiler/linkage.cc |
+++ b/src/compiler/linkage.cc |
@@ -566,6 +566,28 @@ LinkageLocation Linkage::GetOsrValueLocation(int index) const { |
return incoming_->GetInputLocation(parameter_index); |
} |
} |
+ |
+ |
+bool Linkage::ParameterHasSecondaryLocation(int index) const { |
+ if (incoming_->kind() != CallDescriptor::kCallJSFunction) return false; |
+ LinkageLocation loc = GetParameterLocation(index); |
+ return (loc == regloc(kJSFunctionRegister) || |
+ loc == regloc(kContextRegister)); |
+} |
+ |
+LinkageLocation Linkage::GetParameterSecondaryLocation(int index) const { |
+ DCHECK(ParameterHasSecondaryLocation(index)); |
+ LinkageLocation loc = GetParameterLocation(index); |
+ |
+ if (loc == regloc(kJSFunctionRegister)) { |
+ return LinkageLocation::ForCalleeFrameSlot(Frame::kJSFunctionSlot); |
+ } else { |
+ DCHECK(loc == regloc(kContextRegister)); |
+ return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
+ } |
+} |
+ |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |