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
16b6f941
Commit
16b6f941
authored
7 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
slow path without deop for PrepareArguments
parent
d9f598f8
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/call/PrepareArguments.java
+44
-5
44 additions, 5 deletions
...racle/truffle/r/nodes/function/call/PrepareArguments.java
with
44 additions
and
5 deletions
com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/call/PrepareArguments.java
+
44
−
5
View file @
16b6f941
...
@@ -27,6 +27,7 @@ import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
...
@@ -27,6 +27,7 @@ import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import
com.oracle.truffle.api.dsl.Cached
;
import
com.oracle.truffle.api.dsl.Cached
;
import
com.oracle.truffle.api.dsl.Fallback
;
import
com.oracle.truffle.api.dsl.Fallback
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.api.frame.MaterializedFrame
;
import
com.oracle.truffle.api.frame.VirtualFrame
;
import
com.oracle.truffle.api.frame.VirtualFrame
;
import
com.oracle.truffle.api.nodes.ExplodeLoop
;
import
com.oracle.truffle.api.nodes.ExplodeLoop
;
import
com.oracle.truffle.api.nodes.Node
;
import
com.oracle.truffle.api.nodes.Node
;
...
@@ -38,11 +39,13 @@ import com.oracle.truffle.r.nodes.function.FormalArguments;
...
@@ -38,11 +39,13 @@ import com.oracle.truffle.r.nodes.function.FormalArguments;
import
com.oracle.truffle.r.nodes.function.RCallNode
;
import
com.oracle.truffle.r.nodes.function.RCallNode
;
import
com.oracle.truffle.r.nodes.function.call.PrepareArgumentsFactory.PrepareArgumentsDefaultNodeGen
;
import
com.oracle.truffle.r.nodes.function.call.PrepareArgumentsFactory.PrepareArgumentsDefaultNodeGen
;
import
com.oracle.truffle.r.nodes.function.call.PrepareArgumentsFactory.PrepareArgumentsExplicitNodeGen
;
import
com.oracle.truffle.r.nodes.function.call.PrepareArgumentsFactory.PrepareArgumentsExplicitNodeGen
;
import
com.oracle.truffle.r.nodes.profile.TruffleBoundaryNode
;
import
com.oracle.truffle.r.runtime.Arguments
;
import
com.oracle.truffle.r.runtime.Arguments
;
import
com.oracle.truffle.r.runtime.ArgumentsSignature
;
import
com.oracle.truffle.r.runtime.ArgumentsSignature
;
import
com.oracle.truffle.r.runtime.RArguments.S3DefaultArguments
;
import
com.oracle.truffle.r.runtime.RArguments.S3DefaultArguments
;
import
com.oracle.truffle.r.runtime.RError
;
import
com.oracle.truffle.r.runtime.RError
;
import
com.oracle.truffle.r.runtime.RInternalError
;
import
com.oracle.truffle.r.runtime.RInternalError
;
import
com.oracle.truffle.r.runtime.SubstituteVirtualFrame
;
import
com.oracle.truffle.r.runtime.data.RArgsValuesAndNames
;
import
com.oracle.truffle.r.runtime.data.RArgsValuesAndNames
;
import
com.oracle.truffle.r.runtime.nodes.RNode
;
import
com.oracle.truffle.r.runtime.nodes.RNode
;
...
@@ -111,12 +114,48 @@ public abstract class PrepareArguments extends Node {
...
@@ -111,12 +114,48 @@ public abstract class PrepareArguments extends Node {
return
executeArgs
(
arguments
.
matchedArguments
,
arguments
.
matchedSuppliedSignature
,
frame
);
return
executeArgs
(
arguments
.
matchedArguments
,
arguments
.
matchedSuppliedSignature
,
frame
);
}
}
@Fallback
private
static
final
class
GenericCallEntry
extends
Node
{
public
RArgsValuesAndNames
prepareGeneric
(
VirtualFrame
frame
,
RArgsValuesAndNames
varArgs
,
S3DefaultArguments
s3DefaultArguments
,
@SuppressWarnings
(
"unused"
)
RCallNode
call
)
{
private
final
ArgumentsSignature
cachedVarArgSignature
;
CompilerDirectives
.
transferToInterpreter
();
private
final
S3DefaultArguments
cachedS3DefaultArguments
;
@Child
private
ArgumentsAndSignature
arguments
;
GenericCallEntry
(
ArgumentsSignature
cachedVarArgSignature
,
S3DefaultArguments
cachedS3DefaultArguments
,
ArgumentsAndSignature
arguments
)
{
this
.
cachedVarArgSignature
=
cachedVarArgSignature
;
this
.
cachedS3DefaultArguments
=
cachedS3DefaultArguments
;
this
.
arguments
=
arguments
;
}
}
/*
* Use a TruffleBoundaryNode to be able to switch child nodes without invalidating the whole
* method.
*/
protected
final
class
GenericCall
extends
TruffleBoundaryNode
{
@Child
private
GenericCallEntry
entry
;
@TruffleBoundary
public
RArgsValuesAndNames
execute
(
MaterializedFrame
materializedFrame
,
S3DefaultArguments
s3DefaultArguments
,
ArgumentsSignature
varArgSignature
,
RCallNode
call
)
{
GenericCallEntry
e
=
entry
;
if
(
e
==
null
||
e
.
cachedVarArgSignature
!=
varArgSignature
||
e
.
cachedS3DefaultArguments
!=
s3DefaultArguments
)
{
ArgumentsAndSignature
arguments
=
createArguments
(
call
,
varArgSignature
,
s3DefaultArguments
);
entry
=
e
=
insert
(
new
GenericCallEntry
(
varArgSignature
,
s3DefaultArguments
,
arguments
));
}
VirtualFrame
frame
=
SubstituteVirtualFrame
.
create
(
materializedFrame
);
return
executeArgs
(
e
.
arguments
.
matchedArguments
,
e
.
arguments
.
matchedSuppliedSignature
,
frame
);
}
}
protected
GenericCall
createGenericCall
()
{
return
new
GenericCall
();
}
@Specialization
public
RArgsValuesAndNames
prepareGeneric
(
VirtualFrame
frame
,
RArgsValuesAndNames
varArgs
,
S3DefaultArguments
s3DefaultArguments
,
RCallNode
call
,
@Cached
(
"createGenericCall()"
)
GenericCall
generic
)
{
ArgumentsSignature
varArgSignature
=
varArgs
==
null
?
null
:
varArgs
.
getSignature
();
ArgumentsSignature
varArgSignature
=
varArgs
==
null
?
null
:
varArgs
.
getSignature
();
Arguments
<
RNode
>
matchedArgs
=
ArgumentMatcher
.
matchArguments
(
target
,
sourceArguments
,
varArgSignature
,
s3DefaultArguments
,
RError
.
ROOTNODE
,
true
);
return
generic
.
execute
(
frame
.
materialize
(),
s3DefaultArguments
,
varArgSignature
,
call
);
return
executeArgs
(
matchedArgs
.
getArguments
(),
matchedArgs
.
getSignature
(),
frame
);
}
}
}
}
...
...
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