about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/mu.subx62
1 files changed, 44 insertions, 18 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index c1e85a43..6582531d 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -11949,7 +11949,8 @@ $emit-subx-call-operand:stack:
       75/jump-if-!= break/disp8
 $emit-subx-call-operand:literal:
       (write-buffered *(ebp+8) Space)
-      (write-buffered *(ebp+8) *esi)
+      (lookup *esi *(esi+4))  # Var-name Var-name => eax
+      (write-buffered *(ebp+8) %eax)
     }
 $emit-subx-call-operand:end:
     # . restore registers
@@ -14441,9 +14442,9 @@ $test-emit-subx-function-call:initialize-stmt-operation:
 
 test-emit-subx-stmt-function-call-with-literal-arg:
     # Call a function on a literal.
-    #   f 34
+    #   f 0x34
     # =>
-    #   (f2 34)
+    #   (f2 0x34)
     #
     # . prologue
     55/push-ebp
@@ -14451,29 +14452,54 @@ test-emit-subx-stmt-function-call-with-literal-arg:
     # setup
     (clear-stream _test-output-stream)
     (clear-stream $_test-output-buffered-file->buffer)
-    # var type/ecx: (handle tree type-id) = literal
-    68/push 0/imm32/right/null
-    68/push 0/imm32/left/literal
+$test-emit-subx-function-call-with-literal-arg:initialize-type:
+    # var type/ecx: (payload tree type-id) = int
+    68/push 0/imm32/right:null
+    68/push 0/imm32/right:null
+    68/push 0/imm32/left:unused
+    68/push 0/imm32/value:literal
+    68/push 1/imm32/is-atom?:true
+    68/push 0x11/imm32/alloc-id:fake:payload
     89/<- %ecx 4/r32/esp
-    # var var-foo/ecx: var literal
+$test-emit-subx-function-call-with-literal-arg:initialize-var:
+    # var var-foo/ecx: (payload var) = var(lit)
+    68/push 0/imm32/no-register
     68/push 0/imm32/no-register
     68/push 0/imm32/no-stack-offset
-    68/push 0/imm32/block-depth
-    51/push-ecx
-    68/push "34"/imm32
+    68/push 1/imm32/block-depth
+    51/push-ecx/type
+    68/push 0x11/imm32/alloc-id:fake
+    68/push 0/imm32/name
+    68/push 0/imm32/name
+    68/push 0x11/imm32/alloc-id:fake:payload
     89/<- %ecx 4/r32/esp
-    # var inouts/esi: (handle stmt-var)
+$test-emit-subx-function-call-with-literal-arg:initialize-var-name:
+    # var-foo->name = "0x34"
+    8d/copy-address *(ecx+4) 0/r32/eax  # Var-name + 4
+    (copy-array Heap "0x34" %eax)
+$test-emit-subx-function-call-with-literal-arg:initialize-stmt-var:
+    # var operand/ebx: (payload stmt-var) = stmt-var(var-foo)
     68/push 0/imm32/is-deref:false
     68/push 0/imm32/next
-    51/push-ecx/var-foo
-    89/<- %esi 4/r32/esp
-    # var stmt/esi: statement
     68/push 0/imm32/next
+    51/push-ecx/var-foo
+    68/push 0x11/imm32/alloc-id:fake
+    68/push 0x11/imm32/alloc-id:fake:payload
+    89/<- %ebx 4/r32/esp
+$test-emit-subx-function-call-with-literal-arg:initialize-stmt:
+    # var stmt/esi: (addr statement)
     68/push 0/imm32/no-outputs
-    56/push-esi/inouts
-    68/push "f"/imm32/operation
-    68/push 1/imm32
+    68/push 0/imm32/no-outputs
+    53/push-ebx/inouts
+    68/push 0x11/imm32/alloc-id:fake
+    68/push 0/imm32/operation
+    68/push 0/imm32/operation
+    68/push 1/imm32/tag
     89/<- %esi 4/r32/esp
+$test-emit-subx-function-call-with-literal-arg:initialize-stmt-operation:
+    # stmt->operation = "f"
+    8d/copy-address *(esi+4) 0/r32/eax  # Stmt1-operation
+    (copy-array Heap "f" %eax)
     # convert
     c7 0/subop/copy *Curr-block-depth 0/imm32
     (emit-subx-stmt _test-output-buffered-file %esi 0 %ebx)
@@ -14485,7 +14511,7 @@ test-emit-subx-stmt-function-call-with-literal-arg:
 #?     (rewind-stream _test-output-stream)
 #?     # }}}
     # check output
-    (check-next-stream-line-equal _test-output-stream "(f 34)" "F - test-emit-subx-stmt-function-call-with-literal-arg")
+    (check-next-stream-line-equal _test-output-stream "(f 0x34)" "F - test-emit-subx-stmt-function-call-with-literal-arg")
     # . epilogue
     89/<- %esp 5/r32/ebp
     5d/pop-to-ebp
gmail.com> 2016-02-14 22:28:55 +0000 committer James Booth <boothj5@gmail.com> 2016-02-14 22:28:55 +0000 Added C plugin code from plugins branch' href='/danisanti/profani-tty/commit/.gitignore?id=41fe8c22b1f8c1cf666d42052cd73d59e40a2ed2'>41fe8c22 ^
b1375328 ^





68ed20f1 ^





b1375328 ^


e94b604b ^
e0dfe483 ^
b1375328 ^


e0dfe483 ^

d944e825 ^


9d782fa6 ^
1bc69418 ^




a308f5e4 ^

9d782fa6 ^
7bc160c2 ^
1bc69418 ^




b68d2ce1 ^

1bc69418 ^

d169312a ^
53a7689a ^
d169312a ^
7f956aa4 ^


62cbad1c ^
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





                                                                 





                   
                     

             


          


           

            
            

               

          
             
         
           

               
   



               
                


                   
                      





             





                                         


               
             
           


               

                  


                
 




                           

                             
               
                            




                

        

         
     
      
      


       
      
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

# IDE
.codelite/
profanity.mk
profanity.project
profanity.workspace
compile_commands.json
.tern-port
.tern-project
.cproject
.project
.settings/

# autotools
.libs/
/Makefile
/Makefile.in
_configs.sed
aclocal.m4
autom4te.cache/
build-aux/
config.log
config.status
configure
configure*~
libprofanity.la
libtool
m4/
**/.deps/
**.dirstamp
src/config.h
src/config.h.in
src/config.h.in~
src/gitversion.h
src/gitversion.h.in
src/stamp-h1
src/plugins/profapi.lo

# binaries
profanity
**/*.o

# test output
tests/functionaltests/functionaltests
tests/functionaltests/functionaltests.log
tests/functionaltests/functionaltests.trs
tests/unittests/unittests
tests/unittests/unittests.log
tests/unittests/unittests.trs
test-suite.log

# local scripts
clean-test.sh
gen_docs.sh
gitpushall.sh

# website files
main_fragment.html
toc_fragment.html

# valgrind files
valgrind.out

# Generate docs
apidocs/python/_build/
apidocs/python/modules.rst
apidocs/python/prof.rst
apidocs/python/src/prof.pyc
apidocs/python/plugin.rst
apidocs/python/src/plugin.pyc
apidocs/c/html/
apidocs/c/doxygen_sqlite3.db

# Temp Vim files
**/*.swp

# Virtual envs
python2/
python3/

.DS_Store
*.bak
*.orig
breaks

*.tar.*
*.zip
*.log*