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
fe4bdace
Commit
fe4bdace
authored
10 years ago
by
Christian Humer
Browse files
Options
Downloads
Patches
Plain Diff
Recursive sharing bug is no issue anymore in the new DSL layout.
parent
007ae842
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/builtin/RBuiltinNode.java
+0
-36
0 additions, 36 deletions
.../src/com/oracle/truffle/r/nodes/builtin/RBuiltinNode.java
with
0 additions
and
36 deletions
com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinNode.java
+
0
−
36
View file @
fe4bdace
...
...
@@ -22,7 +22,6 @@
*/
package
com.oracle.truffle.r.nodes.builtin
;
import
java.lang.reflect.*
;
import
java.util.*
;
import
com.oracle.truffle.api.*
;
...
...
@@ -130,41 +129,6 @@ public abstract class RBuiltinNode extends LeafCallNode implements VisibilityCon
return
executeDouble
(
frame
);
}
/**
* WORKAROUND for recursive sharing bug. A shallow copy is insufficient because is can cause
* shared state in the {@code arguments} field to be overwritten during a re-specialization.
* This is an ugly fix that uses reflection to update the hidden {@code arguments} field, and
* should go away with an upcoming Truffle fix.
*/
@Override
public
Node
copy
()
{
RBuiltinNode
copy
=
(
RBuiltinNode
)
super
.
copy
();
RNode
[]
args
=
getArguments
();
RNode
[]
copyArgs
=
Arrays
.
copyOf
(
args
,
args
.
length
);
try
{
Field
field
=
getArgumentsField
(
getClass
());
field
.
setAccessible
(
true
);
field
.
set
(
copy
,
copyArgs
);
}
catch
(
IllegalAccessException
|
NoSuchFieldException
ex
)
{
Utils
.
fatalError
(
"failed to update RBuiltinNode.arguments"
);
}
return
copy
;
}
/**
* WORKAROUND support method.
*/
private
Field
getArgumentsField
(
Class
<?>
klass
)
throws
NoSuchFieldException
{
if
(
klass
==
RBuiltinNode
.
class
)
{
throw
new
NoSuchFieldException
();
}
try
{
return
klass
.
getDeclaredField
(
"arguments"
);
}
catch
(
NoSuchFieldException
ex
)
{
return
getArgumentsField
(
klass
.
getSuperclass
());
}
}
private
static
RNode
[]
createAccessArgumentsNodes
(
RBuiltinFactory
builtin
)
{
int
total
=
builtin
.
getRBuiltin
().
parameterNames
().
length
;
RNode
[]
args
=
new
RNode
[
total
];
...
...
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