Commit eaf6532a authored by sewardj's avatar sewardj
Browse files

[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.
parent 95b10333
......@@ -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));
......
/* -----------------------------------------------------------------------------
* $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), \
......
......@@ -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:
......
......@@ -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! */
......
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