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
509c735a
Commit
509c735a
authored
7 years ago
by
Tomas Stupka
Browse files
Options
Downloads
Patches
Plain Diff
handle foreign objects in BinaryBooleanScalarNode
parent
60dabb9b
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/binary/BinaryBooleanScalarNode.java
+19
-0
19 additions, 0 deletions
...racle/truffle/r/nodes/binary/BinaryBooleanScalarNode.java
with
19 additions
and
0 deletions
com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/binary/BinaryBooleanScalarNode.java
+
19
−
0
View file @
509c735a
...
...
@@ -26,8 +26,12 @@ import com.oracle.truffle.api.CompilerAsserts;
import
com.oracle.truffle.api.CompilerDirectives.TruffleBoundary
;
import
com.oracle.truffle.api.dsl.Cached
;
import
com.oracle.truffle.api.dsl.Fallback
;
import
com.oracle.truffle.api.dsl.ImportStatic
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.api.frame.VirtualFrame
;
import
com.oracle.truffle.api.interop.Message
;
import
com.oracle.truffle.api.interop.TruffleObject
;
import
com.oracle.truffle.api.nodes.Node
;
import
com.oracle.truffle.api.profiles.BranchProfile
;
import
com.oracle.truffle.api.profiles.ConditionProfile
;
import
com.oracle.truffle.r.nodes.binary.BinaryBooleanScalarNodeGen.LogicalScalarCastNodeGen
;
...
...
@@ -39,6 +43,7 @@ import com.oracle.truffle.r.runtime.RRuntime;
import
com.oracle.truffle.r.runtime.RType
;
import
com.oracle.truffle.r.runtime.data.RComplex
;
import
com.oracle.truffle.r.runtime.data.model.RAbstractVector
;
import
com.oracle.truffle.r.runtime.interop.ForeignArray2R
;
import
com.oracle.truffle.r.runtime.nodes.RBaseNode
;
import
com.oracle.truffle.r.runtime.ops.BooleanOperation
;
import
com.oracle.truffle.r.runtime.ops.BooleanOperationFactory
;
...
...
@@ -85,6 +90,7 @@ public abstract class BinaryBooleanScalarNode extends RBuiltinNode.Arg2 {
return
left
;
}
@ImportStatic
({
ForeignArray2R
.
class
,
Message
.
class
})
protected
abstract
static
class
LogicalScalarCastNode
extends
RBaseNode
{
protected
static
final
int
CACHE_LIMIT
=
3
;
...
...
@@ -147,6 +153,19 @@ public abstract class BinaryBooleanScalarNode extends RBuiltinNode.Arg2 {
return
null
;
}
@Specialization
(
guards
=
{
"isForeignVector(operand, hasSize)"
})
protected
byte
doForeignVector
(
TruffleObject
operand
,
@Cached
(
"HAS_SIZE.createNode()"
)
Node
hasSize
,
@Cached
(
"createForeignArray2R()"
)
ForeignArray2R
foreignArray2R
,
@Cached
(
"createRecursive()"
)
LogicalScalarCastNode
recursive
)
{
Object
o
=
foreignArray2R
.
execute
(
operand
,
true
);
return
recursive
.
executeCast
(
o
);
}
protected
LogicalScalarCastNode
createRecursive
()
{
return
LogicalScalarCastNodeGen
.
create
(
opName
,
argumentName
,
check
);
}
@Fallback
protected
byte
doFallback
(
@SuppressWarnings
(
"unused"
)
Object
operand
)
{
throw
RError
.
error
(
this
,
RError
.
Message
.
INVALID_TYPE_IN
,
argumentName
,
opName
);
...
...
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