Skip to content
  • Marius Gerbershagen's avatar
    bytecmp: preserve the identity for literal objects · b730412e
    Marius Gerbershagen authored
    When a literal appears in the file multiple times its identity should be
    preserved.
    
    CLHS 3.2.4.4:
    
    > If two literal objects appearing in the source code for a single
    > file processed with the file compiler are the identical, the
    > corresponding objects in the compiled code must also be the identical.
    
    Previously, every bytecode object created during ext::bc-compile-file
    had its own vector of constants making it impossible to satisfy this
    constraint. Thus, we change ext::bc-compile-file to use the same
    constants vector for all bytecode objects from the same file. The
    simplest way to achieve this is to use the same compiler environment
    for all of the compilation process and push the read-compile loop
    into the si_bc_compile_from_stream function implemented in C.
    b730412e