Re: [PATCH] Updated DO_OP patch
Simon -- > What's an IV? That was a slip of the keyboard. The C-based disassembler is (as is now obvious) not ready for prime time. I've moved it to its own sandbox (since it doesn't have anything to do with the doop patch anyway). Here's an updated patch: Regards, -- Gregor _ / perl -e 'srand(-2091643526); print chr rand 90 for (0..4)' \ Gregor N. Purdy [EMAIL PROTECTED] Focus Research, Inc.http://www.focusresearch.com/ 8080 Beckett Center Drive #203 513-860-3570 vox West Chester, OH 45069 513-860-3579 fax \_/ ? doop.patch ? t/inc.pasm ? t/jumpoob.pasm ? t/jumpsub.pasm ? t/substr.pasm ? t/jump2.pasm ? t/jump3.pasm ? t/jump4.pasm ? t/runoob.pasm Index: .cvsignore === RCS file: /home/perlcvs/parrot/.cvsignore,v retrieving revision 1.4 diff -a -u -r1.4 .cvsignore --- .cvsignore 2001/09/19 16:48:28 1.4 +++ .cvsignore 2001/10/03 14:14:35 @@ -1,5 +1,8 @@ basic_opcodes.c -test_prog -pdump +interp_guts.c Makefile +op_info.c Parrot/ +pdisasm +pdump +test_prog Index: Makefile.in === RCS file: /home/perlcvs/parrot/Makefile.in,v retrieving revision 1.15 diff -a -u -r1.15 Makefile.in --- Makefile.in 2001/10/01 22:00:23 1.15 +++ Makefile.in 2001/10/03 14:14:36 @@ -29,21 +29,21 @@ libparrot.so: $(O_FILES) $(CC) -shared $(C_LIBS) -o $@ $(O_FILES) -$(TEST_PROG): test_main$(O) $(O_FILES) - $(CC) $(CFLAGS) -o $(TEST_PROG) $(O_FILES) test_main$(O) $(C_LIBS) +$(TEST_PROG): test_main$(O) $(O_FILES) interp_guts$(O) op_info$(O) + $(CC) $(CFLAGS) -o $(TEST_PROG) $(O_FILES) interp_guts$(O) op_info$(O) +test_main$(O) $(C_LIBS) + +$(PDUMP): pdump$(O) packfile$(O) memory$(O) global_setup$(O) string$(O) strnative$(O) + $(CC) $(CFLAGS) -o $(PDUMP) pdump$(O) packfile$(O) memory$(O) global_setup$(O) +string$(O) strnative$(O) $(C_LIBS) -$(PDUMP): pdump$(O) $(O_FILES) - $(CC) $(CFLAGS) -o $(PDUMP) $(O_FILES) pdump$(O) $(C_LIBS) +test_main$(O): $(H_FILES) $(INC)/interp_guts.h -test_main$(O): $(H_FILES) - global_setup$(O): $(H_FILES) string$(O): $(H_FILES) strnative$(O): $(H_FILES) -$(INC)/interp_guts.h: opcode_table build_interp_starter.pl +$(INC)/interp_guts.h interp_guts.c $(INC)/op_info.h op_info.c: opcode_table +build_interp_starter.pl $(PERL) build_interp_starter.pl interpreter$(O): interpreter.c $(H_FILES) $(INC)/interp_guts.h @@ -68,7 +68,7 @@ $(PERL) Configure.pl clean: - $(RM_F) *$(O) *.s basic_opcodes.c $(INC)/interp_guts.h $(INC)/op.h $(TEST_PROG) + $(RM_F) *$(O) *.s basic_opcodes.c interp_guts.c $(INC)/interp_guts.h +$(INC)/op.h op_info.c $(INC)op_info.h $(TEST_PROG) $(PDISASM) $(PDUMP) test: $(PERL) t/harness Index: build_interp_starter.pl === RCS file: /home/perlcvs/parrot/build_interp_starter.pl,v retrieving revision 1.12 diff -a -u -r1.12 build_interp_starter.pl --- build_interp_starter.pl 2001/09/24 17:19:47 1.12 +++ build_interp_starter.pl 2001/10/03 14:14:36 @@ -1,10 +1,23 @@ # !/usr/bin/perl -w +# +# build_interp_starter.pl +# +# $Id: $ +# + use strict; use Parrot::Opcode; + +my %opcodes= Parrot::Opcode::read_ops(); +my $opcode_fingerprint = Parrot::Opcode::fingerprint(); + +open INTERP_GUTS_H, "> include/parrot/interp_guts.h" or die "Can't open +include/parrot/interp_guts.h, $!/$^E"; +open INTERP_GUTS_C, "> interp_guts.c" or die "Can't open interp_guts.c, $!/$^E"; -open INTERP, "> include/parrot/interp_guts.h" or die "Can't open include/parrot/interp_guts.h, $!/$^E"; +open OP_INFO_H, "> include/parrot/op_info.h" or die "Can't open +include/parrot/op_info.h, $!/$^E"; +open OP_INFO_C, "> op_info.c" or die "Can't open op_info.c, $!/$^E"; -print INTERP$opcodes{$b}{CODE}} keys %opcodes) { -print INTERP "\tx[$opcodes{$name}{CODE}] = $name; \\\n"; -} -print INTERP "} while (0);\n"; +### +print OP_INFO_H < $opcodes{$b}{CODE}} keys %opcodes) { -print INTERP "\tx[$opcodes{$name}{CODE}] = \"$name\"; \\\n"; -} -print INTERP "} while (0);\n"; +### +print INTERP_GUTS_C < $opcodes{$b}{CODE}} keys %opcodes) { -print INTERP "\tx[$opcodes{$name}{CODE}] = $opcodes{$name}{ARGS}; \
Re: [PATCH] Updated DO_OP patch
On Wed, Oct 03, 2001 at 08:26:07AM -0400, Gregor N. Purdy wrote: > +IV byte_code_size; > +char * byte_code; > +char * byte_code_end; > +char * cursor; > +IV * iv_ptr; > +NV * nv_ptr; What's an IV? -- "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." -- Howard Aiken
[PATCH] Updated DO_OP patch
All -- I've updated the simplified DO_OP patch to work with the latest out of CVS. Regards, -- Gregor _ / perl -e 'srand(-2091643526); print chr rand 90 for (0..4)' \ Gregor N. Purdy [EMAIL PROTECTED] Focus Research, Inc.http://www.focusresearch.com/ 8080 Beckett Center Drive #203 513-860-3570 vox West Chester, OH 45069 513-860-3579 fax \_/ ? doop.patch ? t/inc.pasm ? t/jumpoob.pasm ? t/jumpsub.pasm ? t/substr.pasm ? t/jump2.pasm ? t/jump3.pasm ? t/jump4.pasm ? t/runoob.pasm Index: .cvsignore === RCS file: /home/perlcvs/parrot/.cvsignore,v retrieving revision 1.4 diff -a -u -r1.4 .cvsignore --- .cvsignore 2001/09/19 16:48:28 1.4 +++ .cvsignore 2001/10/03 12:24:52 @@ -1,5 +1,8 @@ basic_opcodes.c -test_prog -pdump +interp_guts.c Makefile +op_info.c Parrot/ +pdisasm +pdump +test_prog Index: MANIFEST === RCS file: /home/perlcvs/parrot/MANIFEST,v retrieving revision 1.23 diff -a -u -r1.23 MANIFEST --- MANIFEST2001/09/30 20:25:22 1.23 +++ MANIFEST2001/10/03 12:24:52 @@ -53,6 +53,7 @@ opcode_table packfile.c parrot.c +pdisasm.c pdump.c process_opfunc.pl register.c Index: Makefile.in === RCS file: /home/perlcvs/parrot/Makefile.in,v retrieving revision 1.15 diff -a -u -r1.15 Makefile.in --- Makefile.in 2001/10/01 22:00:23 1.15 +++ Makefile.in 2001/10/03 12:24:52 @@ -18,24 +18,28 @@ PERL = ${perl} TEST_PROG = test_prog${exe} PDUMP = pdump${exe} +PDISASM = pdisasm${exe} .c$(O): $(CC) $(CFLAGS) -o $@ -c $< -all : $(TEST_PROG) $(PDUMP) +all : $(TEST_PROG) $(PDUMP) $(PDISASM) #XXX This target is not portable to Win32 shared: libparrot.so libparrot.so: $(O_FILES) $(CC) -shared $(C_LIBS) -o $@ $(O_FILES) -$(TEST_PROG): test_main$(O) $(O_FILES) - $(CC) $(CFLAGS) -o $(TEST_PROG) $(O_FILES) test_main$(O) $(C_LIBS) +$(TEST_PROG): test_main$(O) $(O_FILES) interp_guts$(O) op_info$(O) + $(CC) $(CFLAGS) -o $(TEST_PROG) $(O_FILES) interp_guts$(O) op_info$(O) +test_main$(O) $(C_LIBS) -$(PDUMP): pdump$(O) $(O_FILES) - $(CC) $(CFLAGS) -o $(PDUMP) $(O_FILES) pdump$(O) $(C_LIBS) +$(PDISASM): pdisasm$(O) op_info$(O) packfile$(O) memory$(O) global_setup$(O) +string$(O) strnative$(O) + $(CC) $(CFLAGS) -o $(PDISASM) pdisasm$(O) op_info$(O) packfile$(O) memory$(O) +global_setup$(O) string$(O) strnative$(O) $(C_LIBS) + +$(PDUMP): pdump$(O) packfile$(O) memory$(O) global_setup$(O) string$(O) strnative$(O) + $(CC) $(CFLAGS) -o $(PDUMP) pdump$(O) packfile$(O) memory$(O) global_setup$(O) +string$(O) strnative$(O) $(C_LIBS) -test_main$(O): $(H_FILES) +test_main$(O): $(H_FILES) $(INC)/interp_guts.h global_setup$(O): $(H_FILES) @@ -43,7 +47,7 @@ strnative$(O): $(H_FILES) -$(INC)/interp_guts.h: opcode_table build_interp_starter.pl +$(INC)/interp_guts.h interp_guts.c $(INC)/op_info.h op_info.c: opcode_table +build_interp_starter.pl $(PERL) build_interp_starter.pl interpreter$(O): interpreter.c $(H_FILES) $(INC)/interp_guts.h @@ -68,7 +72,7 @@ $(PERL) Configure.pl clean: - $(RM_F) *$(O) *.s basic_opcodes.c $(INC)/interp_guts.h $(INC)/op.h $(TEST_PROG) + $(RM_F) *$(O) *.s basic_opcodes.c interp_guts.c $(INC)/interp_guts.h +$(INC)/op.h op_info.c $(INC)op_info.h $(TEST_PROG) $(PDISASM) $(PDUMP) test: $(PERL) t/harness Index: build_interp_starter.pl === RCS file: /home/perlcvs/parrot/build_interp_starter.pl,v retrieving revision 1.12 diff -a -u -r1.12 build_interp_starter.pl --- build_interp_starter.pl 2001/09/24 17:19:47 1.12 +++ build_interp_starter.pl 2001/10/03 12:24:52 @@ -1,10 +1,23 @@ # !/usr/bin/perl -w +# +# build_interp_starter.pl +# +# $Id: $ +# + use strict; use Parrot::Opcode; + +my %opcodes= Parrot::Opcode::read_ops(); +my $opcode_fingerprint = Parrot::Opcode::fingerprint(); + +open INTERP_GUTS_H, "> include/parrot/interp_guts.h" or die "Can't open +include/parrot/interp_guts.h, $!/$^E"; +open INTERP_GUTS_C, "> interp_guts.c" or die "Can't open interp_guts.c, $!/$^E"; -open INTERP, "> include/parrot/interp_guts.h" or die "Can't open include/parrot/interp_guts.h, $!/$^E"; +open OP_INFO_H, "> include/parrot/op_info.h" or die "Can't open +include/parrot/op_info.h, $!/$^E"; +open OP_INFO_C, "> op_info.c" or die "Can't open op_info.c, $!/$^E"; -print INTERP