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
95153104
Commit
95153104
authored
7 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
simplification in Slot.java
parent
e102de11
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/Slot.java
+7
-18
7 additions, 18 deletions
...tin/src/com/oracle/truffle/r/nodes/builtin/base/Slot.java
with
7 additions
and
18 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Slot.java
+
7
−
18
View file @
95153104
...
...
@@ -22,16 +22,13 @@ import com.oracle.truffle.api.dsl.Specialization;
import
com.oracle.truffle.api.profiles.ValueProfile
;
import
com.oracle.truffle.r.nodes.access.AccessSlotNode
;
import
com.oracle.truffle.r.nodes.access.AccessSlotNodeGen
;
import
com.oracle.truffle.r.nodes.access.ConstantNode
;
import
com.oracle.truffle.r.nodes.builtin.RBuiltinNode
;
import
com.oracle.truffle.r.nodes.function.WrapArgumentNode
;
import
com.oracle.truffle.r.nodes.function.opt.UpdateShareableChildValueNode
;
import
com.oracle.truffle.r.runtime.RError
;
import
com.oracle.truffle.r.runtime.Utils
;
import
com.oracle.truffle.r.runtime.builtins.RBuiltin
;
import
com.oracle.truffle.r.runtime.data.RPromise
;
import
com.oracle.truffle.r.runtime.data.RSymbol
;
import
com.oracle.truffle.r.runtime.nodes.RSyntaxLookup
;
import
com.oracle.truffle.r.runtime.data.RPromise.Closure
;
@RBuiltin
(
name
=
"@"
,
kind
=
PRIMITIVE
,
parameterNames
=
{
""
,
""
},
nonEvalArgs
=
1
,
behavior
=
COMPLEX
)
public
abstract
class
Slot
extends
RBuiltinNode
.
Arg2
{
...
...
@@ -46,20 +43,12 @@ public abstract class Slot extends RBuiltinNode.Arg2 {
private
String
getName
(
Object
nameObj
)
{
if
(
nameObj
instanceof
RPromise
)
{
Object
rep
=
((
RPromise
)
nameObj
).
getRep
();
if
(
rep
instanceof
WrapArgumentNode
)
{
rep
=
((
WrapArgumentNode
)
rep
).
getOperand
();
}
if
(
rep
instanceof
ConstantNode
)
{
Object
val
=
((
ConstantNode
)
rep
).
getValue
();
if
(
val
instanceof
String
)
{
return
(
String
)
val
;
}
if
(
val
instanceof
RSymbol
)
{
return
((
RSymbol
)
val
).
getName
();
}
}
else
if
(
rep
instanceof
RSyntaxLookup
)
{
return
((
RSyntaxLookup
)
rep
).
getIdentifier
();
RPromise
promise
=
(
RPromise
)
nameObj
;
Closure
closure
=
promise
.
getClosure
();
if
(
closure
.
asStringConstant
()
!=
null
)
{
return
closure
.
asStringConstant
();
}
else
if
(
closure
.
asSymbol
()
!=
null
)
{
return
closure
.
asSymbol
();
}
}
CompilerDirectives
.
transferToInterpreter
();
...
...
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