From: sewardj Date: Tue, 7 Dec 1999 11:49:11 +0000 (+0000) Subject: [project @ 1999-12-07 11:49:09 by sewardj] X-Git-Tag: Approximately_9120_patches~5415 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=eaf6532ae30d9b301e208af460f753118babeee1;p=ghc-hetmet.git [project @ 1999-12-07 11:49:09 by sewardj] Add i_ALLOC_CONSTR_big (== i_ALLOC_CONSTR with a 16-bit field denoting offset of into table). The large constant tables in nofib/spectral/hartel/nucleic2 need this. --- diff --git a/ghc/rts/Assembler.c b/ghc/rts/Assembler.c index 91d5038..dec5bd9 100644 --- a/ghc/rts/Assembler.c +++ b/ghc/rts/Assembler.c @@ -5,8 +5,8 @@ * Copyright (c) 1994-1998. * * $RCSfile: Assembler.c,v $ - * $Revision: 1.21 $ - * $Date: 1999/12/07 11:22:56 $ + * $Revision: 1.22 $ + * $Date: 1999/12/07 11:49:09 $ * * This module provides functions to construct BCOs and other closures * required by the bytecode compiler. @@ -753,6 +753,14 @@ static void emit_i_RETADDR ( AsmBCO bco, int arg1 ) emiti_16(bco,i_RETADDR_big,arg1); } +static void emit_i_ALLOC_CONSTR ( AsmBCO bco, int arg1 ) +{ + ASSERT(arg1 >= 0); + if (arg1 < 256) + emiti_8 (bco,i_ALLOC_CONSTR, arg1); else + emiti_16(bco,i_ALLOC_CONSTR_big,arg1); +} + /* -------------------------------------------------------------------------- * Arg checks. @@ -1548,10 +1556,10 @@ AsmVar asmAllocCONSTR ( AsmBCO bco, AsmInfo info ) i = asmFindInNonPtrs ( bco, (StgWord)info ); if (i == -1) { - emiti_8(bco,i_ALLOC_CONSTR,bco->nps.len); + emit_i_ALLOC_CONSTR(bco,bco->nps.len); asmWords(bco,AsmInfo,info); } else { - emiti_8(bco,i_ALLOC_CONSTR,i); + emit_i_ALLOC_CONSTR(bco,i); } incSp(bco, sizeofW(StgClosurePtr)); diff --git a/ghc/rts/Bytecodes.h b/ghc/rts/Bytecodes.h index 8fdc784..b66fcc7 100644 --- a/ghc/rts/Bytecodes.h +++ b/ghc/rts/Bytecodes.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- - * $Id: Bytecodes.h,v 1.12 1999/11/18 12:10:25 sewardj Exp $ + * $Id: Bytecodes.h,v 1.13 1999/12/07 11:49:10 sewardj Exp $ * * (c) The GHC Team, 1998-1999 * @@ -32,6 +32,7 @@ Ins(i_ALLOC_AP), \ Ins(i_ALLOC_PAP), \ Ins(i_ALLOC_CONSTR), \ + Ins(i_ALLOC_CONSTR_big), \ Ins(i_MKAP), \ Ins(i_MKAP_big), \ Ins(i_MKPAP), \ diff --git a/ghc/rts/Disassembler.c b/ghc/rts/Disassembler.c index 4a4d99b..56792cb 100644 --- a/ghc/rts/Disassembler.c +++ b/ghc/rts/Disassembler.c @@ -5,8 +5,8 @@ * Copyright (c) 1994-1998. * * $RCSfile: Disassembler.c,v $ - * $Revision: 1.11 $ - * $Date: 1999/11/16 17:39:10 $ + * $Revision: 1.12 $ + * $Date: 1999/12/07 11:49:11 $ * ---------------------------------------------------------------------------*/ #include "Rts.h" @@ -97,6 +97,17 @@ static InstrPtr disInfo ( StgBCO *bco, InstrPtr pc, char* i ) return pc; } +static InstrPtr disInfo16 ( StgBCO *bco, InstrPtr pc, char* i ) +{ + StgWord x = bcoInstr16(bco,pc); + StgInfoTable* info = bcoConstInfoPtr(bco,x); + pc+=2; + /* ToDo: print contents of infotable */ + fprintf(stderr,"%s ",i); + printPtr(stgCast(StgPtr,info)); + return pc; +} + static InstrPtr disConstPtr ( StgBCO *bco, InstrPtr pc, char* i ) { StgInt o = bcoInstr(bco,pc++); @@ -215,6 +226,8 @@ InstrPtr disInstr( StgBCO *bco, InstrPtr pc ) return disInt(bco,pc,"ALLOC_PAP"); case i_ALLOC_CONSTR: return disInfo(bco,pc,"ALLOC_CONSTR"); + case i_ALLOC_CONSTR_big: + return disInfo16(bco,pc,"ALLOC_CONSTR_big"); case i_MKAP: return disIntInt(bco,pc,"MKAP"); case i_MKAP_big: diff --git a/ghc/rts/Evaluator.c b/ghc/rts/Evaluator.c index 681cb6b..087638f 100644 --- a/ghc/rts/Evaluator.c +++ b/ghc/rts/Evaluator.c @@ -5,8 +5,8 @@ * Copyright (c) 1994-1998. * * $RCSfile: Evaluator.c,v $ - * $Revision: 1.30 $ - * $Date: 1999/11/29 18:59:42 $ + * $Revision: 1.31 $ + * $Date: 1999/12/07 11:49:11 $ * ---------------------------------------------------------------------------*/ #include "Rts.h" @@ -698,6 +698,16 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 ) xPushPtr(p); Continue; } + Case(i_ALLOC_CONSTR_big): + { + StgPtr p; + int x = BCO_INSTR_16; + StgInfoTable* info = bcoConstAddr(bco,x); + SSS; p = grabHpNonUpd(sizeW_fromITBL(info)); LLL; + SET_HDR((StgClosure*)p,info,??); + xPushPtr(p); + Continue; + } Case(i_MKAP): { int x = BCO_INSTR_8; /* ToDo: Word not Int! */