Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
f6d69d49
Commit
f6d69d49
authored
9 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
some simplifications in CallMatcherNode
parent
6b58d659
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/CallMatcherNode.java
+5
-6
5 additions, 6 deletions
.../com/oracle/truffle/r/nodes/function/CallMatcherNode.java
with
5 additions
and
6 deletions
com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/CallMatcherNode.java
+
5
−
6
View file @
f6d69d49
...
...
@@ -52,8 +52,7 @@ public abstract class CallMatcherNode extends RBaseNode {
public
abstract
Object
execute
(
VirtualFrame
frame
,
ArgumentsSignature
suppliedSignature
,
Object
[]
suppliedArguments
,
RFunction
function
,
S3Args
s3Args
);
private
static
CallMatcherCachedNode
specialize
(
ArgumentsSignature
suppliedSignature
,
Object
[]
suppliedArguments
,
RFunction
function
,
CallMatcherNode
specializer
,
boolean
forNextMethod
,
boolean
argsAreEvaluated
,
CallMatcherNode
next
)
{
protected
CallMatcherCachedNode
specialize
(
ArgumentsSignature
suppliedSignature
,
Object
[]
suppliedArguments
,
RFunction
function
,
CallMatcherNode
next
)
{
int
argCount
=
suppliedArguments
.
length
;
int
argListSize
=
argCount
;
...
...
@@ -86,9 +85,9 @@ public abstract class CallMatcherNode extends RBaseNode {
assert
resultSignature
!=
null
;
ArgumentsSignature
formalSignature
=
ArgumentMatcher
.
getFunctionSignature
(
function
);
MatchPermutation
permutation
=
ArgumentMatcher
.
matchArguments
(
resultSignature
,
formalSignature
,
specializer
,
forNextMethod
,
function
.
getRBuiltin
());
MatchPermutation
permutation
=
ArgumentMatcher
.
matchArguments
(
resultSignature
,
formalSignature
,
this
,
forNextMethod
,
function
.
getRBuiltin
());
return
new
CallMatcherCachedNode
(
suppliedSignature
,
varArgSignatures
,
function
,
preparePermutation
,
permutation
,
specializer
,
forNextMethod
,
argsAreEvaluated
,
next
);
return
new
CallMatcherCachedNode
(
suppliedSignature
,
varArgSignatures
,
function
,
preparePermutation
,
permutation
,
forNextMethod
,
argsAreEvaluated
,
next
);
}
protected
Object
[]
prepareArguments
(
VirtualFrame
frame
,
Object
[]
reorderedArgs
,
ArgumentsSignature
reorderedSignature
,
RFunction
function
,
S3Args
s3Args
)
{
...
...
@@ -145,7 +144,7 @@ public abstract class CallMatcherNode extends RBaseNode {
if
(++
depth
>
MAX_CACHE_DEPTH
)
{
return
replace
(
new
CallMatcherGenericNode
(
forNextMethod
,
argsAreEvaluated
)).
execute
(
frame
,
suppliedSignature
,
suppliedArguments
,
function
,
s3Args
);
}
else
{
CallMatcherCachedNode
cachedNode
=
replace
(
specialize
(
suppliedSignature
,
suppliedArguments
,
function
,
this
,
forNextMethod
,
argsAreEvaluated
,
this
));
CallMatcherCachedNode
cachedNode
=
replace
(
specialize
(
suppliedSignature
,
suppliedArguments
,
function
,
this
));
// for splitting if necessary
if
(
cachedNode
.
call
!=
null
&&
RCallNode
.
needsSplitting
(
function
))
{
cachedNode
.
call
.
cloneCallTarget
();
...
...
@@ -177,7 +176,7 @@ public abstract class CallMatcherNode extends RBaseNode {
private
final
FormalArguments
formals
;
CallMatcherCachedNode
(
ArgumentsSignature
suppliedSignature
,
ArgumentsSignature
[]
varArgSignatures
,
RFunction
function
,
long
[]
preparePermutation
,
MatchPermutation
permutation
,
CallMatcherNode
specializer
,
boolean
forNextMethod
,
boolean
argsAreEvaluated
,
CallMatcherNode
next
)
{
boolean
forNextMethod
,
boolean
argsAreEvaluated
,
CallMatcherNode
next
)
{
super
(
forNextMethod
,
argsAreEvaluated
);
this
.
cachedSuppliedSignature
=
suppliedSignature
;
this
.
cachedVarArgSignatures
=
varArgSignatures
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment