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
3d042066
Commit
3d042066
authored
10 years ago
by
Michael Haupt
Browse files
Options
Downloads
Patches
Plain Diff
post-merge fix: reconcile stack depth computation with changed promise evaluation strategy
parent
f5d239ca
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/Utils.java
+11
-5
11 additions, 5 deletions
...fle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java
with
11 additions
and
5 deletions
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java
+
11
−
5
View file @
3d042066
...
...
@@ -236,9 +236,10 @@ public final class Utils {
}
/**
* Return the depth of the stack. This is done by walking up the call stack and counting those
* frames that are not for promise evaluation wrappers and not substituted frames (see
* {@link #isSubstitutedFrame(Frame)}.
* Return the depth of the stack. The "R depth" of the stack is determined by those frames that
* contribute to actual R function execution, hence, FastR-internal frames that are used to,
* e.g., evaluate promises must be left out. The same is true for substituted frames (see
* {@code FunctionDefinitionNode#substituteFrame}).
*/
public
static
int
stackDepth
()
{
LongAdder
n
=
new
LongAdder
();
...
...
@@ -247,10 +248,14 @@ public final class Utils {
if
(
REnvironment
.
isGlobalEnvFrame
(
frame
))
{
return
n
.
intValue
();
}
if
(!
isPromiseEvaluationFrame
(
frameInstance
))
{
boolean
promise
=
isPromiseEvaluationFrame
(
frameInstance
);
boolean
substituted
=
isSubstitutedFrame
(
frame
);
if
(!
promise
)
{
n
.
increment
();
}
else
if
(!
substituted
)
{
n
.
decrement
();
}
if
(
isS
ubstituted
Frame
(
frame
)
)
{
if
(
s
ubstituted
)
{
n
.
decrement
();
}
return
null
;
...
...
@@ -262,6 +267,7 @@ public final class Utils {
* TODO provide a better way of determining promise evaluation nature of frames than using
* {@code toString()} on the call target.
*/
@SlowPath
private
static
boolean
isPromiseEvaluationFrame
(
FrameInstance
frameInstance
)
{
String
desc
=
frameInstance
.
getCallTarget
().
toString
();
return
desc
==
RPromise
.
CLOSURE_WRAPPER_NAME
;
...
...
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