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
62e193ec
Commit
62e193ec
authored
7 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
put match builtin on slow path
parent
0a2a5094
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.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java
+11
-0
11 additions, 0 deletions
...in/src/com/oracle/truffle/r/nodes/builtin/base/Match.java
with
11 additions
and
0 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java
+
11
−
0
View file @
62e193ec
...
...
@@ -31,6 +31,7 @@ import static com.oracle.truffle.r.runtime.builtins.RBuiltinKind.INTERNAL;
import
java.util.Arrays
;
import
com.oracle.truffle.api.CompilerDirectives
;
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.Specialization
;
...
...
@@ -207,6 +208,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractIntVector
x
,
RAbstractIntVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -242,6 +244,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractDoubleVector
x
,
RAbstractIntVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -277,6 +280,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractIntVector
x
,
RAbstractDoubleVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -319,6 +323,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractDoubleVector
x
,
RAbstractDoubleVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -354,6 +359,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractIntVector
x
,
RAbstractLogicalVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -385,6 +391,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
(
guards
=
"x.getLength() == 1"
)
@TruffleBoundary
protected
int
matchSizeOne
(
RAbstractStringVector
x
,
RAbstractStringVector
table
,
int
nomatch
,
@Cached
(
"create()"
)
NAProfile
naProfile
,
@Cached
(
"create()"
)
BranchProfile
foundProfile
,
...
...
@@ -411,6 +418,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractStringVector
x
,
RAbstractStringVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -470,6 +478,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractLogicalVector
x
,
RAbstractLogicalVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -500,6 +509,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
(
guards
=
"!isRAbstractStringVector(table)"
)
@TruffleBoundary
protected
RIntVector
match
(
RAbstractStringVector
x
,
RAbstractVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
@@ -521,6 +531,7 @@ public abstract class Match extends RBuiltinNode.Arg4 {
}
@Specialization
@TruffleBoundary
protected
RIntVector
match
(
RAbstractComplexVector
x
,
RAbstractComplexVector
table
,
int
nomatch
)
{
int
[]
result
=
initResult
(
x
.
getLength
(),
nomatch
);
boolean
matchAll
=
true
;
...
...
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