Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ollef committed May 28, 2024
1 parent c8dbe43 commit 095b042
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Lower.hs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,9 @@ boxedConstructorSize env con params args = do
Evaluation.evaluate env' size
case maybeResult of
Nothing -> panic "boxedConstructorSize: Data params length mismatch"
Just result -> Readback.readback env result

moduleInits :: [Name.Module] -> M Low.Definition
moduleInits :: [Name.Module] -> M Low.Syntax.Definition
moduleInits moduleNames =
runBuilder do
globalPointer <- freshLocal "globals"
Expand All @@ -602,8 +603,8 @@ moduleInits moduleNames =

moduleInit
:: Name.Module
-> [(Name.Lifted, Assembly.Definition)]
-> M [(Name.Lifted, Assembly.Definition)]
-> [(Name.Lifted, Low.Syntax.Definition)]
-> M [(Name.Lifted, Low.Syntax.Definition)]
moduleInit moduleName definitions =
runBuilder do
Assembly.LocalOperand heapPointerParameter <- gets (.heapPointer)
Expand Down Expand Up @@ -668,7 +669,7 @@ moduleInit moduleName definitions =
Assembly.ConstantDefinition {} ->
callInitFunction "globals" (initDefinitionName name) [(Assembly.WordPointer, globalBasePointer), (Assembly.WordPointer, globalPointer)]
Assembly.FunctionDefinition {} ->
pure globalPointer Just result -> Readback.readback env result
pure globalPointer

-------------------------------------------------------------------------------

Expand Down

0 comments on commit 095b042

Please sign in to comment.