cvsuser 03/11/22 04:13:06
Modified: . MANIFEST
t/native_pbc number.t number_1.pbc number_2.pbc
include/parrot packfile.h
src packfile.c pdump.c
Added: t/native_pbc integer.t integer_1.pbc
Log:
PackFile-21
* write intval size into PBC header
* add integer native PBC test
Revision Changes Path
1.507 +2 -0 parrot/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /cvs/public/parrot/MANIFEST,v
retrieving revision 1.506
retrieving revision 1.507
diff -u -w -r1.506 -r1.507
--- MANIFEST 21 Nov 2003 13:49:08 -0000 1.506
+++ MANIFEST 22 Nov 2003 12:12:53 -0000 1.507
@@ -2195,6 +2195,8 @@
src/vtables.c []
src/warnings.c []
t/harness []
+t/native_pbc/integer.t []
+t/native_pbc/integer_1.pbc []
t/native_pbc/number.t []
t/native_pbc/number_1.pbc []
t/native_pbc/number_2.pbc []
1.11 +3 -1 parrot/t/native_pbc/number.t
Index: number.t
===================================================================
RCS file: /cvs/public/parrot/t/native_pbc/number.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -r1.10 -r1.11
--- number.t 24 Oct 2003 09:08:07 -0000 1.10
+++ number.t 22 Nov 2003 12:12:57 -0000 1.11
@@ -29,10 +29,11 @@
# number_1.pbc
# HEADER => [
# wordsize = 4 (interpreter's wordsize = 4)
+# int_size = 4 (interpreter's INTVAL size = 4)
# byteorder = 0 (interpreter's byteorder = 0)
# floattype = 0 (interpreter's NUMVAL_SIZE = 8)
# no endianize, no opcode, no numval transform
-# dirformat = 0
+# dirformat = 1
#] #'
CODE
@@ -68,6 +69,7 @@
# number_2.pbc
#HEADER => [
# wordsize = 4 (interpreter's wordsize = 4)
+# int_size = 4 (interpreter's INTVAL size = 4)
# byteorder = 0 (interpreter's byteorder = 0)
# floattype = 1 (interpreter's NUMVAL_SIZE = 8)
# no endianize, no opcode, **need** numval transform
1.17 +1 -1 parrot/t/native_pbc/number_1.pbc
<<Binary file>>
1.17 +1 -1 parrot/t/native_pbc/number_2.pbc
<<Binary file>>
1.1 parrot/t/native_pbc/integer.t
Index: integer.t
===================================================================
#! perl -w
my $comment = <<'EOC';
s. t/native_pbc/number.t for additional comments
The file is generated by:
$ parrot -o i.pbc -a - <<EOF
> print 0x10203040
> end
> EOF
$ pdump -h i.pbc
$ mv i.pbc t/native_pbc/integer_1.pbc
EOC
use Parrot::Test tests => 1;
output_is(<<CODE, '270544960', "i386 32 bit opcode_t, 32 bit intval");
# integer_1.pbc
# HEADER => [
# wordsize = 4 (interpreter's wordsize = 4)
# int_size = 4 (interpreter's INTVAL size = 4)
# byteorder = 0 (interpreter's byteorder = 0)
# floattype = 0 (interpreter's NUMVAL_SIZE = 8)
# no endianize, no opcode, no numval transform
# dirformat = 1
#] #'
CODE
1.1 parrot/t/native_pbc/integer_1.pbc
<<Binary file>>
1.54 +3 -4 parrot/include/parrot/packfile.h
Index: packfile.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/packfile.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -w -r1.53 -r1.54
--- packfile.h 22 Nov 2003 11:19:59 -0000 1.53
+++ packfile.h 22 Nov 2003 12:13:02 -0000 1.54
@@ -1,6 +1,6 @@
/* packfile.h
*
-* $Id: packfile.h,v 1.53 2003/11/22 11:19:59 leo Exp $
+* $Id: packfile.h,v 1.54 2003/11/22 12:13:02 leo Exp $
*
* History:
* Rework by Melvin; new bytecode format, make bytecode portable.
@@ -36,15 +36,14 @@
unsigned char byteorder;
unsigned char major;
unsigned char minor;
- unsigned char flags;
+ unsigned char intvalsize; /* was flags */
unsigned char floattype;
unsigned char pad[10]; /* fingerprint */
/* Start words/opcodes on 16-byte boundary */
opcode_t magic;
opcode_t opcodetype;
opcode_t dir_format; /* was fixup_ss */
- opcode_t _unused_const_ss; /* old format data */
- opcode_t _unused_bytecode_ss;
+ opcode_t _unused_padding;
};
/*
1.123 +3 -3 parrot/src/packfile.c
Index: packfile.c
===================================================================
RCS file: /cvs/public/parrot/src/packfile.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -w -r1.122 -r1.123
--- packfile.c 22 Nov 2003 11:20:13 -0000 1.122
+++ packfile.c 22 Nov 2003 12:13:05 -0000 1.123
@@ -7,7 +7,7 @@
** This program is free software. It is subject to the same
** license as Parrot itself.
**
-** $Id: packfile.c,v 1.122 2003/11/22 11:20:13 leo Exp $
+** $Id: packfile.c,v 1.123 2003/11/22 12:13:05 leo Exp $
**
** History:
** Rework by Melvin; new bytecode format, make bytecode portable.
@@ -183,7 +183,7 @@
byte byteorder
byte major
byte minor
- byte flags
+ byte intvalsize
byte floattype
byte pad[10] = fingerprint
@@ -562,7 +562,7 @@
self->header->major = PARROT_MAJOR_VERSION;
/* XXX during development, we check PATCH_LEVEL too */
self->header->minor = PARROT_MINOR_VERSION | PARROT_PATCH_VERSION;
- self->header->flags = 0;
+ self->header->intvalsize = sizeof(INTVAL);
if (NUMVAL_SIZE == 8)
self->header->floattype = 0;
else /* if XXX */
1.30 +4 -1 parrot/src/pdump.c
Index: pdump.c
===================================================================
RCS file: /cvs/public/parrot/src/pdump.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- pdump.c 23 Oct 2003 17:48:59 -0000 1.29
+++ pdump.c 22 Nov 2003 12:13:05 -0000 1.30
@@ -1,7 +1,7 @@
/* pdump.c
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: pdump.c,v 1.29 2003/10/23 17:48:59 robert Exp $
+ * $Id: pdump.c,v 1.30 2003/11/22 12:13:05 leo Exp $
* Overview:
* A program to dump pack files to human readable form.
* Data Structure and Algorithms:
@@ -60,6 +60,9 @@
PIO_printf(interpreter, "\twordsize = %d", pf->header->wordsize);
PIO_printf(interpreter, "\t(interpreter's wordsize = %d)\n",
sizeof(opcode_t));
+ PIO_printf(interpreter, "\tint_size = %d", pf->header->intvalsize);
+ PIO_printf(interpreter, "\t(interpreter's INTVAL size = %d)\n",
+ sizeof(INTVAL));
PIO_printf(interpreter, "\tbyteorder = %d", pf->header->byteorder);
PIO_printf(interpreter, "\t(interpreter's byteorder = %d)\n",
PARROT_BIGENDIAN);