Commit 0c42e301 authored by Simon Marlow's avatar Simon Marlow
Browse files

remove unnecessary size field in BCO (#7518)

parent f838d2f3
......@@ -129,10 +129,7 @@ assembleBCO dflags (ProtoBCO nm instrs bitmap bsize arity _origin _malloced) = d
-- pass 1: collect up the offsets of the local labels.
let asm = mapM_ (assembleI dflags) instrs
-- Remember that the first insn starts at offset
-- sizeOf Word / sizeOf Word16
-- since offset 0 (eventually) will hold the total # of insns.
initial_offset = largeArg16s dflags
initial_offset = 0
-- Jump instructions are variable-sized, there are long and short variants
-- depending on the magnitude of the offset. However, we can't tell what
......@@ -153,8 +150,7 @@ assembleBCO dflags (ProtoBCO nm instrs bitmap bsize arity _origin _malloced) = d
(Map.lookup lbl lbl_map)
-- pass 2: run assembler and generate instructions, literals and pointers
let initial_insns = addListToSS emptySS $ largeArg dflags n_insns
let initial_state = (initial_insns, emptySS, emptySS)
let initial_state = (emptySS, emptySS, emptySS)
(final_insns, final_lits, final_ptrs) <- execState initial_state $ runAsm dflags long_jumps env asm
-- precomputed size should be equal to final size
......@@ -788,9 +788,7 @@ run_BCO:
register StgPtr* ptrs = (StgPtr*)(&bco->ptrs->payload[0]);
#ifdef DEBUG
int bcoSize;
bcoSize = bco->instrs->bytes / sizeof(StgWord16);
IF_DEBUG(interpreter,debugBelch("bcoSize = %d\n", bcoSize));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment