Index: src/compiler/linkage.cc |
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc |
index c3f6074fa635453b5945947e60246793f981fb26..5ff8551def814efaac923c3005eca7402b493486 100644 |
--- a/src/compiler/linkage.cc |
+++ b/src/compiler/linkage.cc |
@@ -565,6 +565,29 @@ 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)); |
+ // return false; |
Jarin
2015/11/12 12:08:33
Remove comment.
|
+} |
+ |
+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 |