summary refs log tree commit diff stats
path: root/compiler/lowerings.nim
Commit message (Collapse)AuthorAgeFilesLines
* re-enable object name generation for less dependence on IDsAraq2016-12-051-1/+2
|
* more fixesAraq2016-12-021-4/+5
|
* Merge branch 'devel' into sighashesAraq2016-12-011-0/+4
|\
| * closure types get names; refs #4332Araq2016-11-291-0/+4
| |
* | removed tyArrayConstr completely from the compiler; introduced tyAlias ↵Araq2016-11-141-1/+1
|/ | | | instead in preparation for further bugfixes
* big refactoring: step 1Araq2016-10-311-3/+3
|
* fixes #4673Andreas Rumpf2016-09-011-2/+2
|
* don't allow to pass a closure to spawnAndreas Rumpf2016-08-101-0/+2
|
* fixes #2758Andreas Rumpf2016-07-151-0/+1
|
* made indirectAccess slightly more efficientAndreas Rumpf2015-12-281-1/+2
|
* first implementation of the new lambda-lifting pass; barely anything worksAndreas Rumpf2015-12-261-1/+1
|
* tuple unpacking works in a non-var/let contextAraq2015-08-211-0/+26
|
* Merge branch 'more_concurrency' into develAraq2015-06-301-5/+8
|\ | | | | | | | | | | | | | | Conflicts: doc/tut1.txt lib/core/locks.nim lib/pure/collections/tables.nim lib/pure/selectors.nim
| * first implementation of pinnedSpawnAraq2015-05-281-5/+8
| |
* | fixes #2297, fixes #2946Araq2015-06-181-0/+20
|/
* system.locals is now a plugin for educationAraq2015-04-241-0/+4
|
* first implementation of overloading of '='; missing: rewriting let/var sectionsAraq2015-04-061-2/+2
|
* fixes #2286Araq2015-03-121-20/+31
|
* fixes #325Araq2015-01-281-1/+0
|
* Happy new year!Guillaume Gelin2015-01-061-1/+1
|
* fixes a tuple lowering bugAraq2014-12-131-3/+4
|
* renamed CondVar to SemaphoreAraq2014-11-101-1/+1
|
* the codegen doesn't emit deepCopy for parallel statementsAraq2014-11-081-10/+17
|
* fixes exhaustion bug and missing GC_ref code generationAraq2014-11-071-0/+6
|
* merged things from develAraq2014-09-121-0/+1
|\
| * fixes #665Araq2014-09-111-0/+1
| |
* | Nimrod renamed to NimAraq2014-08-281-1/+1
| |
* | renamefestAraq2014-08-231-6/+6
|/
* progress on 'spawn'Araq2014-08-101-2/+2
|
* 'parallel' statement works againAraq2014-08-081-6/+4
|
* progress on deepCopyAraq2014-08-011-25/+41
|
* new jester compilesAraq2014-06-281-0/+10
|
* compiles againAraq2014-06-271-1/+1
|
* some progress for jester+asyncAraq2014-06-271-1/+16
|
* rewrote lambdalifting; fixes deeply nested closuresAraq2014-06-261-0/+16
|
* big rename: Promise -> FlowVarAraq2014-06-061-46/+46
|
* Promises are now refsAraq2014-06-051-22/+23
|
* fixed codegen for barriersAraq2014-06-021-2/+7
|
* bugfix: codegen for promisesAraq2014-06-021-4/+11
|
* fixed codegen for return valuesAraq2014-06-011-12/+15
|
* pi test compiles, but crashes randomlyAraq2014-06-011-4/+14
|
* tdisjoint_slice2 worksAraq2014-05-311-1/+1
|
* correct code generation for tforstmtAraq2014-05-301-20/+34
|
* bugfix: regionized pointers in a generic context; renamed 'Future' to 'Promise'Araq2014-05-251-44/+44
|
* progress with futuresAraq2014-05-231-5/+22
|
* 'parallel' statement almost workingAraq2014-05-221-41/+245
|
* progress for the 'parallel' statementAraq2014-05-141-0/+1
|
* initial non-compiling version of 'parallel'Araq2014-05-121-3/+19
|
* reintroduce thread analysis but disable it for backwards compatibilityAraq2014-04-201-3/+4
|
* actors compile againAraq2014-04-201-0/+1
|
rtik/mu/blame/023jump.cc?h=main&id=3f367cb9466131f95c11c24df3aac7057143587b'>^
ac0e9db5 ^

0487a30e ^
201b2e6c ^


ac0e9db5 ^
827898fc ^
0487a30e ^
201b2e6c ^


88be3dbc ^
201b2e6c ^
01caf342 ^
d7494165 ^
201b2e6c ^
d7494165 ^
201b2e6c ^
d7494165 ^

201b2e6c ^
88be3dbc ^
201b2e6c ^
01caf342 ^
5497090a ^
201b2e6c ^
d7494165 ^
201b2e6c ^
d7494165 ^
57699011 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
                   
 




                                      

                                

                             
                                             
     

                                        

                                                
                                                              

                                    
                                                 
                                                                     


        


                                          
 
                         
             
                       
                               


                               


                    
 

                                             

                                        

                                                
                                                              

                                    
                                 


                                           
                                    
                                                 
                                                                     


        
                   
             
                               
                              
 
                                   
                              

                                
 
                               
             
                             
                              
 
                                 
                          
                                  
                               
 

                                             

                                           

                                                
                                                              

                                    
                                


                                               
                                    
                                                 
                                                                     


        
                       
             
                                 
                              
 
                                     
                              

                                  
 
                                   
             
                                   
                              
 
                                       
                              
                                  
                               
//: Jump primitives

:(scenario jump_can_skip_instructions)
recipe main [
  jump 1:offset
  1:number <- copy 1:literal
]
+run: jump 1:offset
-run: 1:number <- copy 1:literal
-mem: storing 1 in location 1

:(before "End Primitive Recipe Declarations")
JUMP,
:(before "End Primitive Recipe Numbers")
Recipe_number["jump"] = JUMP;
:(before "End Primitive Recipe Implementations")
case JUMP: {
  assert(current_instruction().ingredients.at(0).initialized);
  assert(SIZE(ingredients) == 1);
  assert(scalar(ingredients.at(0)));
  instruction_counter += ingredients.at(0).at(0);
  trace("run") << "jumping to instruction " << instruction_counter+1;
  break;
}

//: special type to designate jump targets
:(before "End Mu Types Initialization")
Type_number["offset"] = 0;

:(scenario jump_backward)
recipe main [
  jump 1:offset  # 0 -+
  jump 3:offset  #    |   +-+ 1
                 #   \/  /\ |
  jump -2:offset #  2 +-->+ |
]                #         \/ 3
+run: jump 1:offset
+run: jump -2:offset
+run: jump 3:offset

:(before "End Primitive Recipe Declarations")
JUMP_IF,
:(before "End Primitive Recipe Numbers")
Recipe_number["jump-if"] = JUMP_IF;
:(before "End Primitive Recipe Implementations")
case JUMP_IF: {
  assert(current_instruction().ingredients.at(1).initialized);
  assert(SIZE(ingredients) == 2);
  assert(scalar(ingredients.at(0)));
  if (!ingredients.at(0).at(0)) {
    trace("run") << "jump-if fell through";
    break;
  }
  assert(scalar(ingredients.at(1)));
  instruction_counter += ingredients.at(1).at(0);
  trace("run") << "jumping to instruction " << instruction_counter+1;
  break;
}

:(scenario jump_if)
recipe main [
  jump-if 999:literal, 1:offset
  123:number <- copy 1:literal
]
+run: jump-if 999:literal, 1:offset
+run: jumping to instruction 2
-run: 1:number <- copy 1:literal
-mem: storing 1 in location 123

:(scenario jump_if_fallthrough)
recipe main [
  jump-if 0:literal, 1:offset
  123:number <- copy 1:literal
]
+run: jump-if 0:literal, 1:offset
+run: jump-if fell through
+run: 123:number <- copy 1:literal
+mem: storing 1 in location 123

:(before "End Primitive Recipe Declarations")
JUMP_UNLESS,
:(before "End Primitive Recipe Numbers")
Recipe_number["jump-unless"] = JUMP_UNLESS;
:(before "End Primitive Recipe Implementations")
case JUMP_UNLESS: {
  assert(current_instruction().ingredients.at(1).initialized);
  assert(SIZE(ingredients) == 2);
  assert(scalar(ingredients.at(0)));
  if (ingredients.at(0).at(0)) {
    trace("run") << "jump-unless fell through";
    break;
  }
  assert(scalar(ingredients.at(1)));
  instruction_counter += ingredients.at(1).at(0);
  trace("run") << "jumping to instruction " << instruction_counter+1;
  break;
}

:(scenario jump_unless)
recipe main [
  jump-unless 0:literal, 1:offset
  123:number <- copy 1:literal
]
+run: jump-unless 0:literal, 1:offset
+run: jumping to instruction 2
-run: 123:number <- copy 1:literal
-mem: storing 1 in location 123

:(scenario jump_unless_fallthrough)
recipe main [
  jump-unless 999:literal, 1:offset
  123:number <- copy 1:literal
]
+run: jump-unless 999:literal, 1:offset
+run: jump-unless fell through
+run: 123:number <- copy 1:literal
+mem: storing 1 in location 123