mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-29 10:08:47 +00:00
merge
This commit is contained in:
parent
c9bfede950
commit
4d54809acb
6 changed files with 106 additions and 32 deletions
19
src/X86.ml
19
src/X86.ml
|
|
@ -326,7 +326,24 @@ let compile env code =
|
|||
let s1, env = env#allocate in
|
||||
let s2, env = env#allocate in
|
||||
let env, code = call env ".tag" 3 false in
|
||||
env, [Mov (L env#hash t, s1); Mov (L n, s2)] @ code
|
||||
env, [Mov (L env#hash t, s1); Mov (L n, s2)] @ code
|
||||
|
||||
| ARRAY n ->
|
||||
let s, env = env#allocate in
|
||||
let env, code = call env ".array_patt" 2 false in
|
||||
env, [Mov (L n, s)] @ code
|
||||
|
||||
| PATT StrCmp -> call env ".string_patt" 2 false
|
||||
|
||||
| PATT patt ->
|
||||
call env
|
||||
(match patt with
|
||||
| Boxed -> ".boxed_patt"
|
||||
| UnBoxed -> ".unboxed_patt"
|
||||
| Array -> ".array_tag_patt"
|
||||
| String -> ".string_tag_patt"
|
||||
| Sexp -> ".sexp_tag_patt"
|
||||
) 1 false
|
||||
| ENTER xs ->
|
||||
let env, code =
|
||||
List.fold_left
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue