cvsuser 04/09/22 08:07:46
Modified: classes sub.pmc
src packfile.c
Log:
more sub-related cleanup
* use thawfinish for converting offsets to abs addresses
Revision Changes Path
1.52 +2 -5 parrot/classes/sub.pmc
Index: sub.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/sub.pmc,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -w -r1.51 -r1.52
--- sub.pmc 22 Sep 2004 12:16:41 -0000 1.51
+++ sub.pmc 22 Sep 2004 15:07:45 -0000 1.52
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: sub.pmc,v 1.51 2004/09/22 12:16:41 leo Exp $
+$Id: sub.pmc,v 1.52 2004/09/22 15:07:45 leo Exp $
=head1 NAME
@@ -350,10 +350,7 @@
/* its absolute */
if (PObj_get_FLAGS(SELF) & PObj_private1_FLAG)
return;
- /*
- * XXX actually the sub might be in a different code segment
- */
- code = INTERP->code->cur_cs->base.data;
+ code = sub->seg->base.data;
start_offs = code + (size_t) PMC_struct_val(SELF);
end_offs = code + (size_t) sub->end;
PMC_struct_val(SELF) = start_offs;
1.173 +8 -19 parrot/src/packfile.c
Index: packfile.c
===================================================================
RCS file: /cvs/public/parrot/src/packfile.c,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -w -r1.172 -r1.173
--- packfile.c 8 Sep 2004 00:33:58 -0000 1.172
+++ packfile.c 22 Sep 2004 15:07:46 -0000 1.173
@@ -2,7 +2,7 @@
Copyright (C) 2001-2002 Gregor N. Purdy. All rights reserved.
This program is free software. It is subject to the same license as
Parrot itself.
-$Id: packfile.c,v 1.172 2004/09/08 00:33:58 dan Exp $
+$Id: packfile.c,v 1.173 2004/09/22 15:07:46 leo Exp $
=head1 NAME
@@ -287,8 +287,9 @@
interpreter->resume_offset == 0) {
ptrdiff_t code = (ptrdiff_t) sub->seg->base.data;
- start_offs = ((ptrdiff_t) PMC_struct_val(sub_pmc) - code) /
- sizeof(opcode_t*);
+ start_offs =
+ ((ptrdiff_t) VTABLE_get_pointer(interpreter, sub_pmc)
+ - code) / sizeof(opcode_t*);
interpreter->resume_offset = start_offs;
PObj_get_FLAGS(sub_pmc) &= ~PObj_private4_FLAG;
}
@@ -415,8 +416,6 @@
struct PackFile_FixupTable *ft;
struct PackFile_ConstTable *ct;
PMC *sub_pmc;
- struct Parrot_sub *sub;
- INTVAL rel;
int again = 0;
#if TRACE_PACKFILE
@@ -441,17 +440,7 @@
case enum_class_Sub:
case enum_class_Closure:
case enum_class_Coroutine:
- if (PObj_get_FLAGS(sub_pmc) & PObj_private1_FLAG)
- continue;
- rel = (INTVAL) PMC_struct_val(sub_pmc) *
- sizeof(opcode_t);
- rel += (INTVAL) self->cur_cs->base.data;
- PMC_struct_val(sub_pmc) = (void*) rel;
- sub = PMC_sub(sub_pmc);
- rel = (INTVAL) sub->end * sizeof(opcode_t);
- rel += (INTVAL) self->cur_cs->base.data;
- sub->end = (opcode_t *) rel;
- PObj_get_FLAGS(sub_pmc) |= PObj_private1_FLAG;
+ VTABLE_thawfinish(interpreter, sub_pmc, NULL);
if (PObj_get_FLAGS(sub_pmc) & 0xf0) {
/*
* private4-7 are sub pragmas LOAD ...