Skip to content

Improve compilation of Pancake's exception #1475

Description

@minhddo

Pancake's Raise semantics has a check that the exception value shape is smaller than 32 words (see code below), because it is currently compiled into stores to wordLang Temp stores later on in the compiler. A possible improvement is to remove this check which can allow arbitrary shape exception and compile it in a different manner.

  (evaluate (Raise eid e,s) =
    case (FLOOKUP s.eshapes eid, eval s e) of
      | (SOME sh, SOME value) =>
         if shape_of value = sh ∧
            size_of_sh_with_ctxt s.structs (shape_of value) <= 32
         then (SOME (Exception eid value),empty_locals s)
         else (SOME Error,s)
     | _ => (SOME Error,s)) /\

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions