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
1fa1fb85
Commit
1fa1fb85
authored
9 years ago
by
Adam Welc
Browse files
Options
Downloads
Patches
Plain Diff
Fixed parameter type.
parent
9c07140c
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/StandardGeneric.java
+12
-11
12 additions, 11 deletions
.../oracle/truffle/r/nodes/builtin/base/StandardGeneric.java
with
12 additions
and
11 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/StandardGeneric.java
+
12
−
11
View file @
1fa1fb85
...
...
@@ -105,7 +105,7 @@ public abstract class StandardGeneric extends RBuiltinNode {
}
String
[]
classes
=
collectArgumentsNode
.
execute
(
frame
,
sigArgs
);
dispatchGeneric
.
executeObject
(
frame
,
methodsEnv
,
mtable
,
classes
,
fdef
);
dispatchGeneric
.
executeObject
(
frame
,
methodsEnv
,
mtable
,
RDataFactory
.
createStringVector
(
classes
,
RDataFactory
.
COMPLETE_VECTOR
)
,
fdef
);
return
null
;
}
...
...
@@ -161,7 +161,7 @@ public abstract class StandardGeneric extends RBuiltinNode {
abstract
class
DispatchGeneric
extends
RBaseNode
{
public
abstract
Object
executeObject
(
VirtualFrame
frame
,
REnvironment
methodsEnv
,
REnvironment
mtable
,
String
[]
classes
,
RFunction
fdef
);
public
abstract
Object
executeObject
(
VirtualFrame
frame
,
REnvironment
methodsEnv
,
REnvironment
mtable
,
R
String
Vector
classes
,
RFunction
fdef
);
private
final
ConditionProfile
singleStringProfile
=
ConditionProfile
.
createBinaryProfile
();
private
final
ConditionProfile
cached
=
ConditionProfile
.
createBinaryProfile
();
...
...
@@ -171,9 +171,9 @@ abstract class DispatchGeneric extends RBaseNode {
@CompilationFinal
private
RFunction
inheritForDispatchFunction
;
@Child
private
RArgumentsNode
argsNode
=
RArgumentsNode
.
create
();
protected
String
createDispatchString
(
String
[]
classes
)
{
if
(
singleStringProfile
.
profile
(
classes
.
l
ength
==
1
))
{
return
classes
[
0
]
;
protected
String
createDispatchString
(
R
String
Vector
classes
)
{
if
(
singleStringProfile
.
profile
(
classes
.
getL
ength
()
==
1
))
{
return
classes
.
getDataAt
(
0
)
;
}
else
{
throw
RInternalError
.
unimplemented
();
}
...
...
@@ -185,7 +185,7 @@ abstract class DispatchGeneric extends RBaseNode {
@SuppressWarnings
(
"unused"
)
@Specialization
(
guards
=
"equalClasses(classes, cachedClasses)"
)
protected
Object
dispatch
(
VirtualFrame
frame
,
REnvironment
methodsEnv
,
REnvironment
mtable
,
String
[]
classes
,
RFunction
fdef
,
@Cached
(
"classes"
)
String
[]
cachedClasses
,
protected
Object
dispatch
(
VirtualFrame
frame
,
REnvironment
methodsEnv
,
REnvironment
mtable
,
R
String
Vector
classes
,
RFunction
fdef
,
@Cached
(
"classes"
)
R
String
Vector
cachedClasses
,
@Cached
(
"createDispatchString(cachedClasses)"
)
String
dispatchString
,
@Cached
(
"createTableRead(dispatchString)"
)
ReadVariableNode
tableRead
)
{
RFunction
method
=
(
RFunction
)
tableRead
.
execute
(
null
,
mtable
.
getFrame
());
if
(
method
==
null
)
{
...
...
@@ -209,11 +209,12 @@ abstract class DispatchGeneric extends RBaseNode {
return
null
;
}
protected
boolean
equalClasses
(
String
[]
classes
,
String
[]
cachedClasses
)
{
if
(
cachedClasses
.
length
==
classes
.
length
)
{
for
(
int
i
=
0
;
i
<
cachedClasses
.
length
;
i
++)
{
// TODO: makes sure equality is good enough here
if
(
cachedClasses
[
i
]
!=
classes
[
i
])
{
protected
boolean
equalClasses
(
RStringVector
classes
,
RStringVector
cachedClasses
)
{
if
(
cachedClasses
.
getLength
()
==
classes
.
getLength
())
{
for
(
int
i
=
0
;
i
<
cachedClasses
.
getLength
();
i
++)
{
// TODO: makes sure equality is good enough here, but it's for optimization only
// anwyay
if
(
cachedClasses
.
getDataAt
(
i
)
!=
classes
.
getDataAt
(
i
))
{
return
false
;
}
}
...
...
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