Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: X10 2.3.2
-
Component/s: X10 Compiler: Front-end
-
Labels:None
-
Number of attachments :
Description
Some closures (in particular those generated by the lowerer to implement at and async) need to capture an lval instead of an rval. When generating code for such closures, the backends need to know whether it is the lval or rval of a variable that is being captured. The proposal is to split the closure environment capture information into two lists: lvals and rvals instead of one and then use that information instead of the asyncInit in the backends.
A test case that illustrates the various issues is appended. In particular, in TestValInitUsingAt in the two closures coming from the first set of at statements the lval is captured, but in the two closures coming from the second set of ats the rval is captured.
public class Hello { public static def main(args: Array[String]) { TestValInitUsingAt.testVal(); TestValInitUsingAt.testVar(); } } class TestValInitUsingAt { static def testVal() { val x_tmp1:Int; val p = here; at (p.next()) at (p) x_tmp1 = 2; val x = x_tmp1; Console.OUT.println("should be 2: "+x); at (p.next()) at (p) Console.OUT.println("should be 2: "+x_tmp1); } static def testVar() { var x_tmp2:Int; val p = here; at (p.next()) at (p) x_tmp2 = 2; val x = x_tmp2; Console.OUT.println("should be 2: "+x); x_tmp2 = 100; at (p.next()) { at (p) { Console.OUT.println("should be 100: "+x_tmp2); x_tmp2 = 200; Console.OUT.println("should be 200: "+x_tmp2); } } Console.OUT.println("should be 200: "+x_tmp2); } }
Issue Links
- depends upon
-
XTENLANG-2469
Implement new 'at' and 'athome' constructs.
-
-
XTENLANG-2660
Remove ability for code in an at statement/expr to assign a local variable declared outside the at statement/expr
-
- is depended upon by
-
XTENLANG-1942
Support definite-assignment (remote-init) using "at"
-
-
XTENLANG-2585
XTENLANG_2440 fails to run
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| Link |
This issue is depended upon by |
| Link |
This issue is depended upon by |
| Link |
This issue depends upon |
| Link | This issue depends upon XTENLANG-2469 [ XTENLANG-2469 ] |
| Fix Version/s | X10 2.2.1 [ 17131 ] | |
| Fix Version/s | X10 2.2 [ 16002 ] |
| Link |
This issue is depended upon by |
| Link | This issue is depended upon by XTENLANG-1942 [ XTENLANG-1942 ] |
| Fix Version/s | X10 2.2.2 [ 17639 ] | |
| Fix Version/s | X10 2.2.1 [ 17131 ] |
| Assignee | Igor Peshansky [ ipeshansky ] | Olivier Tardieu [ tardieu ] |
| Fix Version/s | X10 2.2.3 [ 18146 ] | |
| Fix Version/s | X10 2.2.2 [ 17639 ] |
| Fix Version/s | X10 2.3 [ 17009 ] | |
| Fix Version/s | X10 2.2.3 [ 18146 ] |
| Fix Version/s | X10 2.3.1 [ 18657 ] | |
| Fix Version/s | X10 2.3 [ 17009 ] |
| Fix Version/s | X10 2.3.2 [ 19010 ] | |
| Fix Version/s | X10 2.3.1 [ 18657 ] |