Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/0c42e301337bdefa94d0c288bb6d689ac33baa4d >--------------------------------------------------------------- commit 0c42e301337bdefa94d0c288bb6d689ac33baa4d Author: Simon Marlow <marlo...@gmail.com> Date: Wed Jan 9 11:51:58 2013 +0000 remove unnecessary size field in BCO (#7518) >--------------------------------------------------------------- compiler/ghci/ByteCodeAsm.lhs | 8 ++------ rts/Interpreter.c | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/compiler/ghci/ByteCodeAsm.lhs b/compiler/ghci/ByteCodeAsm.lhs index 17b3042..9631add 100644 --- a/compiler/ghci/ByteCodeAsm.lhs +++ b/compiler/ghci/ByteCodeAsm.lhs @@ -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 diff --git a/rts/Interpreter.c b/rts/Interpreter.c index 809f0ab..f4fe816 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -788,9 +788,7 @@ run_BCO: register StgPtr* ptrs = (StgPtr*)(&bco->ptrs->payload[0]); #ifdef DEBUG int bcoSize; - bcoSize = BCO_READ_NEXT_WORD; -#else - BCO_NEXT_WORD; + bcoSize = bco->instrs->bytes / sizeof(StgWord16); #endif IF_DEBUG(interpreter,debugBelch("bcoSize = %d\n", bcoSize)); _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc