about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-04 23:02:05 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-18 00:44:48 -0700
commit164dbb98a37f39c81ec6cf80900dc611c993f1e9 (patch)
treefde2a186fa300434e05a2f96864cee32d1a20ea6
parent4d9ec06f27c233d42272e5e660c48f31623bb93d (diff)
downloadmu-164dbb98a37f39c81ec6cf80900dc611c993f1e9.tar.gz
-
-rw-r--r--apps/mu.subx32
1 files changed, 14 insertions, 18 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index 50e5360f..6fac67b2 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -5825,35 +5825,26 @@ new-literal-integer:  # ad: (addr allocation-descriptor), name: (addr slice), ou
     # . save registers
     50/push-eax
     51/push-ecx
-    52/push-edx
     # if (!is-hex-int?(name)) abort
     (is-hex-int? *(ebp+0xc))  # => eax
     3d/compare-eax-and 0/imm32/false
     0f 84/jump-if-= $new-literal-integer:abort/disp32
-    # var type/ecx: (handle tree type-id)
-    68/push 0/imm32
-    68/push 0/imm32
-    89/<- %ecx 4/r32/esp
-    # type = new tree()
-    (allocate *(ebp+8) *Tree-size %ecx)
-    c7 0/subop/copy *ecx 1/imm32/true  # Tree-is-atom
-    # nothing else to do; default type is 'literal'
     # out = new var(s)
     (new-var-from-slice *(ebp+8) *(ebp+0xc) *(ebp+0x10))
-    # var out-addr/edx: (addr var) = lookup(*out)
+    # var out-addr/ecx: (addr var) = lookup(*out)
     8b/-> *(ebp+0x10) 0/r32/eax
     (lookup *eax *(eax+4))  # => eax
-    89/<- %edx 0/r32/eax
-    # out-addr->type = type
-    8b/-> *ecx 0/r32/eax
-    89/<- *(edx+8) 0/r32/eax  # Var-type
-    8b/-> *(ecx+4) 0/r32/eax
-    89/<- *(edx+0xc) 0/r32/eax  # Var-type
+    89/<- %ecx 0/r32/eax
+    # out-addr->type = new tree()
+    8d/copy-address *(ecx+8) 0/r32/eax  # Var-type
+    (allocate *(ebp+8) *Tree-size %eax)
+    (lookup *(ecx+8) *(ecx+0xc))  # Var-type Var-type => eax
+    c7 0/subop/copy *eax 1/imm32/true  # Tree-is-atom
+    # nothing else to do; default type is 'literal'
 $new-literal-integer:end:
     # . reclaim locals
     81 0/subop/add %esp 8/imm32
     # . restore registers
-    5a/pop-to-edx
     59/pop-to-ecx
     58/pop-to-eax
     # . epilogue
@@ -5892,7 +5883,7 @@ new-literal:  # ad: (addr allocation-descriptor), name: (addr slice), out: (addr
     # out->type = new type
     8d/copy-address *(ecx+8) 0/r32/eax  # Var-type
     (allocate *(ebp+8) *Tree-size %eax)
-    (lookup *(ecx+8) *(ecx+0xc))  # => eax
+    (lookup *(ecx+8) *(ecx+0xc))  # Var-type Var-type => eax
     # nothing else to do; default type is 'literal'
     c7 0/subop/copy *eax 1/imm32/true  # Tree-is-atom
 $new-literal:end:
@@ -6684,6 +6675,7 @@ compute-size-of-var:  # in: (addr var) -> result/eax: int
     89/<- %ebp 4/r32/esp
     # . push registers
     51/push-ecx
+    # TODO
     # var t/ecx: (handle tree type-id) = v->type
     8b/-> *(ebp+8) 1/r32/ecx
     8b/-> *(ecx+4) 1/r32/ecx  # Var-type
@@ -6862,6 +6854,7 @@ size-of:  # v: (addr var) -> result/eax: int
     89/<- %ebp 4/r32/esp
     # . save registers
     51/push-ecx
+    # TODO
     # var t/ecx: (handle tree type-id) = v->type
     8b/-> *(ebp+8) 1/r32/ecx
     8b/-> *(ecx+4) 1/r32/ecx  # Var-type
@@ -6894,6 +6887,7 @@ size-of-deref:  # v: (addr var) -> result/eax: int
     89/<- %ebp 4/r32/esp
     # . save registers
     51/push-ecx
+    # TODO
     # var t/ecx: (handle tree type-id) = v->type
     8b/-> *(ebp+8) 1/r32/ecx
     8b/-> *(ecx+4) 1/r32/ecx  # Var-type
@@ -8233,6 +8227,7 @@ $translate-mu-index-stmt-with-array-in-register:emit-int-register-index:
         e9/jump $translate-mu-index-stmt-with-array-in-register:emit-register-index-done/disp32
       }
       # if index->type is any other atom, abort
+      # TODO
       8b/-> *(edx+4) 0/r32/eax  # Var-type
       81 7/subop/compare *eax 0/imm32/false  # Tree-is-atom
       0f 85/jump-if-!= $translate-mu-index-stmt-with-array:error2/disp32
@@ -8342,6 +8337,7 @@ $translate-mu-index-stmt-with-array-on-stack:emit-int-register-index:
         e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done/disp32
       }
       # if index->type is any other atom, abort
+      # TODO
       8b/-> *(edx+4) 0/r32/eax  # Var-type
       81 7/subop/compare *eax 0/imm32/false  # Tree-is-atom
       0f 85/jump-if-!= $translate-mu-index-stmt-with-array:error2/disp32