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
42ff6e50
Commit
42ff6e50
authored
8 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
use node-based profile in CachedReplaceVectorNode
parent
d013af99
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/access/vector/CachedReplaceVectorNode.java
+26
-2
26 additions, 2 deletions
...ruffle/r/nodes/access/vector/CachedReplaceVectorNode.java
with
26 additions
and
2 deletions
com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedReplaceVectorNode.java
+
26
−
2
View file @
42ff6e50
...
...
@@ -22,16 +22,24 @@
*/
package
com.oracle.truffle.r.nodes.access.vector
;
import
static
com
.
oracle
.
truffle
.
api
.
nodes
.
NodeCost
.
NONE
;
import
java.util.Arrays
;
import
com.oracle.truffle.api.CompilerAsserts
;
import
com.oracle.truffle.api.CompilerDirectives
;
import
com.oracle.truffle.api.CompilerDirectives.CompilationFinal
;
import
com.oracle.truffle.api.CompilerDirectives.TruffleBoundary
;
import
com.oracle.truffle.api.dsl.Cached
;
import
com.oracle.truffle.api.dsl.Specialization
;
import
com.oracle.truffle.api.nodes.Node
;
import
com.oracle.truffle.api.nodes.NodeInfo
;
import
com.oracle.truffle.api.nodes.Node.Child
;
import
com.oracle.truffle.api.nodes.NodeCost
;
import
com.oracle.truffle.api.profiles.BranchProfile
;
import
com.oracle.truffle.api.profiles.ConditionProfile
;
import
com.oracle.truffle.api.profiles.ValueProfile
;
import
com.oracle.truffle.r.nodes.access.vector.CachedReplaceVectorNodeFactory.ValueProfileNodeGen
;
import
com.oracle.truffle.r.nodes.access.vector.PositionsCheckNode.PositionProfile
;
import
com.oracle.truffle.r.nodes.binary.CastTypeNode
;
import
com.oracle.truffle.r.nodes.profile.VectorLengthProfile
;
...
...
@@ -465,10 +473,26 @@ final class CachedReplaceVectorNode extends CachedVectorNode {
throw
RError
.
error
(
this
,
ex
);
}
return
env
;
}
@NodeInfo
(
cost
=
NONE
)
public
abstract
static
class
ValueProfileNode
extends
Node
{
public
abstract
boolean
execute
(
boolean
value
);
@Specialization
(
limit
=
"1"
,
guards
=
"cachedValue == value"
)
protected
static
boolean
profile
(
@SuppressWarnings
(
"unused"
)
boolean
value
,
@Cached
(
"value"
)
boolean
cachedValue
)
{
return
cachedValue
;
}
@Specialization
(
contains
=
"profile"
)
protected
static
boolean
generic
(
boolean
value
)
{
return
value
;
}
}
private
final
Condition
Profile
sharedConditionProfile
=
ConditionProfile
.
createBinaryProfil
e
();
@Child
private
Value
Profile
Node
sharedConditionProfile
=
ValueProfileNodeGen
.
creat
e
();
private
final
ValueProfile
sharedClassProfile
=
ValueProfile
.
createClassProfile
();
...
...
@@ -483,7 +507,7 @@ final class CachedReplaceVectorNode extends CachedVectorNode {
if
(
returnVector
instanceof
RShareable
)
{
RShareable
shareable
=
(
RShareable
)
returnVector
;
// TODO find out if we need to copy always in the recursive case
if
(
sharedConditionProfile
.
profil
e
(
shareable
.
isShared
())
||
recursive
||
valueEqualsVectorProfile
.
profile
(
vector
==
value
))
{
if
(
sharedConditionProfile
.
execut
e
(
shareable
.
isShared
())
||
recursive
||
valueEqualsVectorProfile
.
profile
(
vector
==
value
))
{
sharedProfile
.
enter
();
shareable
=
(
RShareable
)
returnVector
.
copy
();
returnVector
=
(
RAbstractVector
)
shareable
;
...
...
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