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
edca1c5f
Commit
edca1c5f
authored
7 years ago
by
Florian Angerer
Browse files
Options
Downloads
Patches
Plain Diff
Using GetCallerFrameNode for S3 dispatch.
parent
edd59e4f
Branches
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.builtin/src/com/oracle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java
+3
-16
3 additions, 16 deletions
...cle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java
with
3 additions
and
16 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/S3DispatchFunctions.java
+
3
−
16
View file @
edca1c5f
...
@@ -17,7 +17,6 @@ import static com.oracle.truffle.r.runtime.builtins.RBuiltinKind.SUBSTITUTE;
...
@@ -17,7 +17,6 @@ import static com.oracle.truffle.r.runtime.builtins.RBuiltinKind.SUBSTITUTE;
import
com.oracle.truffle.api.CompilerDirectives
;
import
com.oracle.truffle.api.CompilerDirectives
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.api.frame.FrameInstance.FrameAccess
;
import
com.oracle.truffle.api.frame.MaterializedFrame
;
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.profiles.BranchProfile
;
import
com.oracle.truffle.api.profiles.BranchProfile
;
...
@@ -27,6 +26,7 @@ import com.oracle.truffle.r.nodes.access.variables.LocalReadVariableNode;
...
@@ -27,6 +26,7 @@ import com.oracle.truffle.r.nodes.access.variables.LocalReadVariableNode;
import
com.oracle.truffle.r.nodes.builtin.RBuiltinNode
;
import
com.oracle.truffle.r.nodes.builtin.RBuiltinNode
;
import
com.oracle.truffle.r.nodes.function.CallMatcherNode
;
import
com.oracle.truffle.r.nodes.function.CallMatcherNode
;
import
com.oracle.truffle.r.nodes.function.ClassHierarchyNode
;
import
com.oracle.truffle.r.nodes.function.ClassHierarchyNode
;
import
com.oracle.truffle.r.nodes.function.GetCallerFrameNode
;
import
com.oracle.truffle.r.nodes.function.PromiseHelperNode
;
import
com.oracle.truffle.r.nodes.function.PromiseHelperNode
;
import
com.oracle.truffle.r.nodes.function.PromiseHelperNode.PromiseCheckHelperNode
;
import
com.oracle.truffle.r.nodes.function.PromiseHelperNode.PromiseCheckHelperNode
;
import
com.oracle.truffle.r.nodes.function.S3FunctionLookupNode
;
import
com.oracle.truffle.r.nodes.function.S3FunctionLookupNode
;
...
@@ -41,7 +41,6 @@ import com.oracle.truffle.r.runtime.RArguments.S3Args;
...
@@ -41,7 +41,6 @@ import com.oracle.truffle.r.runtime.RArguments.S3Args;
import
com.oracle.truffle.r.runtime.RError
;
import
com.oracle.truffle.r.runtime.RError
;
import
com.oracle.truffle.r.runtime.RRuntime
;
import
com.oracle.truffle.r.runtime.RRuntime
;
import
com.oracle.truffle.r.runtime.ReturnException
;
import
com.oracle.truffle.r.runtime.ReturnException
;
import
com.oracle.truffle.r.runtime.Utils
;
import
com.oracle.truffle.r.runtime.builtins.RBuiltin
;
import
com.oracle.truffle.r.runtime.builtins.RBuiltin
;
import
com.oracle.truffle.r.runtime.data.RArgsValuesAndNames
;
import
com.oracle.truffle.r.runtime.data.RArgsValuesAndNames
;
import
com.oracle.truffle.r.runtime.data.RDataFactory
;
import
com.oracle.truffle.r.runtime.data.RDataFactory
;
...
@@ -59,24 +58,11 @@ public abstract class S3DispatchFunctions {
...
@@ -59,24 +58,11 @@ public abstract class S3DispatchFunctions {
@Child
private
S3FunctionLookupNode
methodLookup
;
@Child
private
S3FunctionLookupNode
methodLookup
;
@Child
private
CallMatcherNode
callMatcher
;
@Child
private
CallMatcherNode
callMatcher
;
private
final
ConditionProfile
callerFrameSlowPath
=
ConditionProfile
.
createBinaryProfile
();
private
final
ConditionProfile
topLevelFrameProfile
=
ConditionProfile
.
createBinaryProfile
();
protected
Helper
(
boolean
nextMethod
)
{
protected
Helper
(
boolean
nextMethod
)
{
methodLookup
=
S3FunctionLookupNode
.
create
(
true
,
nextMethod
);
methodLookup
=
S3FunctionLookupNode
.
create
(
true
,
nextMethod
);
callMatcher
=
CallMatcherNode
.
create
(
false
);
callMatcher
=
CallMatcherNode
.
create
(
false
);
}
}
protected
MaterializedFrame
getCallerFrame
(
VirtualFrame
frame
)
{
MaterializedFrame
funFrame
=
RArguments
.
getCallerFrame
(
frame
);
if
(
callerFrameSlowPath
.
profile
(
funFrame
==
null
))
{
funFrame
=
Utils
.
getCallerFrame
(
frame
,
FrameAccess
.
MATERIALIZE
).
materialize
();
RError
.
performanceWarning
(
"slow caller frame access in UseMethod dispatch"
);
}
// S3 method can be dispatched from top-level where there is no caller frame
return
topLevelFrameProfile
.
profile
(
funFrame
==
null
)
?
frame
.
materialize
()
:
funFrame
;
}
protected
Object
dispatch
(
VirtualFrame
frame
,
String
generic
,
RStringVector
type
,
String
group
,
MaterializedFrame
callerFrame
,
MaterializedFrame
genericDefFrame
,
protected
Object
dispatch
(
VirtualFrame
frame
,
String
generic
,
RStringVector
type
,
String
group
,
MaterializedFrame
callerFrame
,
MaterializedFrame
genericDefFrame
,
ArgumentsSignature
suppliedSignature
,
Object
[]
suppliedArguments
)
{
ArgumentsSignature
suppliedSignature
,
Object
[]
suppliedArguments
)
{
Result
lookupResult
=
methodLookup
.
execute
(
frame
,
generic
,
type
,
group
,
callerFrame
,
genericDefFrame
);
Result
lookupResult
=
methodLookup
.
execute
(
frame
,
generic
,
type
,
group
,
callerFrame
,
genericDefFrame
);
...
@@ -97,6 +83,7 @@ public abstract class S3DispatchFunctions {
...
@@ -97,6 +83,7 @@ public abstract class S3DispatchFunctions {
@Child
private
ClassHierarchyNode
classHierarchyNode
=
ClassHierarchyNode
.
createForDispatch
(
true
);
@Child
private
ClassHierarchyNode
classHierarchyNode
=
ClassHierarchyNode
.
createForDispatch
(
true
);
@Child
private
PromiseCheckHelperNode
promiseCheckHelper
;
@Child
private
PromiseCheckHelperNode
promiseCheckHelper
;
@Child
private
GetCallerFrameNode
getCallerFrameNode
=
new
GetCallerFrameNode
();
@Child
private
Helper
helper
=
new
Helper
(
false
);
@Child
private
Helper
helper
=
new
Helper
(
false
);
private
final
BranchProfile
firstArgMissing
=
BranchProfile
.
create
();
private
final
BranchProfile
firstArgMissing
=
BranchProfile
.
create
();
...
@@ -118,7 +105,7 @@ public abstract class S3DispatchFunctions {
...
@@ -118,7 +105,7 @@ public abstract class S3DispatchFunctions {
}
}
RStringVector
type
=
dispatchedObject
==
null
?
RDataFactory
.
createEmptyStringVector
()
:
classHierarchyNode
.
execute
(
dispatchedObject
);
RStringVector
type
=
dispatchedObject
==
null
?
RDataFactory
.
createEmptyStringVector
()
:
classHierarchyNode
.
execute
(
dispatchedObject
);
MaterializedFrame
callerFrame
=
helper
.
getCallerFrame
(
frame
);
MaterializedFrame
callerFrame
=
getCallerFrame
Node
.
execute
(
frame
);
MaterializedFrame
genericDefFrame
=
RArguments
.
getEnclosingFrame
(
frame
);
MaterializedFrame
genericDefFrame
=
RArguments
.
getEnclosingFrame
(
frame
);
ArgumentsSignature
suppliedSignature
=
RArguments
.
getSuppliedSignature
(
frame
);
ArgumentsSignature
suppliedSignature
=
RArguments
.
getSuppliedSignature
(
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