[kaffe] CVS kaffe (guilhem): Adjusted/Cleaned up symbol names to make kaffe work under a Ch environment.
Kaffe CVS
cvs-commits at kaffe.org
Mon Dec 27 08:14:13 PST 2004
PatchSet 5725
Date: 2004/12/27 16:09:42
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Adjusted/Cleaned up symbol names to make kaffe work under a Ch environment.
* config/alpha/jit-alpha.def,
config/i386/jit-i386.def,
config/i386/jit3-i386.def,
config/powerpc/jit3-powerpc.def,
kaffe/kaffevm/jit/funcs.c,
kaffe/kaffevm/jit/icode.c,
kaffe/kaffevm/jit/machine.c,
kaffe/kaffevm/jit3/funcs.c,
kaffe/kaffevm/jit3/icode.c,
kaffe/kaffevm/jit3/machine.c: Adjusted calls to the new name of
some JIT compiler symbols.
* kaffe/kaffevm/jit/constpool.c, kaffe/kaffevm/jit/constpool.h,
* kaffe/kaffevm/jit/labels.c, kaffe/kaffevm/jit/labels.h:
Renamed functions to use the KaffeJIT_ prefix.
* kaffe/kaffevm/jit/machine.h: New macro KJIT to follow the prefix name.
* kaffe/kaffevm/jit/native-wrapper.c: Renamed calls to the JIT
compiler using the KJIT macro.
* kaffe/kaffevm/jit3/constpool.c, kaffe/kaffevm/jit3/constpool.h,
kaffe/kaffevm/jit3/labels.c, kaffe/kaffevm/jit3/labels.h:
Renamed functions to use the KaffeJIT_ prefix.
* kaffe/kaffevm/jit3/machine.h: New macro KJIT to follow the prefix name.
* kaffe/kaffevm/jni/jni-base.c
(parseSize): Imported from kaffe/main.c
(KaffeJNI_ParseArgs): Added support for debug output and stack
size setting.
Members:
ChangeLog:1.3269->1.3270
config/alpha/jit-alpha.def:1.11->1.12
config/i386/jit-i386.def:1.18->1.19
config/i386/jit3-i386.def:1.28->1.29
config/powerpc/jit3-powerpc.def:1.2->1.3
kaffe/kaffevm/debug.c:1.59->1.60
kaffe/kaffevm/jit/constpool.c:1.5->1.6
kaffe/kaffevm/jit/constpool.h:1.2->1.3
kaffe/kaffevm/jit/funcs.c:1.7->1.8
kaffe/kaffevm/jit/icode.c:1.32->1.33
kaffe/kaffevm/jit/labels.c:1.12->1.13
kaffe/kaffevm/jit/labels.h:1.5->1.6
kaffe/kaffevm/jit/machine.c:1.73->1.74
kaffe/kaffevm/jit/machine.h:1.20->1.21
kaffe/kaffevm/jit/native-wrapper.c:1.5->1.6
kaffe/kaffevm/jit3/constpool.c:1.12->1.13
kaffe/kaffevm/jit3/constpool.h:1.5->1.6
kaffe/kaffevm/jit3/funcs.c:1.15->1.16
kaffe/kaffevm/jit3/icode.c:1.50->1.51
kaffe/kaffevm/jit3/labels.c:1.16->1.17
kaffe/kaffevm/jit3/labels.h:1.9->1.10
kaffe/kaffevm/jit3/machine.c:1.68->1.69
kaffe/kaffevm/jit3/machine.h:1.23->1.24
kaffe/kaffevm/jni/jni-base.c:1.9->1.10
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3269 kaffe/ChangeLog:1.3270
--- kaffe/ChangeLog:1.3269 Sat Dec 25 19:09:03 2004
+++ kaffe/ChangeLog Mon Dec 27 16:09:42 2004
@@ -1,4 +1,38 @@
-2004-12-22 Guilhem Lavaux <guilhem at kaffe.org>
+2004-12-27 Guilhem Lavaux <guilhem at kaffe.org>
+
+ * config/alpha/jit-alpha.def,
+ config/i386/jit-i386.def,
+ config/i386/jit3-i386.def,
+ config/powerpc/jit3-powerpc.def,
+ kaffe/kaffevm/jit/funcs.c,
+ kaffe/kaffevm/jit/icode.c,
+ kaffe/kaffevm/jit/machine.c,
+ kaffe/kaffevm/jit3/funcs.c,
+ kaffe/kaffevm/jit3/icode.c,
+ kaffe/kaffevm/jit3/machine.c: Adjusted calls to the new name of
+ some JIT compiler symbols.
+
+ * kaffe/kaffevm/jit/constpool.c, kaffe/kaffevm/jit/constpool.h,
+ * kaffe/kaffevm/jit/labels.c, kaffe/kaffevm/jit/labels.h:
+ Renamed functions to use the KaffeJIT_ prefix.
+
+ * kaffe/kaffevm/jit/machine.h: New macro KJIT to follow the prefix name.
+
+ * kaffe/kaffevm/jit/native-wrapper.c: Renamed calls to the JIT
+ compiler using the KJIT macro.
+
+ * kaffe/kaffevm/jit3/constpool.c, kaffe/kaffevm/jit3/constpool.h,
+ kaffe/kaffevm/jit3/labels.c, kaffe/kaffevm/jit3/labels.h:
+ Renamed functions to use the KaffeJIT_ prefix.
+
+ * kaffe/kaffevm/jit3/machine.h: New macro KJIT to follow the prefix name.
+
+ * kaffe/kaffevm/jni/jni-base.c
+ (parseSize): Imported from kaffe/main.c
+ (KaffeJNI_ParseArgs): Added support for debug output and stack
+ size setting.
+
+2004-12-25 Guilhem Lavaux <guilhem at kaffe.org>
* configure.ac: Fixed CPPFLAGS generation to be compatible with
boehm's configure.
Index: kaffe/config/alpha/jit-alpha.def
diff -u kaffe/config/alpha/jit-alpha.def:1.11 kaffe/config/alpha/jit-alpha.def:1.12
--- kaffe/config/alpha/jit-alpha.def:1.11 Tue Jul 13 16:15:18 2004
+++ kaffe/config/alpha/jit-alpha.def Mon Dec 27 16:09:43 2004
@@ -888,7 +888,7 @@
alpha_jit_info.rsa_size = rsa_size;
/* return address */
- L = newLabel();
+ L = KaffeJIT_newLabel();
L->type = Lrsa|Labsolute|Lgeneral;
L->at = (uintp)CODEPC;
op_stq(REG_ra, REG_sp, 0);
@@ -897,7 +897,7 @@
/* registers s0 - s5 and fp (also know as s6) */
for (r = 0; r < 7; r++, N++) {
- L = newLabel();
+ L = KaffeJIT_newLabel();
L->type = Lrsa|Labsolute|Lgeneral;
L->at = (uintp)CODEPC;
op_stq(REG_s0+r, REG_sp, SLOTSIZE * N);
@@ -905,7 +905,7 @@
/* registers f2 - f9 */
for (r = 0; r < (9 - 2 + 1); r++, N++) {
- L = newLabel();
+ L = KaffeJIT_newLabel();
L->type = Lrsa|Labsolute|Lgeneral;
L->at = (uintp)CODEPC;
op_stt(REG_f2+r, REG_sp, SLOTSIZE * N);
@@ -916,7 +916,7 @@
/* setup our virtual frame pointer, it's not part of the prologue. */
- L = newLabel();
+ L = KaffeJIT_newLabel();
L->type = Lframe|Labsolute|Lgeneral;
L->at = (uintp)CODEPC;
op_lda(REG_fp, REG_sp, 0);
@@ -1125,7 +1125,7 @@
* area as specified by PDSC_RPD_RSA_OFFSET. */
/* return address */
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lrsa|Labsolute|Lgeneral;
l->at = (uintp)CODEPC;
op_ldq(REG_ra, REG_sp, 0);
@@ -1134,7 +1134,7 @@
/* registers s0 - s5 and fp (also know as s6) */
for (r = 0; r < 7; r++, N++) {
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lrsa|Labsolute|Lgeneral;
l->at = (uintp)CODEPC;
op_ldq(REG_s0+r, REG_sp, SLOTSIZE * N);
@@ -1142,7 +1142,7 @@
/* registers f2 - f9 */
for (r = 0; r < (9 - 2 + 1); r++, N++) {
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lrsa|Labsolute|Lgeneral;
l->at = (uintp)CODEPC;
op_ldt(REG_f2+r, REG_sp, SLOTSIZE * N);
@@ -1156,7 +1156,7 @@
* leaves SP pointing to a lower stack address than it had on entry
* to the procedure, as specified in Section 4.1.7. */
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lframe|Labsolute|Lgeneral;
l->at = (uintp)CODEPC;
op_lda(REG_sp, REG_sp, 0);
@@ -1180,7 +1180,7 @@
* and FP set. */
alpha_ldgp(REG_pv);
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lnegframe|Labsolute|Lgeneral;
l->at = (uintp)CODEPC;
op_lda(REG_sp, REG_fp, 0);
@@ -1316,8 +1316,8 @@
#define alpha_move_const_pool(w, l, t, d, op) \
do { \
- constpool *_c = newConstant((t), (d)); \
- label *_l = ((l) ? (l) : newLabel()); \
+ constpool *_c = KaffeJIT_newConstant((t), (d)); \
+ label *_l = ((l) ? (l) : KaffeJIT_newLabel()); \
int _w = (w); \
\
_l->from = 0; \
Index: kaffe/config/i386/jit-i386.def
diff -u kaffe/config/i386/jit-i386.def:1.18 kaffe/config/i386/jit-i386.def:1.19
--- kaffe/config/i386/jit-i386.def:1.18 Sun Dec 19 23:45:09 2004
+++ kaffe/config/i386/jit-i386.def Mon Dec 27 16:09:45 2004
@@ -300,7 +300,7 @@
define_insn(epilogue, epilogue_xxx)
{
- setEpilogueLabel((uintp)CODEPC);
+ KaffeJIT_setEpilogueLabel((uintp)CODEPC);
#if 0
/* If this method uses IEEE, restore it */
@@ -776,7 +776,7 @@
OUT(0xFF);
debug(("cmp #0xFF,%s\n", regname(r)));
- l1 = newLabel();
+ l1 = KaffeJIT_newLabel();
l1->type = Linternal| Llong8|Lrelative;
OUT(0x74);
l1->at = CODEPC;
@@ -866,7 +866,7 @@
OUT(0xFF);
debug(("cmp #0xFF,%s\n", regname(r)));
- l1 = newLabel();
+ l1 = KaffeJIT_newLabel();
l1->type = Linternal| Llong8|Lrelative;
OUT(0x74);
l1->at = CODEPC;
Index: kaffe/config/i386/jit3-i386.def
diff -u kaffe/config/i386/jit3-i386.def:1.28 kaffe/config/i386/jit3-i386.def:1.29
--- kaffe/config/i386/jit3-i386.def:1.28 Sun Dec 19 06:25:07 2004
+++ kaffe/config/i386/jit3-i386.def Mon Dec 27 16:09:45 2004
@@ -193,7 +193,7 @@
{
/* Store the pointer to this function in eax */
OUT(0xB8|REG_eax);
- l = (label*)newLabel();
+ l = (label*)KaffeJIT3_newLabel();
l->type = Llong|Linternal|Labsolute;
l->to = 0;
l->at = (uintp)CODEPC;
@@ -442,7 +442,7 @@
{
label *el;
- if( (el = getLastEpilogueLabel()) && (el->at == (CODEPC - 4)) )
+ if( (el = KaffeJIT3_getLastEpilogueLabel()) && (el->at == (CODEPC - 4)) )
{
/*
* Nothing to jump over to get to the epilogue... Replace
@@ -455,7 +455,7 @@
{
/* The function ends with a throw, not a return. */
}
- setEpilogueLabel((uintp)CODEPC);
+ KaffeJIT3_setEpilogueLabel((uintp)CODEPC);
#if 0
/* If this method uses IEEE, restore it */
@@ -616,7 +616,7 @@
l->at = CODEPC;
LOUT(0);
- debug(("movl #%s,%s\n", getLabelName(l), regname(w)));
+ debug(("movl #%s,%s\n", KaffeJIT3_getLabelName(l), regname(w)));
}
define_insn(move_int, move_RxR)
@@ -947,7 +947,7 @@
OUT(0xFF);
debug(("cmp #0xFF,%s\n", regname(r)));
- l1 = newLabel();
+ l1 = KaffeJIT3_newLabel();
l1->type = Linternal| Llong8|Lrelative;
OUT(0x74);
l1->at = CODEPC;
@@ -1039,7 +1039,7 @@
OUT(0xFF);
debug(("cmp #0xFF,%s\n", regname(r)));
- l1 = newLabel();
+ l1 = KaffeJIT3_newLabel();
l1->type = Linternal| Llong8|Lrelative;
OUT(0x74);
l1->at = CODEPC;
@@ -1393,7 +1393,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug((".word %s\n", getLabelName(l)));
+ debug((".word %s\n", KaffeJIT3_getLabelName(l)));
}
/* --------------------------------------------------------------------- */
@@ -1416,7 +1416,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jmpl %s\n", getLabelName(l)));
+ debug(("jmpl %s\n", KaffeJIT3_getLabelName(l)));
break;
case beq:
OUT(0x0F);
@@ -1424,7 +1424,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("je %s\n", getLabelName(l)));
+ debug(("je %s\n", KaffeJIT3_getLabelName(l)));
break;
case bne:
OUT(0x0F);
@@ -1432,7 +1432,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jne %s\n", getLabelName(l)));
+ debug(("jne %s\n", KaffeJIT3_getLabelName(l)));
break;
case blt:
OUT(0x0F);
@@ -1440,7 +1440,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jlt %s\n", getLabelName(l)));
+ debug(("jlt %s\n", KaffeJIT3_getLabelName(l)));
break;
case ble:
OUT(0x0F);
@@ -1448,7 +1448,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jle %s\n", getLabelName(l)));
+ debug(("jle %s\n", KaffeJIT3_getLabelName(l)));
break;
case bgt:
OUT(0x0F);
@@ -1456,7 +1456,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jgt %s\n", getLabelName(l)));
+ debug(("jgt %s\n", KaffeJIT3_getLabelName(l)));
break;
case bge:
OUT(0x0F);
@@ -1464,7 +1464,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jge %s\n", getLabelName(l)));
+ debug(("jge %s\n", KaffeJIT3_getLabelName(l)));
break;
case bult:
OUT(0x0F);
@@ -1472,7 +1472,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jult %s\n", getLabelName(l)));
+ debug(("jult %s\n", KaffeJIT3_getLabelName(l)));
break;
#if 0
case bule:
@@ -1481,7 +1481,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jule %s\n", getLabelName(l)));
+ debug(("jule %s\n", KaffeJIT3_getLabelName(l)));
break;
#endif
case bugt:
@@ -1490,7 +1490,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("jugt %s\n", getLabelName(l)));
+ debug(("jugt %s\n", KaffeJIT3_getLabelName(l)));
break;
case buge:
OUT(0x0F);
@@ -1498,7 +1498,7 @@
l->at = CODEPC;
LOUT(0);
l->from = CODEPC;
- debug(("juge %s\n", getLabelName(l)));
+ debug(("juge %s\n", KaffeJIT3_getLabelName(l)));
break;
default:
ABORT();
Index: kaffe/config/powerpc/jit3-powerpc.def
diff -u kaffe/config/powerpc/jit3-powerpc.def:1.2 kaffe/config/powerpc/jit3-powerpc.def:1.3
--- kaffe/config/powerpc/jit3-powerpc.def:1.2 Tue Dec 21 00:15:28 2004
+++ kaffe/config/powerpc/jit3-powerpc.def Mon Dec 27 16:09:45 2004
@@ -111,11 +111,11 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Labsolute | Lgeneral;
l->at = CODEPC;
l->to = 0;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lreg_s | Labsolute | Lgeneral;
l->at = CODEPC;
LOUT(ppc_op_stmw(0, PPC_RSP, 0));
@@ -275,7 +275,7 @@
{
#if 1
#elif 1
- label *l = newLabel();
+ label *l = KaffeJIT3_newLabel();
l->type = Lframe | Labsolute | Lgeneral;
l->at = CODEPC;
@@ -321,7 +321,7 @@
int lrOffset = 0, localRegs;
label *fl;
- fl = newLabel();
+ fl = KaffeJIT3_newLabel();
fl->type = Lframe | Lrelative | Lgeneral;
fl->at = CODEPC;
fl->from = PPC_FRAME_LR;
@@ -334,7 +334,7 @@
* we readjust the stack pointer.
*/
LOUT(ppc_op_lwz(PPC_R0, PPC_RSP, lrOffset));
- fl = newLabel();
+ fl = KaffeJIT3_newLabel();
fl->type = Lframe | Labsolute | Lgeneral;
fl->at = (uintp)CODEPC;
LOUT(ppc_op_addi(PPC_RSP, PPC_RSP, 0));
@@ -349,11 +349,11 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Labsolute | Lgeneral;
l->at = CODEPC;
l->to = 0;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lreg_s | Labsolute | Lgeneral;
l->at = CODEPC;
LOUT(ppc_op_lmw(0, PPC_RSP, 0));
@@ -395,7 +395,7 @@
int o = const_int(1);
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Llong16noalign | Lexternal | Labsolute;
l->at = CODEPC;
l->to = o;
@@ -416,7 +416,7 @@
int o = const_int(1);
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Llong16noalign | Lexternal | Labsolute;
l->at = CODEPC;
l->to = o;
@@ -431,7 +431,7 @@
int o = const_int(1);
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Llong16noalign | Lexternal | Labsolute;
l->at = CODEPC;
l->to = o;
@@ -447,7 +447,7 @@
int o = const_int(1);
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Llong16noalign | Lexternal | Labsolute;
l->at = CODEPC;
l->to = o;
@@ -463,7 +463,7 @@
int o = const_int(1);
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Llong16noalign | Lexternal | Labsolute;
l->at = CODEPC;
l->to = o;
@@ -478,7 +478,7 @@
int o = const_int(1);
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Llong16noalign | Lexternal | Labsolute;
l->at = CODEPC;
l->to = o;
@@ -1352,7 +1352,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -8;
l->to = 0;
@@ -1367,7 +1367,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -4;
l->to = 0;
@@ -1385,7 +1385,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -8;
l->to = 0;
@@ -1421,7 +1421,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -8;
l->to = 0;
@@ -1434,7 +1434,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -4;
l->to = 0;
@@ -1448,7 +1448,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -8;
l->to = 0;
@@ -1490,7 +1490,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -8;
l->to = 0;
@@ -1505,7 +1505,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -4;
l->to = 0;
@@ -1542,7 +1542,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -8;
l->to = 0;
@@ -1557,7 +1557,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT3_newLabel();
l->type = Lsavedregs | Lrelative | Lgeneral;
l->from = -4;
l->to = 0;
@@ -1761,7 +1761,7 @@
{
label *sl, *l = const_label(1);
- sl = newLabel();
+ sl = KaffeJIT3_newLabel();
sl->type = Lframe | Lrelative | Lgeneral;
sl->at = CODEPC;
sl->from = -72;
@@ -1777,7 +1777,7 @@
define_insn(call, call_xRC)
{
- label *l = newLabel();
+ label *l = KaffeJIT3_newLabel();
int r = rreg_int(1);
assert(const_int(2) == ba);
@@ -1794,7 +1794,7 @@
define_insn(branch_indirect, branch_indirect_xRC)
{
- label *l = newLabel();
+ label *l = KaffeJIT3_newLabel();
int r = rreg_int(1);
assert(const_int(2) == ba);
Index: kaffe/kaffe/kaffevm/debug.c
diff -u kaffe/kaffe/kaffevm/debug.c:1.59 kaffe/kaffe/kaffevm/debug.c:1.60
--- kaffe/kaffe/kaffevm/debug.c:1.59 Sun Dec 19 06:25:07 2004
+++ kaffe/kaffe/kaffevm/debug.c Mon Dec 27 16:09:46 2004
@@ -421,9 +421,10 @@
*/
max = 0;
while (max < n) {
- rc = KWRITE(kaffe_dprintf_fd,
+ w = write(kaffe_dprintf_fd,
debugBuffer + max,
- (size_t)n - max,&w);
+ (size_t)n - max);
+ rc = errno;
if (w >= 0)
/* ignore errors */
Index: kaffe/kaffe/kaffevm/jit/constpool.c
diff -u kaffe/kaffe/kaffevm/jit/constpool.c:1.5 kaffe/kaffe/kaffevm/jit/constpool.c:1.6
--- kaffe/kaffe/kaffevm/jit/constpool.c:1.5 Tue Jul 6 17:16:18 2004
+++ kaffe/kaffe/kaffevm/jit/constpool.c Mon Dec 27 16:09:46 2004
@@ -21,16 +21,16 @@
#include <stdarg.h>
-constpool* firstConst;
-constpool* lastConst;
-constpool* currConst;
-uint32 nConst;
+static constpool* firstConst;
+static constpool* lastConst;
+static constpool* currConst;
+static uint32 nConst;
/*
* Allocate a new constant.
*/
constpool*
-newConstant(int type, ...)
+KaffeJIT_newConstant(int type, ...)
{
constpool *c;
union _constpoolval val;
@@ -101,7 +101,7 @@
}
void
-establishConstants(void *at)
+KaffeJIT_establishConstants(void *at)
{
constpool *c;
@@ -113,8 +113,14 @@
}
void
-resetConstants (void)
+KaffeJIT_resetConstants (void)
{
currConst = firstConst;
nConst = 0;
+}
+
+uint32
+KaffeJIT_getNumberOfConstants(void)
+{
+ return nConst;
}
Index: kaffe/kaffe/kaffevm/jit/constpool.h
diff -u kaffe/kaffe/kaffevm/jit/constpool.h:1.2 kaffe/kaffe/kaffevm/jit/constpool.h:1.3
--- kaffe/kaffe/kaffevm/jit/constpool.h:1.2 Sun Jun 27 12:08:36 2004
+++ kaffe/kaffe/kaffevm/jit/constpool.h Mon Dec 27 16:09:46 2004
@@ -32,13 +32,9 @@
#define ALLOCCONSTNR 32
-extern constpool* firstConst;
-extern constpool* lastConst;
-extern constpool* currConst;
-extern uint32 nConst;
-
-constpool* newConstant(int type, ...);
-void establishConstants(void *at);
-void resetConstants(void);
+constpool* KaffeJIT_newConstant(int type, ...);
+void KaffeJIT_establishConstants(void *at);
+void KaffeJIT_resetConstants(void);
+uint32 KaffeJIT_getNumberOfConstants(void);
#endif
Index: kaffe/kaffe/kaffevm/jit/funcs.c
diff -u kaffe/kaffe/kaffevm/jit/funcs.c:1.7 kaffe/kaffe/kaffevm/jit/funcs.c:1.8
--- kaffe/kaffe/kaffevm/jit/funcs.c:1.7 Mon Dec 20 04:23:35 2004
+++ kaffe/kaffe/kaffevm/jit/funcs.c Mon Dec 27 16:09:46 2004
@@ -43,7 +43,7 @@
{
label *il, *curr = NULL;
- while( (il = getInternalLabel(&curr, CODEPC)) )
+ while( (il = KaffeJIT_getInternalLabel(&curr, CODEPC)) )
{
kaffe_dprintf("%s:\n", il->name);
}
Index: kaffe/kaffe/kaffevm/jit/icode.c
diff -u kaffe/kaffe/kaffevm/jit/icode.c:1.32 kaffe/kaffe/kaffevm/jit/icode.c:1.33
--- kaffe/kaffe/kaffevm/jit/icode.c:1.32 Mon Dec 20 00:55:14 2004
+++ kaffe/kaffe/kaffevm/jit/icode.c Mon Dec 27 16:09:46 2004
@@ -194,7 +194,7 @@
used_ieee_rounding = false;
used_ieee_division = false;
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lnull;
l->at = 0;
l->to = 0;
@@ -209,7 +209,7 @@
{
label* l;
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lnull;
l->at = 0;
l->to = 0;
@@ -230,7 +230,7 @@
{
label *l;
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->at = 0;
l->to = 0;
l->from = 0;
@@ -372,8 +372,8 @@
label* l;
SlotInfo* tmp;
- c = newConstant(CPint, val);
- l = newLabel();
+ c = KaffeJIT_newConstant(CPint, val);
+ l = KaffeJIT_newLabel();
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -400,8 +400,8 @@
label* l;
SlotInfo* tmp;
- c = newConstant(CPref, val);
- l = newLabel();
+ c = KaffeJIT_newConstant(CPref, val);
+ l = KaffeJIT_newLabel();
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -424,8 +424,8 @@
constpool *c;
SlotInfo* tmp;
- c = newConstant(CPstring, val);
- l = newLabel();
+ c = KaffeJIT_newConstant(CPstring, val);
+ l = KaffeJIT_newLabel();
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -450,8 +450,8 @@
label* l;
SlotInfo* tmp;
- c = newConstant(CPlong, val);
- l = newLabel();
+ c = KaffeJIT_newConstant(CPlong, val);
+ l = KaffeJIT_newLabel();
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -482,8 +482,8 @@
label* l;
SlotInfo* tmp;
- c = newConstant(CPfloat, val);
- l = newLabel();
+ c = KaffeJIT_newConstant(CPfloat, val);
+ l = KaffeJIT_newLabel();
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -510,8 +510,8 @@
label* l;
SlotInfo* tmp;
- c = newConstant(CPdouble, val);
- l = newLabel();
+ c = KaffeJIT_newConstant(CPdouble, val);
+ l = KaffeJIT_newLabel();
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -2590,7 +2590,7 @@
call_soft(void *routine)
{
#if defined(HAVE_call_soft)
- label* l = newLabel();
+ label* l = KaffeJIT_newLabel();
l->type = Labsolute|Lexternal|Lnoprofile;
l->at = 0;
l->to = (uintp)routine; /* What place does it goto */
@@ -2599,7 +2599,7 @@
slot_const_const(0, (jword)l, ba, HAVE_call_soft, Tnull);
#elif defined(HAVE_call_ref)
label* l;
- l = newLabel();
+ l = KaffeJIT_newLabel();
l->type = Lexternal|Lnoprofile;
l->at = 0;
l->to = (uintp)routine; /* What place does it goto */
@@ -2611,8 +2611,8 @@
constpool* c;
SlotInfo* tmp;
- l = newLabel();
- c = newConstant(CPref, routine);
+ l = KaffeJIT_newLabel();
+ c = KaffeJIT_newConstant(CPref, routine);
l->type = Lconstant;
l->at = 0;
l->to = (uintp)c;
@@ -2719,7 +2719,7 @@
assert(n < MAXLABTAB);
if (labtab[n] == 0) {
- l = newLabel();
+ l = KaffeJIT_newLabel();
labtab[n] = l;
l->type = Lnull;
l->at = 0;
@@ -2736,7 +2736,7 @@
label*
reference_code_label(uintp offset)
{
- label* l = newLabel();
+ label* l = KaffeJIT_newLabel();
l->at = 0; /* Where is the jump */
l->to = offset; /* What place does it goto */
l->from = 0;
@@ -2751,7 +2751,7 @@
assert(n < MAXLABTAB);
if (labtab[n] == 0) {
- l = newLabel();
+ l = KaffeJIT_newLabel();
labtab[n] = l;
l->type = Lnull;
l->at = 0;
@@ -2783,7 +2783,7 @@
{
assert(n < MAXLABTAB);
if (labtab[n] == 0) {
- labtab[n] = newLabel();
+ labtab[n] = KaffeJIT_newLabel();
labtab[n]->type = Linternal;
labtab[n]->at = 0;
labtab[n]->from = 0;
Index: kaffe/kaffe/kaffevm/jit/labels.c
diff -u kaffe/kaffe/kaffevm/jit/labels.c:1.12 kaffe/kaffe/kaffevm/jit/labels.c:1.13
--- kaffe/kaffe/kaffevm/jit/labels.c:1.12 Mon Dec 20 00:55:14 2004
+++ kaffe/kaffe/kaffevm/jit/labels.c Mon Dec 27 16:09:47 2004
@@ -26,16 +26,16 @@
#include "machine.h"
#include "stats.h"
-label* firstLabel;
-label* lastLabel;
-label* currLabel;
+static label* firstLabel;
+static label* lastLabel;
+static label* currLabel;
#if defined(KAFFE_VMDEBUG)
static uint32 labelCount;
#endif
void
-resetLabels(void)
+KaffeJIT_resetLabels(void)
{
currLabel = firstLabel;
}
@@ -45,7 +45,7 @@
* Set epilogue label destination.
*/
void
-setEpilogueLabel(uintp to)
+KaffeJIT_setEpilogueLabel(uintp to)
{
label* l;
@@ -64,7 +64,7 @@
* fragment into the program.
*/
void
-linkLabels(codeinfo* codeInfo, uintp codebase)
+KaffeJIT_linkLabels(codeinfo* codeInfo, uintp codebase)
{
long dest = 0;
int* place;
@@ -149,7 +149,7 @@
* Allocate a new label.
*/
label*
-newLabel(void)
+KaffeJIT_newLabel(void)
{
int i;
label* ret = currLabel;
@@ -187,7 +187,7 @@
}
label*
-getInternalLabel(label **lptr, uintp pc)
+KaffeJIT_getInternalLabel(label **lptr, uintp pc)
{
label *curr, *retval = NULL;
Index: kaffe/kaffe/kaffevm/jit/labels.h
diff -u kaffe/kaffe/kaffevm/jit/labels.h:1.5 kaffe/kaffe/kaffevm/jit/labels.h:1.6
--- kaffe/kaffe/kaffevm/jit/labels.h:1.5 Thu Jul 15 14:44:05 2004
+++ kaffe/kaffe/kaffevm/jit/labels.h Mon Dec 27 16:09:47 2004
@@ -54,10 +54,10 @@
#define ALLOCLABELNR 1024
struct codeinfo;
-void setEpilogueLabel(uintp);
-void linkLabels(struct codeinfo*, uintp);
-label* newLabel(void);
-void resetLabels(void);
+void KaffeJIT_setEpilogueLabel(uintp);
+void KaffeJIT_linkLabels(struct codeinfo*, uintp);
+label* KaffeJIT_newLabel(void);
+void KaffeJIT_resetLabels(void);
/**
* Iterate through the method internal labels that refer to the given native
@@ -70,6 +70,6 @@
* @return A label matching the given "pc" or NULL if there are no more
* internal labels found.
*/
-label *getInternalLabel(label **lptr, uintp counter);
+label *KaffeJIT_getInternalLabel(label **lptr, uintp counter);
#endif
Index: kaffe/kaffe/kaffevm/jit/machine.c
diff -u kaffe/kaffe/kaffevm/jit/machine.c:1.73 kaffe/kaffe/kaffevm/jit/machine.c:1.74
--- kaffe/kaffe/kaffevm/jit/machine.c:1.73 Tue Dec 21 22:21:36 2004
+++ kaffe/kaffe/kaffevm/jit/machine.c Mon Dec 27 16:09:47 2004
@@ -458,7 +458,7 @@
generateInsnSequence(codeInfo);
/* Okay, put this into malloc'ed memory */
- constlen = nConst * sizeof(union _constpoolval);
+ constlen = KaffeJIT_getNumberOfConstants() * sizeof(union _constpoolval);
/* Allocate some padding to align codebase if so desired
*/
methblock = gc_malloc(sizeof(jitCodeHeader) + exc_len + constlen + CODEPC + (align ? (align - ALIGNMENT_OF_SIZE(sizeof(jdouble))) : 0), KGC_ALLOC_JITCODE);
@@ -484,10 +484,10 @@
*** Patch too long, truncated ***
More information about the kaffe
mailing list