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
319539bf
Commit
319539bf
authored
10 years ago
by
Mick Jordan
Browse files
Options
Downloads
Patches
Plain Diff
fix javadoc and rename method for clarity
parent
61cbe867
Branches
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/RArguments.java
+51
-51
51 additions, 51 deletions
....runtime/src/com/oracle/truffle/r/runtime/RArguments.java
with
51 additions
and
51 deletions
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RArguments.java
+
51
−
51
View file @
319539bf
...
...
@@ -41,33 +41,33 @@ import com.oracle.truffle.r.runtime.env.frame.*;
*
* The frame layout, depicted, is as follows:
* <pre>
* +-------------------+
* INDEX_ENVIRONMENT -> | REnvironment |
* +-------------------+
* INDEX_FUNCTION -> | RFunction |
* +-------------------+
* INDEX_CALL_SRC -> | SourceSection |
* +-------------------+
* INDEX_
ENCLOSING
_FRAME -> | MaterializedFrame |
* +-------------------+
* INDEX_
N_ARGS -> | nArgs
|
* +-------------------+
* INDEX_
DEPTH
-> |
depth
|
* +-------------------+
* INDEX_
IS_IRREGULAR -> | isIrregular
|
* +-------------------+
* INDEX_
N_NAMES -> | nNames
|
* +-------------------+
* INDEX_
ARGUMENTS
-> |
arg_0
|
*
| arg_1 |
*
| ...
|
* | arg_
(nArgs-1)
|
*
+-------------------+
*
INDEX_ARGUMENTS + nArgs -> | name_0
|
*
| name_1 |
*
| ... |
*
| name_(nNames-1) |
*
+-------------------+
* +-------------------
-
+
* INDEX_ENVIRONMENT -> | REnvironment
|
* +-------------------
-
+
* INDEX_FUNCTION -> | RFunction
|
* +-------------------
-
+
* INDEX_CALL_SRC -> | SourceSection
|
* +-------------------
-
+
* INDEX_
CALLER
_FRAME ->
| MaterializedFrame
|
* +-------------------
-
+
* INDEX_
ENCLOSING_FRAME -> | MaterializedFrame
|
* +-------------------
-
+
* INDEX_
S3_ARGS
-> |
S3Args
|
* +-------------------
-
+
* INDEX_
DEPTH -> | depth
|
* +-------------------
-
+
* INDEX_
IS_IRREGULAR -> | isIrregular
|
* +-------------------
-
+
* INDEX_
SIGNATURE
-> |
ArgumentsSignature
|
*
+--------------------+
*
INDEX_ARGUMENTS -> | arg_0
|
* | arg_
1
|
*
| ... |
*
| arg_(nArgs-1)
|
*
+--------------------+
*
*
If the formal parameter is "..." then the corresponding argument slot will
*
always be of type {@link RArgsValuesAndNames}.
* </pre>
*
* All frame elements should <b>always</b> be accessed through the getter and setter functions
...
...
@@ -128,11 +128,11 @@ public final class RArguments {
}
/**
* Get the {@code
a
rguments} checking for an "eval" frame. An eval can create a pseudo-call
* Get the {@code
RA
rguments} checking for an "eval" frame. An eval can create a pseudo-call
* where {@code arguments.length == 1} and the real {@code arguments} are at
* {@code arguments[0]}. See {@code REngine}.
*/
private
static
Object
[]
getArgumentsWithEvalCheck
(
Frame
frame
)
{
private
static
Object
[]
get
R
ArgumentsWithEvalCheck
(
Frame
frame
)
{
Object
[]
arguments
=
frame
.
getArguments
();
if
(
arguments
.
length
==
1
)
{
return
materializedFrameProfile
.
profile
((
Frame
)
arguments
[
0
]).
getArguments
();
...
...
@@ -201,12 +201,12 @@ public final class RArguments {
}
public
static
MaterializedFrame
getCallerFrame
(
Frame
frame
)
{
Object
[]
args
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
args
=
get
R
ArgumentsWithEvalCheck
(
frame
);
return
(
MaterializedFrame
)
args
[
INDEX_CALLER_FRAME
];
}
public
static
S3Args
getS3Args
(
Frame
frame
)
{
return
(
S3Args
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_S3_ARGS
];
return
(
S3Args
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_S3_ARGS
];
}
public
static
void
setS3Args
(
Object
[]
args
,
S3Args
s3Args
)
{
...
...
@@ -214,15 +214,15 @@ public final class RArguments {
}
public
static
REnvironment
getEnvironment
(
Frame
frame
)
{
return
(
REnvironment
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_ENVIRONMENT
];
return
(
REnvironment
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_ENVIRONMENT
];
}
public
static
RFunction
getFunction
(
Frame
frame
)
{
return
(
RFunction
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_FUNCTION
];
return
(
RFunction
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_FUNCTION
];
}
public
static
SourceSection
getCallSourceSection
(
Frame
frame
)
{
return
(
SourceSection
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_CALL_SRC
];
return
(
SourceSection
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_CALL_SRC
];
}
/**
...
...
@@ -245,25 +245,25 @@ public final class RArguments {
}
public
static
int
getDepth
(
Frame
frame
)
{
return
(
Integer
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_DEPTH
];
return
(
Integer
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_DEPTH
];
}
public
static
boolean
getIsIrregular
(
Frame
frame
)
{
return
(
boolean
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_IS_IRREGULAR
];
return
(
boolean
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_IS_IRREGULAR
];
}
public
static
Object
getArgument
(
Frame
frame
,
int
argIndex
)
{
assert
(
argIndex
>=
0
&&
argIndex
<
getNArgs
(
frame
));
return
getArgumentsWithEvalCheck
(
frame
)[
INDEX_ARGUMENTS
+
argIndex
];
return
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_ARGUMENTS
+
argIndex
];
}
public
static
Object
[]
getArguments
(
Frame
frame
)
{
Object
[]
args
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
args
=
get
R
ArgumentsWithEvalCheck
(
frame
);
return
Arrays
.
copyOfRange
(
args
,
INDEX_ARGUMENTS
,
INDEX_ARGUMENTS
+
((
ArgumentsSignature
)
args
[
INDEX_SIGNATURE
]).
getLength
());
}
public
static
void
copyArguments
(
Frame
frame
,
Object
[]
dest
,
int
pos
)
{
Object
[]
args
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
args
=
get
R
ArgumentsWithEvalCheck
(
frame
);
System
.
arraycopy
(
args
,
INDEX_ARGUMENTS
,
dest
,
pos
,
((
ArgumentsSignature
)
args
[
INDEX_SIGNATURE
]).
getLength
());
}
...
...
@@ -276,7 +276,7 @@ public final class RArguments {
*/
public
static
void
setArgument
(
Frame
frame
,
int
argIndex
,
Object
newValue
)
{
assert
(
argIndex
>=
0
&&
argIndex
<
getNArgs
(
frame
));
getArgumentsWithEvalCheck
(
frame
)[
INDEX_ARGUMENTS
+
argIndex
]
=
newValue
;
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_ARGUMENTS
+
argIndex
]
=
newValue
;
}
public
static
int
getArgumentsLength
(
Frame
frame
)
{
...
...
@@ -284,41 +284,41 @@ public final class RArguments {
}
public
static
MaterializedFrame
getEnclosingFrame
(
Frame
frame
)
{
Object
[]
arguments
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
arguments
=
get
R
ArgumentsWithEvalCheck
(
frame
);
if
(
arguments
[
INDEX_FUNCTION
]
!=
null
)
{
return
((
RFunction
)
arguments
[
INDEX_FUNCTION
]).
getEnclosingFrame
();
}
return
(
MaterializedFrame
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_ENCLOSING_FRAME
];
return
(
MaterializedFrame
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_ENCLOSING_FRAME
];
}
public
static
ArgumentsSignature
getSignature
(
Frame
frame
)
{
return
(
ArgumentsSignature
)
getArgumentsWithEvalCheck
(
frame
)[
INDEX_SIGNATURE
];
return
(
ArgumentsSignature
)
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_SIGNATURE
];
}
public
static
void
setEnvironment
(
Frame
frame
,
REnvironment
env
)
{
getArgumentsWithEvalCheck
(
frame
)[
INDEX_ENVIRONMENT
]
=
env
;
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_ENVIRONMENT
]
=
env
;
}
/**
* Explicitly set the function. Used by {@code REngine.eval}.
*/
public
static
void
setFunction
(
Frame
frame
,
RFunction
function
)
{
getArgumentsWithEvalCheck
(
frame
)[
INDEX_FUNCTION
]
=
function
;
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_FUNCTION
]
=
function
;
}
/**
* Explicitly set the callSrc. Used by {@code REngine.eval}.
*/
public
static
void
setCallSourceSection
(
Frame
frame
,
SourceSection
callSrc
)
{
getArgumentsWithEvalCheck
(
frame
)[
INDEX_CALL_SRC
]
=
callSrc
;
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_CALL_SRC
]
=
callSrc
;
}
public
static
void
setDepth
(
Frame
frame
,
int
depth
)
{
getArgumentsWithEvalCheck
(
frame
)[
INDEX_DEPTH
]
=
depth
;
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_DEPTH
]
=
depth
;
}
public
static
void
setIsIrregular
(
Frame
frame
,
boolean
isIrregularFrame
)
{
getArgumentsWithEvalCheck
(
frame
)[
INDEX_IS_IRREGULAR
]
=
isIrregularFrame
;
get
R
ArgumentsWithEvalCheck
(
frame
)[
INDEX_IS_IRREGULAR
]
=
isIrregularFrame
;
}
public
static
void
setIsIrregular
(
Object
[]
arguments
,
boolean
isIrregularFrame
)
{
...
...
@@ -328,7 +328,7 @@ public final class RArguments {
public
static
void
setEnclosingFrame
(
Frame
frame
,
MaterializedFrame
encl
)
{
CompilerAsserts
.
neverPartOfCompilation
();
Object
[]
arguments
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
arguments
=
get
R
ArgumentsWithEvalCheck
(
frame
);
arguments
[
INDEX_ENCLOSING_FRAME
]
=
encl
;
if
(
arguments
[
INDEX_FUNCTION
]
!=
null
)
{
((
RFunction
)
arguments
[
INDEX_FUNCTION
]).
setEnclosingFrame
(
encl
);
...
...
@@ -343,7 +343,7 @@ public final class RArguments {
*/
public
static
void
attachFrame
(
Frame
frame
,
MaterializedFrame
newEncl
)
{
CompilerAsserts
.
neverPartOfCompilation
();
Object
[]
arguments
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
arguments
=
get
R
ArgumentsWithEvalCheck
(
frame
);
MaterializedFrame
encl
=
(
MaterializedFrame
)
arguments
[
INDEX_ENCLOSING_FRAME
];
Object
[]
newArguments
=
newEncl
.
getArguments
();
newArguments
[
INDEX_ENCLOSING_FRAME
]
=
encl
;
...
...
@@ -358,7 +358,7 @@ public final class RArguments {
*/
public
static
void
detachFrame
(
Frame
frame
)
{
CompilerAsserts
.
neverPartOfCompilation
();
Object
[]
arguments
=
getArgumentsWithEvalCheck
(
frame
);
Object
[]
arguments
=
get
R
ArgumentsWithEvalCheck
(
frame
);
MaterializedFrame
encl
=
(
MaterializedFrame
)
arguments
[
INDEX_ENCLOSING_FRAME
];
Object
[]
enclArguments
=
encl
.
getArguments
();
arguments
[
INDEX_ENCLOSING_FRAME
]
=
enclArguments
[
INDEX_ENCLOSING_FRAME
];
...
...
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