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
c1038249
Commit
c1038249
authored
7 years ago
by
Tomas Stupka
Browse files
Options
Downloads
Patches
Plain Diff
no recursive iterable conversion - they may return themself as elements
parent
6b6cbe43
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.runtime/src/com/oracle/truffle/r/runtime/interop/ForeignArray2R.java
+4
-8
4 additions, 8 deletions
.../com/oracle/truffle/r/runtime/interop/ForeignArray2R.java
with
4 additions
and
8 deletions
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/interop/ForeignArray2R.java
+
4
−
8
View file @
c1038249
...
...
@@ -152,11 +152,11 @@ public abstract class ForeignArray2R extends RBaseNode {
@Specialization
(
guards
=
"isJavaIterable(obj)"
)
@TruffleBoundary
protected
ForeignArrayData
doJavaIterable
(
TruffleObject
obj
,
boolean
recursive
,
ForeignArrayData
arrayData
,
int
depth
,
protected
ForeignArrayData
doJavaIterable
(
TruffleObject
obj
,
@SuppressWarnings
(
"unused"
)
boolean
recursive
,
ForeignArrayData
arrayData
,
int
depth
,
@Cached
(
"createExecute(0).createNode()"
)
Node
execute
)
{
try
{
return
getIterableElements
(
arrayData
==
null
?
new
ForeignArrayData
()
:
arrayData
,
obj
,
recursive
,
execute
,
depth
);
return
getIterableElements
(
arrayData
==
null
?
new
ForeignArrayData
()
:
arrayData
,
obj
,
execute
,
depth
);
}
catch
(
UnsupportedMessageException
|
UnknownIdentifierException
|
UnsupportedTypeException
|
ArityException
e
)
{
throw
error
(
RError
.
Message
.
GENERIC
,
"error while casting external object to list: "
+
e
.
getMessage
());
}
...
...
@@ -197,7 +197,7 @@ public abstract class ForeignArray2R extends RBaseNode {
return
arrayData
;
}
private
ForeignArrayData
getIterableElements
(
ForeignArrayData
arrayData
,
TruffleObject
obj
,
boolean
recursive
,
Node
execute
,
int
depth
)
private
ForeignArrayData
getIterableElements
(
ForeignArrayData
arrayData
,
TruffleObject
obj
,
Node
execute
,
int
depth
)
throws
UnknownIdentifierException
,
ArityException
,
UnsupportedMessageException
,
UnsupportedTypeException
{
if
(
read
==
null
)
{
CompilerDirectives
.
transferToInterpreterAndInvalidate
();
...
...
@@ -210,11 +210,7 @@ public abstract class ForeignArray2R extends RBaseNode {
while
((
boolean
)
ForeignAccess
.
sendExecute
(
execute
,
hasNextFunction
))
{
TruffleObject
nextFunction
=
(
TruffleObject
)
ForeignAccess
.
sendRead
(
read
,
it
,
"next"
);
Object
element
=
ForeignAccess
.
sendExecute
(
execute
,
nextFunction
);
if
(
recursive
&&
(
isJavaIterable
(
element
)
||
isForeignArray
(
element
,
hasSize
)))
{
recurse
(
arrayData
,
element
,
depth
);
}
else
{
arrayData
.
add
(
element
,
this
::
getIsNull
,
this
::
getIsBoxed
,
this
::
getUnbox
,
this
::
getForeign2R
);
}
arrayData
.
add
(
element
,
this
::
getIsNull
,
this
::
getIsBoxed
,
this
::
getUnbox
,
this
::
getForeign2R
);
}
return
arrayData
;
}
...
...
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