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
f4fd0ce7
Commit
f4fd0ce7
authored
8 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
unwrap promises for stable lookups in FrameSlotChangeMonitor
parent
57460b42
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/env/frame/FrameSlotChangeMonitor.java
+16
-1
16 additions, 1 deletion
...e/truffle/r/runtime/env/frame/FrameSlotChangeMonitor.java
with
16 additions
and
1 deletion
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/env/frame/FrameSlotChangeMonitor.java
+
16
−
1
View file @
f4fd0ce7
...
@@ -46,6 +46,7 @@ import com.oracle.truffle.api.profiles.BranchProfile;
...
@@ -46,6 +46,7 @@ import com.oracle.truffle.api.profiles.BranchProfile;
import
com.oracle.truffle.r.runtime.RArguments
;
import
com.oracle.truffle.r.runtime.RArguments
;
import
com.oracle.truffle.r.runtime.RInternalError
;
import
com.oracle.truffle.r.runtime.RInternalError
;
import
com.oracle.truffle.r.runtime.StableValue
;
import
com.oracle.truffle.r.runtime.StableValue
;
import
com.oracle.truffle.r.runtime.data.RPromise
;
/**
/**
* This class maintains information about the current hierarchy of environments in the system. This
* This class maintains information about the current hierarchy of environments in the system. This
...
@@ -84,6 +85,7 @@ public final class FrameSlotChangeMonitor {
...
@@ -84,6 +85,7 @@ public final class FrameSlotChangeMonitor {
private
static
final
class
StableValueLookupResult
extends
LookupResult
{
private
static
final
class
StableValueLookupResult
extends
LookupResult
{
private
final
StableValue
<
Object
>
value
;
private
final
StableValue
<
Object
>
value
;
@CompilationFinal
private
Object
unwrappedValue
;
private
StableValueLookupResult
(
String
identifier
,
StableValue
<
Object
>
value
)
{
private
StableValueLookupResult
(
String
identifier
,
StableValue
<
Object
>
value
)
{
super
(
identifier
);
super
(
identifier
);
...
@@ -100,7 +102,20 @@ public final class FrameSlotChangeMonitor {
...
@@ -100,7 +102,20 @@ public final class FrameSlotChangeMonitor {
assumption
.
check
();
assumption
.
check
();
StableValue
<
Object
>
result
=
value
;
StableValue
<
Object
>
result
=
value
;
result
.
getAssumption
().
check
();
result
.
getAssumption
().
check
();
return
result
.
getValue
();
if
(
unwrappedValue
==
null
)
{
CompilerDirectives
.
transferToInterpreterAndInvalidate
();
Object
resultValue
=
result
.
getValue
();
if
(
resultValue
instanceof
RPromise
)
{
if
(((
RPromise
)
resultValue
).
isEvaluated
())
{
unwrappedValue
=
((
RPromise
)
resultValue
).
getValue
();
}
else
{
return
resultValue
;
}
}
else
{
unwrappedValue
=
resultValue
;
}
}
return
unwrappedValue
;
}
}
}
}
...
...
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