Index: src/ops/set.ops =================================================================== --- src/ops/set.ops (revision 40530) +++ src/ops/set.ops (revision 40667) @@ -509,8 +509,9 @@ /* don't let the clone's destruction destroy the destination's data */ PObj_active_destroy_CLEAR(clone); - if (PObj_is_PMC_EXT_TEST(clone)) - clone->pmc_ext = NULL; + PMC_metadata(clone) = NULL; + PMC_next_for_GC(clone) = NULL; + PMC_sync(clone) = NULL; /* Restore metadata. */ if (!PMC_IS_NULL(meta)) { Index: src/ops/string.ops =================================================================== --- src/ops/string.ops (revision 40530) +++ src/ops/string.ops (revision 40667) @@ -392,7 +392,7 @@ $1 = PTR2UINTVAL($2->strstart); break; case STRINGINFO_BUFLEN: - $1 = PObj_buflen($2); + $1 = Buffer_buflen($2); break; case STRINGINFO_FLAGS: $1 = PObj_get_FLAGS($2); Index: src/debug.c =================================================================== --- src/debug.c (revision 40530) +++ src/debug.c (revision 40667) @@ -3371,12 +3371,12 @@ if (!s) return; - Parrot_io_eprintf(interp, "\tBuflen =\t%12ld\n", PObj_buflen(s)); + Parrot_io_eprintf(interp, "\tBuflen =\t%12ld\n", Buffer_buflen(s)); Parrot_io_eprintf(interp, "\tFlags =\t%12ld\n", PObj_get_FLAGS(s)); Parrot_io_eprintf(interp, "\tBufused =\t%12ld\n", s->bufused); Parrot_io_eprintf(interp, "\tStrlen =\t%12ld\n", s->strlen); Parrot_io_eprintf(interp, "\tOffset =\t%12ld\n", - (char*) s->strstart - (char*) PObj_bufstart(s)); + (char*) s->strstart - (char*) Buffer_bufstart(s)); Parrot_io_eprintf(interp, "\tString =\t%S\n", s); } Index: src/gc/incremental_ms.c =================================================================== --- src/gc/incremental_ms.c (revision 40530) +++ src/gc/incremental_ms.c (revision 40667) @@ -519,7 +519,7 @@ { ASSERT_ARGS(gc_ims_add_free_object) *(void **)to_add = pool->free_list; - pool->free_list = to_add; + pool->free_list = (GC_MS_PObj_Wrapper*)to_add; #if DISABLE_GC_DEBUG UNUSED(interp); #else @@ -561,7 +561,7 @@ (*pool->alloc_objects) (interp, pool); ptr = (PObj *)pool->free_list; - pool->free_list = *(void **)ptr; + pool->free_list = (GC_MS_PObj_Wrapper*)(*(void **)ptr); /* * buffers are born black, PMCs not yet? @@ -829,7 +829,6 @@ g_ims->state = GC_IMS_COLLECT; g_ims->n_objects = n_objects; - g_ims->n_extended_PMCs = arena_base->num_extended_PMCs; } Index: src/gc/alloc_resources.c =================================================================== --- src/gc/alloc_resources.c (revision 40530) +++ src/gc/alloc_resources.c (revision 40667) @@ -54,8 +54,19 @@ __attribute__nonnull__(1) __attribute__nonnull__(2); -static void debug_print_buf(PARROT_INTERP, ARGIN(const PObj *b)) +static void check_memory_pool(ARGMOD(Memory_Pool *pool)) __attribute__nonnull__(1) + FUNC_MODIFIES(*pool); + +static void check_memory_system(PARROT_INTERP) + __attribute__nonnull__(1); + +static void check_small_object_pool(ARGMOD(Small_Object_Pool * pool)) + __attribute__nonnull__(1) + FUNC_MODIFIES(* pool); + +static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b)) + __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_MALLOC @@ -71,6 +82,12 @@ #define ASSERT_ARGS_buffer_location __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(b) +#define ASSERT_ARGS_check_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ + PARROT_ASSERT_ARG(pool) +#define ASSERT_ARGS_check_memory_system __attribute__unused__ int _ASSERT_ARGS_CHECK = \ + PARROT_ASSERT_ARG(interp) +#define ASSERT_ARGS_check_small_object_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ + PARROT_ASSERT_ARG(pool) #define ASSERT_ARGS_debug_print_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(b) @@ -277,7 +294,7 @@ /* -=item C +=item C Prints a debug statement with information about the given PObj C. =cut @@ -285,11 +302,11 @@ */ static void -debug_print_buf(PARROT_INTERP, ARGIN(const PObj *b)) +debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b)) { ASSERT_ARGS(debug_print_buf) fprintf(stderr, "found %p, len %d, flags 0x%08x at %s\n", - b, (int)PObj_buflen(b), (uint)PObj_get_FLAGS(b), + b, (int)Buffer_buflen(b), (uint)PObj_get_FLAGS(b), buffer_location(interp, b)); } #endif @@ -407,21 +424,21 @@ INTVAL *ref_count = NULL; /* ! (on_free_list | constant | external | sysmem) */ - if (PObj_buflen(b) && PObj_is_movable_TESTALL(b)) { + if (Buffer_buflen(b) && PObj_is_movable_TESTALL(b)) { ptrdiff_t offset = 0; #if RESOURCE_DEBUG - if (PObj_buflen(b) >= RESOURCE_DEBUG_SIZE) + if (Buffer_buflen(b) >= RESOURCE_DEBUG_SIZE) debug_print_buf(interp, b); #endif /* we can't perform the math all the time, because * strstart might be in unallocated memory */ if (PObj_is_COWable_TEST(b)) { - ref_count = PObj_bufrefcountptr(b); + ref_count = Buffer_bufrefcountptr(b); if (PObj_is_string_TEST(b)) { offset = (ptrdiff_t)((STRING *)b)->strstart - - (ptrdiff_t)PObj_bufstart(b); + (ptrdiff_t)Buffer_bufstart(b); } } @@ -429,8 +446,9 @@ if (PObj_COW_TEST(b) && (ref_count && *ref_count & Buffer_moved_FLAG)) { /* Find out who else references our data */ - Buffer * const hdr = *(Buffer **)(PObj_bufstart(b)); + Buffer * const hdr = *((Buffer **)Buffer_bufstart(b)); + PARROT_ASSERT(PObj_is_COWable_TEST(b)); /* Make sure they know that we own it too */ @@ -438,13 +456,13 @@ /* TODO incr ref_count, after fixing string too * Now make sure we point to where the other guy does */ - PObj_bufstart(b) = PObj_bufstart(hdr); + Buffer_bufstart(b) = Buffer_bufstart(hdr); /* And if we're a string, update strstart */ /* Somewhat of a hack, but if we get per-pool * collections, it should help ease the pain */ if (PObj_is_string_TEST(b)) { - ((STRING *)b)->strstart = (char *)PObj_bufstart(b) + + ((STRING *)b)->strstart = (char *)Buffer_bufstart(b) + offset; } } @@ -457,14 +475,14 @@ } /* Copy our memory to the new pool */ - memcpy(cur_spot, PObj_bufstart(b), PObj_buflen(b)); + memcpy(cur_spot, Buffer_bufstart(b), Buffer_buflen(b)); /* If we're COW */ if (PObj_COW_TEST(b)) { PARROT_ASSERT(PObj_is_COWable_TEST(b)); /* Let the old buffer know how to find us */ - *(Buffer **)(PObj_bufstart(b)) = b; + *((Buffer **)Buffer_bufstart(b)) = b; /* No guarantees that our data is still COW, so * assume not, and let the above code fix-up */ @@ -477,14 +495,14 @@ *ref_count |= Buffer_moved_FLAG; } - PObj_bufstart(b) = cur_spot; + Buffer_bufstart(b) = cur_spot; if (PObj_is_string_TEST(b)) { - ((STRING *)b)->strstart = (char *)PObj_bufstart(b) + + ((STRING *)b)->strstart = (char *)Buffer_bufstart(b) + offset; } - cur_spot += PObj_buflen(b); + cur_spot += Buffer_buflen(b); } } b = (Buffer *)((char *)b + object_size); @@ -676,7 +694,6 @@ /* Constant strings - not compacted */ arena_base->constant_string_pool = new_memory_pool(POOL_SIZE, NULL); - alloc_new_block(interp, POOL_SIZE, arena_base->constant_string_pool, "init"); } @@ -704,9 +721,8 @@ while (cur_block) { Memory_Block * const next_block = cur_block->prev; - if (cur_block->free == cur_block->size) { + if (cur_block->free == cur_block->size) mem_internal_free(cur_block); - } else { cur_block->next = NULL; cur_block->prev = dest->top_block; @@ -728,6 +744,205 @@ /* +=item C + +Checks the memory system of parrot on any corruptions, including +the string system. + +=cut + +*/ + +static void +check_memory_system(PARROT_INTERP) +{ + ASSERT_ARGS(check_memory_system) + size_t i; + Arenas * const arena_base = interp->arena_base; + + check_memory_pool(arena_base->memory_pool); + check_memory_pool(arena_base->constant_string_pool); + check_small_object_pool(arena_base->pmc_pool); + check_small_object_pool(arena_base->constant_pmc_pool); + check_small_object_pool(arena_base->string_header_pool); + check_small_object_pool(arena_base->constant_string_header_pool); + + for (i = 0; i < arena_base->num_sized; i++) { + Small_Object_Pool * pool = arena_base->sized_header_pools[i]; + if (pool != NULL && pool != arena_base->string_header_pool) + check_small_object_pool(pool); + } +} + +/* + +=item C + +Checks a small object pool, if it contains buffer it checks the buffers also. + +=cut + +*/ + +static void +check_small_object_pool(ARGMOD(Small_Object_Pool * pool)) +{ + ASSERT_ARGS(check_small_object_pool) + size_t total_objects; + size_t last_free_list_count; + Small_Object_Arena * arena_walker; + size_t free_objects; + PObj * object; + size_t i; + size_t count; + GC_MS_PObj_Wrapper * pobj_walker; + + count = 10000000; /*detect unendless loop just use big enough number*/ + + total_objects = pool->total_objects; + last_free_list_count = 1; + free_objects = 0; + + arena_walker = pool->last_Arena; + while (arena_walker != NULL) { + total_objects -= arena_walker->total_objects; + object = (PObj*)arena_walker->start_objects; + for (i = 0; i < arena_walker->total_objects; ++i) { + if (PObj_on_free_list_TEST(object)) { + ++free_objects; + pobj_walker = (GC_MS_PObj_Wrapper*)object; + if (pobj_walker->next_ptr == NULL) + /* should happen only once at the end */ + --last_free_list_count; + else { + /* next item on free list should also be flaged as free item */ + pobj_walker = (GC_MS_PObj_Wrapper*)pobj_walker->next_ptr; + PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker)); + } + } + else if (pool->mem_pool != NULL) { + /*then it means we are a buffer*/ + check_buffer_ptr((Buffer*)object, pool->mem_pool); + } + object = (PObj*)((char *)object + pool->object_size); + PARROT_ASSERT(--count); + } + /*check the list*/ + if (arena_walker->prev != NULL) + PARROT_ASSERT(arena_walker->prev->next == arena_walker); + arena_walker = arena_walker->prev; + PARROT_ASSERT(--count); + } + + count = 10000000; + + PARROT_ASSERT(free_objects == pool->num_free_objects); + + pobj_walker = (GC_MS_PObj_Wrapper*)pool->free_list; + while (pobj_walker != NULL) { + PARROT_ASSERT(pool->start_arena_memory <= (size_t)pobj_walker); + PARROT_ASSERT(pool->end_arena_memory > (size_t)pobj_walker); + PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker)); + --free_objects; + pobj_walker = (GC_MS_PObj_Wrapper*)pobj_walker->next_ptr; + PARROT_ASSERT(--count); + } + + PARROT_ASSERT(total_objects == 0); + PARROT_ASSERT(last_free_list_count == 0 || pool->num_free_objects == 0); + PARROT_ASSERT(free_objects == 0); +} + +/* + +=item C + +Checks a memory pool, containing buffer data + +=cut + +*/ + +static void +check_memory_pool(ARGMOD(Memory_Pool *pool)) +{ + ASSERT_ARGS(check_memory_pool) + size_t count; + Memory_Block * block_walker; + count = 10000000; /*detect unendless loop just use big enough number*/ + + block_walker = (Memory_Block *)pool->top_block; + while (block_walker != NULL) { + PARROT_ASSERT(block_walker->start == (char *)block_walker + + sizeof (Memory_Block)); + PARROT_ASSERT((size_t)(block_walker->top - + block_walker->start) == block_walker->size - block_walker->free); + + /*check the list*/ + if (block_walker->prev != NULL) + PARROT_ASSERT(block_walker->prev->next == block_walker); + block_walker = block_walker->prev; + PARROT_ASSERT(--count); + } +} + +/* + +=item C + +Checks wether the buffer is within the bounds of the memory pool + +=cut + +*/ + +void +check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Memory_Pool * pool)) +{ + ASSERT_ARGS(check_buffer_ptr) + Memory_Block * cur_block = pool->top_block; + char * bufstart; + + bufstart = (char*)Buffer_bufstart(pobj); + + if (bufstart == NULL && Buffer_buflen(pobj) == 0) + return; + + if (PObj_external_TEST(pobj) || PObj_sysmem_TEST(pobj)) { + /*buffer does not come from the memory pool*/ + if (PObj_is_string_TEST(pobj)) { + PARROT_ASSERT(((STRING *) pobj)->strstart >= + (char *) Buffer_bufstart(pobj)); + PARROT_ASSERT(((STRING *) pobj)->strstart + + ((STRING *) pobj)->strlen <= + (char *) Buffer_bufstart(pobj) + Buffer_buflen(pobj)); + } + return; + } + + if (PObj_is_COWable_TEST(pobj)) + bufstart -= sizeof (void*); + + while (cur_block) { + if ((char *)bufstart >= cur_block->start && + (char *)Buffer_bufstart(pobj) + + Buffer_buflen(pobj) < cur_block->start + cur_block->size) { + if (PObj_is_string_TEST(pobj)) { + PARROT_ASSERT(((STRING *)pobj)->strstart >= + (char *)Buffer_bufstart(pobj)); + PARROT_ASSERT(((STRING *)pobj)->strstart + + ((STRING *)pobj)->strlen <= (char *)Buffer_bufstart(pobj) + + Buffer_buflen(pobj)); + } + return; + } + cur_block = cur_block->prev; + } + PARROT_ASSERT(0); +} + +/* + =back =head1 SEE ALSO Index: src/gc/gc_inf.c =================================================================== --- src/gc/gc_inf.c (revision 40530) +++ src/gc/gc_inf.c (revision 40667) @@ -221,8 +221,7 @@ Initializes the function pointers in a new pool. When a new pool is created we assign several function pointers to it for managing memory in the pool. In this way we can treat different pools differently if they have special -management needs. In general all PObj-like pools are treated one way, and -other pools (such as the pmc_ext pool) are treated differently. +management needs. In general all PObj-like pools are treated the same. This function is mostly called from the function C in F at Parrot startup. Index: src/gc/generational_ms.c =================================================================== --- src/gc/generational_ms.c (revision 40530) +++ src/gc/generational_ms.c (revision 40667) @@ -1081,7 +1081,7 @@ /* if this may be an aggregate store it in IGP list, thus making * it a possible root for this generation */ - if (PObj_is_PMC_TEST((PObj *)_new) && ((PMC *)_new)->pmc_ext) + if (PObj_is_PMC_TEST((PObj *)_new)) gc_gms_store_igp(interp, nh); /* promote RHS to old generation of aggregate */ @@ -1494,7 +1494,7 @@ ++interp->arena_base->num_early_PMCs_seen; h = PObj_to_GMSH(obj); /* unsnap it from white, put it into gray or black */ - if (PObj_is_PMC_TEST(obj) && ((PMC*)obj)->pmc_ext) + if (PObj_is_PMC_TEST(obj)) gc_gms_setto_gray(interp, h, priority); else gc_gms_setto_black(interp, h, priority); @@ -1693,14 +1693,6 @@ --arena_base->num_early_gc_PMCs; if (PObj_active_destroy_TEST(obj)) VTABLE_destroy(interp, (PMC *)obj); - if (PObj_is_PMC_EXT_TEST(obj) && obj->pmc_ext) { - /* if the PMC has a PMC_EXT structure, - * return it to the pool - */ - Small_Object_Pool * const ext_pool = arena_base->pmc_ext_pool; - ext_pool->add_free_object(interp, ext_pool, obj->pmc_ext); - } - } pool->free_list = pool->white; return 0; Index: src/gc/gc_ms.c =================================================================== --- src/gc/gc_ms.c (revision 40530) +++ src/gc/gc_ms.c (revision 40667) @@ -29,13 +29,6 @@ __attribute__nonnull__(3) FUNC_MODIFIES(*pool); -static void gc_ms_add_free_pmc_ext(SHIM_INTERP, - ARGMOD(Small_Object_Pool *pool), - ARGIN(void *to_add)) - __attribute__nonnull__(2) - __attribute__nonnull__(3) - FUNC_MODIFIES(*pool); - static void gc_ms_alloc_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool)) __attribute__nonnull__(1) @@ -54,14 +47,6 @@ __attribute__nonnull__(2) FUNC_MODIFIES(*pool); -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static void * gc_ms_get_free_pmc_ext(PARROT_INTERP, - ARGMOD(Small_Object_Pool *pool)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*pool); - static void gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags) __attribute__nonnull__(1); @@ -92,9 +77,6 @@ #define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(pool) \ || PARROT_ASSERT_ARG(to_add) -#define ASSERT_ARGS_gc_ms_add_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(pool) \ - || PARROT_ASSERT_ARG(to_add) #define ASSERT_ARGS_gc_ms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pool) @@ -104,9 +86,6 @@ #define ASSERT_ARGS_gc_ms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pool) -#define ASSERT_ARGS_gc_ms_get_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) \ - || PARROT_ASSERT_ARG(pool) #define ASSERT_ARGS_gc_ms_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) #define ASSERT_ARGS_gc_ms_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \ @@ -365,6 +344,7 @@ gc_ms_more_traceable_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool)) { ASSERT_ARGS(gc_ms_more_traceable_objects) + if (pool->skip) pool->skip = 0; else { @@ -398,12 +378,12 @@ ARGIN(void *to_add)) { ASSERT_ARGS(gc_ms_add_free_object) - PObj *object = (PObj *)to_add; + GC_MS_PObj_Wrapper *object = (GC_MS_PObj_Wrapper *)to_add; PObj_flags_SETTO(object, PObj_on_free_list_FLAG); - ((GC_MS_PObj_Wrapper*)object)->next_ptr = (PObj *)pool->free_list; - pool->free_list = object; + object->next_ptr = pool->free_list; + pool->free_list = object; } /* @@ -438,7 +418,8 @@ ptr = free_list; pool->free_list = ((GC_MS_PObj_Wrapper*)ptr)->next_ptr; - PObj_flags_SETTO(ptr, 0); + /* PObj_flags_SETTO(ptr, 0); */ + memset(ptr, 0, pool->object_size); --pool->num_free_objects; @@ -462,6 +443,7 @@ { ASSERT_ARGS(gc_ms_alloc_objects) /* Setup memory for the new objects */ + Small_Object_Arena * const new_arena = mem_internal_allocate_typed(Small_Object_Arena); @@ -500,98 +482,11 @@ =back -=head2 MS PMC_EXT Pool functions - -=over 4 - -=item C - -Initialize the PMC_EXT pool functions. This is done separately from other -pools. - =cut */ -void -gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool)) -{ - ASSERT_ARGS(gc_ms_pmc_ext_pool_init) - pool->add_free_object = gc_ms_add_free_pmc_ext; - pool->get_free_object = gc_ms_get_free_pmc_ext; - pool->alloc_objects = gc_ms_alloc_objects; - pool->more_objects = gc_ms_alloc_objects; -} - - /* - -=item C - -Add a freed PMC_EXT structure to the free list in the PMC_EXT pool. Objects -on the free list can be reused later. - -=cut - -*/ - -static void -gc_ms_add_free_pmc_ext(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGIN(void *to_add)) -{ - ASSERT_ARGS(gc_ms_add_free_pmc_ext) - PMC_EXT * const object = (PMC_EXT *)to_add; - object->_metadata = NULL; - - /* yes, this cast is a hack for now, but a pointer is a pointer */ - object->_next_for_GC = (PMC *)pool->free_list; - pool->free_list = object; -} - -/* - -=item C - -Get a new PMC_EXT structure from the free pool and return it. - -=cut - -*/ - -PARROT_CANNOT_RETURN_NULL -PARROT_WARN_UNUSED_RESULT -static void * -gc_ms_get_free_pmc_ext(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool)) -{ - ASSERT_ARGS(gc_ms_get_free_pmc_ext) - PMC_EXT *ptr; - PMC_EXT *free_list = (PMC_EXT *)pool->free_list; - - /* if we don't have any objects */ - if (!free_list) { - (*pool->more_objects)(interp, pool); - free_list = (PMC_EXT *)pool->free_list; - } - - ptr = free_list; - pool->free_list = ptr->_next_for_GC; - ptr->_next_for_GC = NULL; - - --pool->num_free_objects; - - return ptr; -} - -/* - -=back - -=cut - -*/ - -/* * Local variables: * c-file-style: "parrot" * End: Index: src/gc/gc_private.h =================================================================== --- src/gc/gc_private.h (revision 40530) +++ src/gc/gc_private.h (revision 40667) @@ -47,9 +47,9 @@ larger then sizeof(PObj), thus creating overflow. However PObjs are never used by themselves, things like PMCs and STRINGs are cast to PObj in the GC, so we should have plenty of space. */ -typedef union GC_MS_PObj_Wrapper { - PObj obj; - PObj *next_ptr; +typedef struct GC_MS_PObj_Wrapper { + size_t flags; + struct GC_MS_PObj_Wrapper * next_ptr; } GC_MS_PObj_Wrapper; typedef struct Small_Object_Arena { @@ -152,7 +152,7 @@ size_t num_free_objects; /* number of resources in the free pool */ int skip; size_t replenish_level; - void *free_list; + GC_MS_PObj_Wrapper * free_list; /* adds a free object to the pool's free list */ add_free_object_fn_type add_free_object; get_free_object_fn_type get_free_object; @@ -184,9 +184,7 @@ Memory_Pool *constant_string_pool; struct Small_Object_Pool *string_header_pool; struct Small_Object_Pool *pmc_pool; - struct Small_Object_Pool *pmc_ext_pool; struct Small_Object_Pool *constant_pmc_pool; - struct Small_Object_Pool *buffer_header_pool; struct Small_Object_Pool *constant_string_header_pool; struct Small_Object_Pool **sized_header_pools; size_t num_sized; @@ -225,7 +223,6 @@ during collection */ UINTVAL num_early_gc_PMCs; /* how many PMCs want immediate destruction */ UINTVAL num_early_PMCs_seen; /* how many such PMCs has GC seen */ - UINTVAL num_extended_PMCs; /* active PMCs having pmc_ext */ PMC* gc_mark_start; /* first PMC marked during a GC run */ PMC* gc_mark_ptr; /* last PMC marked during a GC run */ PMC* gc_trace_ptr; /* last PMC trace_children was called on */ @@ -530,6 +527,12 @@ PARROT_WARN_UNUSED_RESULT size_t aligned_string_size(size_t len); +void check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Memory_Pool * pool)) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + FUNC_MODIFIES(* pobj) + FUNC_MODIFIES(* pool); + void compact_pool(PARROT_INTERP, ARGMOD(Memory_Pool *pool)) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -557,6 +560,9 @@ #define ASSERT_ARGS_aligned_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(buffer) #define ASSERT_ARGS_aligned_string_size __attribute__unused__ int _ASSERT_ARGS_CHECK = 0 +#define ASSERT_ARGS_check_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \ + PARROT_ASSERT_ARG(pobj) \ + || PARROT_ASSERT_ARG(pool) #define ASSERT_ARGS_compact_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pool) @@ -652,15 +658,9 @@ /* HEADERIZER BEGIN: src/gc/gc_ms.c */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -void gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool)) - __attribute__nonnull__(1) - FUNC_MODIFIES(*pool); - void Parrot_gc_ms_init(PARROT_INTERP) __attribute__nonnull__(1); -#define ASSERT_ARGS_gc_ms_pmc_ext_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(pool) #define ASSERT_ARGS_Parrot_gc_ms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ Index: src/gc/api.c =================================================================== --- src/gc/api.c (revision 40530) +++ src/gc/api.c (revision 40667) @@ -229,7 +229,7 @@ mark_special(interp, p); # ifndef NDEBUG - else if (p->pmc_ext && PMC_metadata(p)) + else if (PMC_metadata(p)) fprintf(stderr, "GC: error obj %p (%s) has properties\n", (void *)p, (char*)p->vtable->whoami->strstart); # endif @@ -238,7 +238,7 @@ /* buffer GC_DEBUG stuff */ if (GC_DEBUG(interp) && PObj_report_TEST(obj)) fprintf(stderr, "GC: buffer %p pointing to %p marked live\n", - obj, PObj_bufstart((Buffer *)obj)); + obj, Buffer_bufstart((Buffer *)obj)); # endif #endif /* PARROT_GC_GMS */ } @@ -334,17 +334,10 @@ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR, "Parrot VM: PMC allocation failed!\n"); - /* clear flags, set is_PMC_FLAG */ - if (flags & PObj_is_PMC_EXT_FLAG) { - Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool; - flags |= PObj_is_special_PMC_FLAG; - pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool); + flags |= PObj_is_special_PMC_FLAG; - if (flags & PObj_is_PMC_shared_FLAG) - Parrot_gc_add_pmc_sync(interp, pmc); - } - else - pmc->pmc_ext = NULL; + if (flags & PObj_is_PMC_shared_FLAG) + Parrot_gc_add_pmc_sync(interp, pmc); PObj_get_FLAGS(pmc) = PObj_is_PMC_FLAG|flags; pmc->vtable = NULL; @@ -373,8 +366,7 @@ if (PObj_active_destroy_TEST(pmc)) VTABLE_destroy(interp, pmc); - if (PObj_is_PMC_EXT_TEST(pmc)) - Parrot_gc_free_pmc_ext(interp, pmc); + Parrot_gc_free_pmc_sync(interp, pmc); PObj_flags_SETTO((PObj *)pmc, PObj_on_free_list_FLAG); pool->add_free_object(interp, pool, (PObj *)pmc); @@ -383,46 +375,8 @@ /* -=item C +=item C -Obtains a new C structure, and attaches it to the given C. -Sets the necessary flags associated with the PMC_EXT structure. Ensures -that the PMC_EXT structure is marked as "alive" by the GC. - -=cut - -*/ - -void -Parrot_gc_add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc)) -{ - ASSERT_ARGS(Parrot_gc_add_pmc_ext) - Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool; - if (!pmc->pmc_ext) - pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool); - if (!pmc->pmc_ext) - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR, - "Parrot VM: PMC_EXT allocation failed!\n"); - PObj_is_PMC_EXT_SET(pmc); - PObj_is_special_PMC_SET(pmc); - -#ifdef PARROT_GC_IMS - /* - * preserve DDD color: a simple PMC live = black - * an aggregate live = grey - * set'em black - */ - if (PObj_live_TEST(pmc)) - PObj_get_FLAGS(pmc) |= PObj_custom_GC_FLAG; -#endif - - PMC_next_for_GC(pmc) = PMCNULL; -} - -/* - -=item C - Frees the C structure attached to a PMC, if it exists. =cut @@ -430,24 +384,15 @@ */ void -Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p)) +Parrot_gc_free_pmc_sync(PARROT_INTERP, ARGMOD(PMC *p)) { - ASSERT_ARGS(Parrot_gc_free_pmc_ext) - /* if the PMC has a PMC_EXT structure, return it to the pool/arena */ - Arenas * const arena_base = interp->arena_base; - Small_Object_Pool * const ext_pool = arena_base->pmc_ext_pool; + ASSERT_ARGS(Parrot_gc_free_pmc_sync) - if (!p->pmc_ext) - return; - if (PObj_is_PMC_shared_TEST(p) && PMC_sync(p)) { MUTEX_DESTROY(PMC_sync(p)->pmc_lock); mem_internal_free(PMC_sync(p)); PMC_sync(p) = NULL; } - ext_pool->add_free_object(interp, ext_pool, p->pmc_ext); - ext_pool->num_free_objects++; - p->pmc_ext = NULL; } /* @@ -466,8 +411,6 @@ Parrot_gc_add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc)) { ASSERT_ARGS(Parrot_gc_add_pmc_sync) - if (!PObj_is_PMC_EXT_TEST(pmc)) - Parrot_gc_add_pmc_ext(interp, pmc); if (PMC_sync(pmc)) /* This mutex already exists, leave it alone. */ return; @@ -499,6 +442,7 @@ Parrot_gc_new_string_header(PARROT_INTERP, UINTVAL flags) { ASSERT_ARGS(Parrot_gc_new_string_header) + STRING * const string = (STRING *)get_free_buffer(interp, (flags & PObj_constant_FLAG) ? interp->arena_base->constant_string_header_pool @@ -553,6 +497,7 @@ Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size) { ASSERT_ARGS(Parrot_gc_new_bufferlike_header) + Small_Object_Pool * const pool = get_bufferlike_pool(interp, size); return get_free_buffer(interp, pool); @@ -576,22 +521,22 @@ get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool)) { ASSERT_ARGS(get_free_buffer) - PObj * const buffer = (PObj *)pool->get_free_object(interp, pool); + Buffer * const buffer = (Buffer *)pool->get_free_object(interp, pool); /* don't mess around with flags */ - PObj_bufstart(buffer) = NULL; - PObj_buflen(buffer) = 0; + Buffer_bufstart(buffer) = NULL; + Buffer_buflen(buffer) = 0; - if (pool->object_size - GC_HEADER_SIZE > sizeof (PObj)) + if (pool->object_size - GC_HEADER_SIZE > sizeof (Buffer)) memset(buffer + 1, 0, - pool->object_size - sizeof (PObj) - GC_HEADER_SIZE); + pool->object_size - sizeof (Buffer) - GC_HEADER_SIZE); return buffer; } /* -=item C Free a bufferlike header that is not being used, so that Parrot can recycle @@ -602,7 +547,7 @@ */ void -Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(PObj *obj), +Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj), size_t size) { ASSERT_ARGS(Parrot_gc_free_bufferlike_header) @@ -631,16 +576,16 @@ size_t new_size; char *mem; - PObj_buflen(buffer) = 0; - PObj_bufstart(buffer) = NULL; + Buffer_buflen(buffer) = 0; + Buffer_bufstart(buffer) = NULL; new_size = aligned_size(buffer, size); mem = (char *)mem_allocate(interp, new_size, interp->arena_base->memory_pool); mem = aligned_mem(buffer, mem); - PObj_bufstart(buffer) = mem; + Buffer_bufstart(buffer) = mem; if (PObj_is_COWable_TEST(buffer)) new_size -= sizeof (void*); - PObj_buflen(buffer) = new_size; + Buffer_buflen(buffer) = new_size; } /* @@ -671,7 +616,7 @@ /* * we don't shrink buffers */ - if (newsize <= PObj_buflen(buffer)) + if (newsize <= Buffer_buflen(buffer)) return; /* @@ -683,18 +628,18 @@ * The normal case is therefore always to allocate a new block */ new_size = aligned_size(buffer, newsize); - old_size = aligned_size(buffer, PObj_buflen(buffer)); + old_size = aligned_size(buffer, Buffer_buflen(buffer)); needed = new_size - old_size; if ((pool->top_block->free >= needed) - && (pool->top_block->top == (char *)PObj_bufstart(buffer) + old_size)) { + && (pool->top_block->top == (char *)Buffer_bufstart(buffer) + old_size)) { pool->top_block->free -= needed; pool->top_block->top += needed; - PObj_buflen(buffer) = newsize; + Buffer_buflen(buffer) = newsize; return; } - copysize = PObj_buflen(buffer); + copysize = Buffer_buflen(buffer); if (!PObj_COW_TEST(buffer)) pool->guaranteed_reclaimable += copysize; @@ -706,14 +651,14 @@ /* We shouldn't ever have a 0 from size, but we do. If we can track down * those bugs, this can be removed which would make things cheaper */ if (copysize) - memcpy(mem, PObj_bufstart(buffer), copysize); + memcpy(mem, Buffer_bufstart(buffer), copysize); - PObj_bufstart(buffer) = mem; + Buffer_bufstart(buffer) = mem; if (PObj_is_COWable_TEST(buffer)) new_size -= sizeof (void *); - PObj_buflen(buffer) = new_size; + Buffer_buflen(buffer) = new_size; } /* @@ -739,8 +684,8 @@ Memory_Pool *pool; char *mem; - PObj_buflen(str) = 0; - PObj_bufstart(str) = NULL; + Buffer_buflen(str) = 0; + Buffer_bufstart(str) = NULL; /* there's no sense in allocating zero memory, when the overhead of * allocating a string is one pointer; this can fill the pools in an @@ -757,8 +702,8 @@ mem = (char *)mem_allocate(interp, new_size, pool); mem += sizeof (void*); - PObj_bufstart(str) = str->strstart = mem; - PObj_buflen(str) = new_size - sizeof (void*); + Buffer_bufstart(str) = str->strstart = mem; + Buffer_buflen(str) = new_size - sizeof (void*); } /* @@ -789,7 +734,7 @@ : interp->arena_base->memory_pool; /* if the requested size is smaller then buflen, we are done */ - if (newsize <= PObj_buflen(str)) + if (newsize <= Buffer_buflen(str)) return; /* @@ -798,14 +743,14 @@ * - if there is enough size, we can just move the pool's top pointer */ new_size = aligned_string_size(newsize); - old_size = aligned_string_size(PObj_buflen(str)); + old_size = aligned_string_size(Buffer_buflen(str)); needed = new_size - old_size; if (pool->top_block->free >= needed - && pool->top_block->top == (char *)PObj_bufstart(str) + old_size) { + && pool->top_block->top == (char *)Buffer_bufstart(str) + old_size) { pool->top_block->free -= needed; pool->top_block->top += needed; - PObj_buflen(str) = new_size - sizeof (void*); + Buffer_buflen(str) = new_size - sizeof (void*); return; } @@ -815,18 +760,18 @@ copysize = str->bufused; if (!PObj_COW_TEST(str)) - pool->guaranteed_reclaimable += PObj_buflen(str); + pool->guaranteed_reclaimable += Buffer_buflen(str); - pool->possibly_reclaimable += PObj_buflen(str); + pool->possibly_reclaimable += Buffer_buflen(str); mem = (char *)mem_allocate(interp, new_size, pool); mem += sizeof (void *); /* copy mem from strstart, *not* bufstart */ oldmem = str->strstart; - PObj_bufstart(str) = (void *)mem; + Buffer_bufstart(str) = (void *)mem; str->strstart = mem; - PObj_buflen(str) = new_size - sizeof (void*); + Buffer_buflen(str) = new_size - sizeof (void*); /* We shouldn't ever have a 0 from size, but we do. If we can track down * those bugs, this can be removed which would make things cheaper */ @@ -907,9 +852,6 @@ dest_arena->constant_string_header_pool, source_arena->constant_string_header_pool); - Parrot_gc_merge_buffer_pools(dest_interp, - dest_arena->pmc_ext_pool, source_arena->pmc_ext_pool); - for (i = 0; i < source_arena->num_sized; ++i) { if (!source_arena->sized_header_pools[i]) continue; @@ -948,7 +890,7 @@ { ASSERT_ARGS(Parrot_gc_merge_buffer_pools) Small_Object_Arena *cur_arena; - void **free_list_end; + GC_MS_PObj_Wrapper *free_list_end; PARROT_ASSERT(dest->object_size == source->object_size); PARROT_ASSERT((dest->name == NULL && source->name == NULL) @@ -958,12 +900,16 @@ /* append new free_list to old */ /* XXX this won't work with, e.g., gc_gms */ - free_list_end = &dest->free_list; + free_list_end = dest->free_list; - while (*free_list_end) - free_list_end = (void **)*free_list_end; + if (free_list_end == NULL) + dest->free_list = source->free_list; + else { + while (free_list_end->next_ptr) + free_list_end = free_list_end->next_ptr; - *free_list_end = source->free_list; + free_list_end->next_ptr = source->free_list; + } /* now append source arenas */ cur_arena = source->last_Arena; @@ -1070,9 +1016,6 @@ (void *)pass, sweep_cb_buf); } - free_pool(interp->arena_base->pmc_ext_pool); - interp->arena_base->pmc_ext_pool = NULL; - mem_internal_free(interp->arena_base->sized_header_pools); if (interp->arena_base->attrib_pools) mem_internal_free(interp->arena_base->attrib_pools); @@ -1337,8 +1280,7 @@ for (i = 0; i < arena->used; i++) { if (!PObj_on_free_list_TEST(p)) { - if (p->pmc_ext) - PMC_next_for_GC(p) = PMCNULL; + PMC_next_for_GC(p) = PMCNULL; } p++; } @@ -1465,12 +1407,6 @@ Returns the number of PMCs that are marked as needing timely destruction. -=item C - -Returns the number of extended PMCs. - -=cut - */ size_t @@ -1537,14 +1473,6 @@ return arena_base->num_early_gc_PMCs; } -UINTVAL -Parrot_gc_extended_pmcs(PARROT_INTERP) -{ - ASSERT_ARGS(Parrot_gc_extended_pmcs) - const Arenas * const arena_base = interp->arena_base; - return arena_base->num_extended_PMCs; -} - /* =item C Index: src/gc/mark_sweep.c =================================================================== --- src/gc/mark_sweep.c (revision 40530) +++ src/gc/mark_sweep.c (revision 40667) @@ -33,7 +33,7 @@ static void free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), - ARGMOD(PObj *b)) + ARGMOD(Buffer *b)) __attribute__nonnull__(2) __attribute__nonnull__(3) FUNC_MODIFIES(*pool) @@ -41,7 +41,7 @@ static void free_buffer_malloc(SHIM_INTERP, SHIM(Small_Object_Pool *pool), - ARGMOD(PObj *b)) + ARGMOD(Buffer *b)) __attribute__nonnull__(3) FUNC_MODIFIES(*b); @@ -54,11 +54,6 @@ PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL -static Small_Object_Pool * new_buffer_pool(PARROT_INTERP) - __attribute__nonnull__(1); - -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL static Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP, size_t actual_buffer_size) __attribute__nonnull__(1); @@ -98,8 +93,6 @@ #define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(p) -#define ASSERT_ARGS_new_buffer_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) #define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) #define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \ @@ -140,7 +133,6 @@ arena_base->gc_trace_ptr = NULL; arena_base->gc_mark_start = NULL; arena_base->num_early_PMCs_seen = 0; - arena_base->num_extended_PMCs = 0; } /* @@ -281,6 +273,8 @@ Parrot_gc_sweep_pool(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool)) { ASSERT_ARGS(Parrot_gc_sweep_pool) + PObj *b; + UINTVAL i; UINTVAL total_used = 0; const UINTVAL object_size = pool->object_size; @@ -301,10 +295,9 @@ } #endif - /* Run through all the buffer header pools and mark */ + /* Run through all the PObj header pools and mark */ for (cur_arena = pool->last_Arena; cur_arena; cur_arena = cur_arena->prev) { - Buffer *b = (Buffer *)cur_arena->start_objects; - UINTVAL i; + b = (PObj*)cur_arena->start_objects; /* loop only while there are objects in the arena */ for (i = cur_arena->total_objects; i; i--) { @@ -349,7 +342,7 @@ pool->add_free_object(interp, pool, b); } next: - b = (Buffer *)((char *)b + object_size); + b = (PObj *)((char *)b + object_size); } } @@ -443,10 +436,8 @@ else hi_prio = 0; - if (obj->pmc_ext) { + { PMC * const tptr = arena_base->gc_trace_ptr; - - ++arena_base->num_extended_PMCs; /* * XXX this basically invalidates the high-priority marking * of PMCs by putting all PMCs onto the front of the list. @@ -798,12 +789,8 @@ if (PObj_active_destroy_TEST(p)) VTABLE_destroy(interp, pmc); - if (PObj_is_PMC_EXT_TEST(p)) - Parrot_gc_free_pmc_ext(interp, pmc); - #ifndef NDEBUG - pmc->pmc_ext = (PMC_EXT *)0xdeadbeef; pmc->vtable = (VTABLE *)0xdeadbeef; #endif @@ -835,7 +822,12 @@ Small_Object_Pool * const pool = new_small_object_pool(buffer_size, num_headers); - pool->gc_object = NULL; +#ifdef GC_IS_MALLOC + pool->gc_object = free_buffer_malloc; +#else + pool->gc_object = (gc_object_fn_type)free_buffer; +#endif + pool->mem_pool = interp->arena_base->memory_pool; (interp->arena_base->init_pool)(interp, pool); return pool; @@ -872,16 +864,14 @@ return pool; } - - /* -=item C +=item C -Creates a new C structure for managing buffer objects. +Creates a new pool for Cs and returns it. This calls +C internally, which in turn calls C. -Non-constant strings and plain Buffers are stored in the sized header pools. - =cut */ @@ -889,16 +879,19 @@ PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL static Small_Object_Pool * -new_buffer_pool(PARROT_INTERP) +new_string_pool(PARROT_INTERP, INTVAL constant) { - ASSERT_ARGS(new_buffer_pool) - Small_Object_Pool * const pool = get_bufferlike_pool(interp, sizeof (Buffer)); + ASSERT_ARGS(new_string_pool) + Small_Object_Pool *pool; + if (constant) { + pool = new_bufferlike_pool(interp, sizeof (STRING)); + pool->gc_object = NULL; + pool->mem_pool = interp->arena_base->constant_string_pool; + } + else + pool = get_bufferlike_pool(interp, sizeof (STRING)); -#ifdef GC_IS_MALLOC - pool->gc_object = free_buffer_malloc; -#else - pool->gc_object = free_buffer; -#endif + pool->objects_per_alloc = STRING_HEADERS_PER_ALLOC; return pool; } @@ -906,7 +899,7 @@ /* =item C +Buffer *b)> Frees the given buffer, returning the storage space to the operating system and removing it from Parrot's memory management system. If the buffer is COW, @@ -918,30 +911,30 @@ static void free_buffer_malloc(SHIM_INTERP, SHIM(Small_Object_Pool *pool), - ARGMOD(PObj *b)) + ARGMOD(Buffer *b)) { ASSERT_ARGS(free_buffer_malloc) /* free allocated space at (int *)bufstart - 1, but not if it used COW or is * external */ - PObj_buflen(b) = 0; + Buffer_buflen(b) = 0; - if (!PObj_bufstart(b) || PObj_is_external_or_free_TESTALL(b)) + if (!Buffer_bufstart(b) || PObj_is_external_or_free_TESTALL(b)) return; if (PObj_COW_TEST(b)) { - INTVAL * const refcount = PObj_bufrefcountptr(b); + INTVAL * const refcount = Buffer_bufrefcountptr(b); if (--(*refcount) == 0) { mem_sys_free(refcount); /* the actual bufstart */ } } else - mem_sys_free(PObj_bufrefcountptr(b)); + mem_sys_free(Buffer_bufrefcountptr(b)); } /* -=item C Frees a buffer, returning it to the memory pool for Parrot to possibly @@ -952,7 +945,7 @@ */ static void -free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(PObj *b)) +free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(Buffer *b)) { ASSERT_ARGS(free_buffer) Memory_Pool * const mem_pool = (Memory_Pool *)pool->mem_pool; @@ -961,49 +954,17 @@ * shouldn't happen */ if (mem_pool) { if (!PObj_COW_TEST(b)) - mem_pool->guaranteed_reclaimable += PObj_buflen(b); + mem_pool->guaranteed_reclaimable += Buffer_buflen(b); - mem_pool->possibly_reclaimable += PObj_buflen(b); + mem_pool->possibly_reclaimable += Buffer_buflen(b); } - PObj_buflen(b) = 0; + Buffer_buflen(b) = 0; } /* -=item C - -Creates a new pool for Cs and returns it. This calls -C internally, which in turn calls C. - -=cut - -*/ - -PARROT_WARN_UNUSED_RESULT -PARROT_CANNOT_RETURN_NULL -static Small_Object_Pool * -new_string_pool(PARROT_INTERP, INTVAL constant) -{ - ASSERT_ARGS(new_string_pool) - Small_Object_Pool *pool; - if (constant) { - pool = new_bufferlike_pool(interp, sizeof (STRING)); - pool->mem_pool = interp->arena_base->constant_string_pool; - } - else - pool = get_bufferlike_pool(interp, sizeof (STRING)); - - pool->objects_per_alloc = STRING_HEADERS_PER_ALLOC; - - return pool; -} - - -/* - =item C @@ -1054,7 +1015,7 @@ pools for string headers, constant string headers, buffers, PMCs, PMC_EXTs, and constant PMCs. -The C and C are actually both in the +The C actually lives in the sized pools, although no other sized pools are created here. =cut @@ -1073,11 +1034,9 @@ /* Init the buffer header pool * - * The buffer_header_pool and the string_header_pool actually live in the + * The string_header_pool actually lives in the * sized_header_pools. These pool pointers only provide faster access in * new_*_header */ - arena_base->buffer_header_pool = new_buffer_pool(interp); - arena_base->buffer_header_pool->name = "buffer_header"; /* Init the string header pool */ arena_base->string_header_pool = new_string_pool(interp, 0); @@ -1087,26 +1046,6 @@ arena_base->pmc_pool = new_pmc_pool(interp); arena_base->pmc_pool->name = "pmc"; - /* pmc extension buffer */ - arena_base->pmc_ext_pool = - new_small_object_pool(sizeof (PMC_EXT), 1024); - -#if PARROT_GC_MS - /* - * pmc_ext isn't a managed item. If a PMC has a pmc_ext structure - * it is returned to the pool instantly - the structure is never - * marked. - * Use GS MS pool functions - */ - gc_ms_pmc_ext_pool_init(arena_base->pmc_ext_pool); -#elif PARROT_GC_INF - arena_base->init_pool(interp, arena_base->pmc_ext_pool); -#else - /* rational, consistant behavior (as yet unwritten) */ -#endif - - arena_base->pmc_ext_pool->name = "pmc_ext"; - /* constant PMCs */ arena_base->constant_pmc_pool = new_pmc_pool(interp); arena_base->constant_pmc_pool->name = "constant_pmc"; Index: src/list.c =================================================================== --- src/list.c (revision 40530) +++ src/list.c (revision 40667) @@ -342,11 +342,11 @@ /* HEADERIZER END: static */ #define chunk_list_size(list) \ - (PObj_buflen(&(list)->chunk_list) / sizeof (List_chunk *)) + (Buffer_buflen(&(list)->chunk_list) / sizeof (List_chunk *)) /* hide the ugly cast somehow: */ #define chunk_list_ptr(list, idx) \ - ((List_chunk**) PObj_bufstart(&(list)->chunk_list))[(idx)] + ((List_chunk**) Buffer_bufstart(&(list)->chunk_list))[(idx)] /* @@ -381,7 +381,7 @@ chunk->next = NULL; chunk->prev = NULL; Parrot_gc_allocate_buffer_storage_aligned(interp, (Buffer *)chunk, size); - memset(PObj_bufstart((Buffer*)chunk), 0, size); + memset(Buffer_bufstart((Buffer*)chunk), 0, size); /* see also src/hash.c */ if (list->container) @@ -520,13 +520,13 @@ } mem_sys_memmove( - (char *) PObj_bufstart(&prev->data) + + (char *) Buffer_bufstart(&prev->data) + prev->items * list->item_size, - (const char *) PObj_bufstart(&chunk->data), + (const char *) Buffer_bufstart(&chunk->data), (MAX_ITEMS - prev->items) * list->item_size); mem_sys_memmove( - (char *) PObj_bufstart(&chunk->data), - (const char *) PObj_bufstart(&chunk->data) + + (char *) Buffer_bufstart(&chunk->data), + (const char *) Buffer_bufstart(&chunk->data) + (MAX_ITEMS - prev->items) * list->item_size, (chunk->items - (MAX_ITEMS - prev->items)) * list->item_size); @@ -540,9 +540,9 @@ GC_WRITE_BARRIER(interp, list->container, 0, prev); } mem_sys_memmove( - (char *) PObj_bufstart(&prev->data) + + (char *) Buffer_bufstart(&prev->data) + prev->items * list->item_size, - (const char *) PObj_bufstart(&chunk->data), + (const char *) Buffer_bufstart(&chunk->data), chunk->items * list->item_size); prev->items += chunk->items; chunk->items = 0; @@ -583,8 +583,8 @@ chunk->flags = 0; list->grow_policy = enum_grow_unknown; - list->cap += PObj_buflen(&chunk->data) / list->item_size - chunk->items; - chunk->items = PObj_buflen(&chunk->data) / list->item_size; + list->cap += Buffer_buflen(&chunk->data) / list->item_size - chunk->items; + chunk->items = Buffer_buflen(&chunk->data) / list->item_size; } /* XXX - still needed? - if last is empty and last->prev not full then @@ -1227,34 +1227,34 @@ switch (type) { case enum_type_sized: /* copy data into list */ - memcpy(&((char *) PObj_bufstart(&chunk->data))[idx * list->item_size], + memcpy(&((char *) Buffer_bufstart(&chunk->data))[idx * list->item_size], item, list->item_size); break; case enum_type_char: - ((char *) PObj_bufstart(&chunk->data))[idx] = (char)PTR2INTVAL(item); + ((char *) Buffer_bufstart(&chunk->data))[idx] = (char)PTR2INTVAL(item); break; case enum_type_short: - ((short *) PObj_bufstart(&chunk->data))[idx] = (short)PTR2INTVAL(item); + ((short *) Buffer_bufstart(&chunk->data))[idx] = (short)PTR2INTVAL(item); break; case enum_type_int: - ((int *) PObj_bufstart(&chunk->data))[idx] = (int)PTR2INTVAL(item); + ((int *) Buffer_bufstart(&chunk->data))[idx] = (int)PTR2INTVAL(item); break; case enum_type_INTVAL: - ((INTVAL *) PObj_bufstart(&chunk->data))[idx] = PTR2INTVAL(item); + ((INTVAL *) Buffer_bufstart(&chunk->data))[idx] = PTR2INTVAL(item); break; case enum_type_FLOATVAL: - ((FLOATVAL *) PObj_bufstart(&chunk->data))[idx] = *(FLOATVAL *)item; + ((FLOATVAL *) Buffer_bufstart(&chunk->data))[idx] = *(FLOATVAL *)item; break; case enum_type_PMC: if (list->container) { GC_WRITE_BARRIER(interp, list->container, - ((PMC **) PObj_bufstart(&chunk->data))[idx], + ((PMC **) Buffer_bufstart(&chunk->data))[idx], (PMC *)item); } - ((PMC **) PObj_bufstart(&chunk->data))[idx] = (PMC *)item; + ((PMC **) Buffer_bufstart(&chunk->data))[idx] = (PMC *)item; break; case enum_type_STRING: - ((STRING **) PObj_bufstart(&chunk->data))[idx] = (STRING *)item; + ((STRING **) Buffer_bufstart(&chunk->data))[idx] = (STRING *)item; break; default: Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n"); @@ -1296,21 +1296,21 @@ switch (type) { case enum_type_sized: return (void *)&((char *) - PObj_bufstart(&chunk->data))[idx * list->item_size]; + Buffer_bufstart(&chunk->data))[idx * list->item_size]; case enum_type_char: - return (void *)&((char *) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((char *) Buffer_bufstart(&chunk->data))[idx]; case enum_type_short: - return (void *)&((short *) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((short *) Buffer_bufstart(&chunk->data))[idx]; case enum_type_int: - return (void *)&((int *) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((int *) Buffer_bufstart(&chunk->data))[idx]; case enum_type_INTVAL: - return (void *)&((INTVAL *) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((INTVAL *) Buffer_bufstart(&chunk->data))[idx]; case enum_type_FLOATVAL: - return (void *)&((FLOATVAL *) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((FLOATVAL *) Buffer_bufstart(&chunk->data))[idx]; case enum_type_PMC: - return (void *)&((PMC **) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((PMC **) Buffer_bufstart(&chunk->data))[idx]; case enum_type_STRING: - return (void *)&((STRING **) PObj_bufstart(&chunk->data))[idx]; + return (void *)&((STRING **) Buffer_bufstart(&chunk->data))[idx]; default: Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n"); } @@ -1569,12 +1569,12 @@ l = list_new(interp, other->item_type); STRUCT_COPY(l, other); - PObj_buflen(&l->chunk_list) = 0; - PObj_bufstart(&l->chunk_list) = NULL; + Buffer_buflen(&l->chunk_list) = 0; + Buffer_bufstart(&l->chunk_list) = NULL; for (chunk = other->first, prev = NULL; chunk; chunk = chunk->next) { List_chunk * const new_chunk = allocate_chunk(interp, l, - chunk->items, PObj_buflen(&chunk->data)); + chunk->items, Buffer_buflen(&chunk->data)); new_chunk->flags = chunk->flags; @@ -1589,24 +1589,24 @@ switch (l->item_type) { case enum_type_PMC: for (i = 0; i < chunk->items; i++) { - PMC * const op = ((PMC **) PObj_bufstart(&chunk->data))[i]; + PMC * const op = ((PMC **) Buffer_bufstart(&chunk->data))[i]; if (op) - ((PMC **) PObj_bufstart(&new_chunk->data))[i] = + ((PMC **) Buffer_bufstart(&new_chunk->data))[i] = VTABLE_clone(interp, op); } break; case enum_type_STRING: for (i = 0; i < chunk->items; i++) { - STRING *s = ((STRING **) PObj_bufstart(&chunk->data))[i]; + STRING *s = ((STRING **) Buffer_bufstart(&chunk->data))[i]; if (s) - ((STRING **) PObj_bufstart(&new_chunk->data))[i] = + ((STRING **) Buffer_bufstart(&new_chunk->data))[i] = Parrot_str_copy(interp, s); } break; default: - mem_sys_memcopy(PObj_bufstart(&new_chunk->data), - PObj_bufstart(&chunk->data), PObj_buflen(&chunk->data)); + mem_sys_memcopy(Buffer_bufstart(&new_chunk->data), + Buffer_bufstart(&chunk->data), Buffer_buflen(&chunk->data)); break; } } @@ -1643,7 +1643,7 @@ if (list->item_type == enum_type_PMC || list->item_type == enum_type_STRING) { if (!(chunk->flags & sparse)) { - PObj **p = ((PObj **) PObj_bufstart(&chunk->data)); + PObj **p = ((PObj **) Buffer_bufstart(&chunk->data)); UINTVAL i; for (i = 0; i < chunk->items; i++, ++p) { @@ -1688,7 +1688,7 @@ if (!(chunk->flags & sparse)) { UINTVAL i; for (i = 0; i < chunk->items && idx < n; i++, idx++) { - PMC ** const pos = ((PMC **) PObj_bufstart(&chunk->data)) + i; + PMC ** const pos = ((PMC **) Buffer_bufstart(&chunk->data)) + i; info->thaw_ptr = pos; (info->visit_pmc_now)(interp, *pos, info); } @@ -1830,8 +1830,8 @@ /* copy data over */ mem_sys_memmove( - (char *)PObj_bufstart(&rest->data), - (char *)PObj_bufstart(&chunk->data) + idx * list->item_size, + (char *)Buffer_bufstart(&rest->data), + (char *)Buffer_bufstart(&chunk->data) + idx * list->item_size, items * list->item_size); } else { @@ -1895,15 +1895,15 @@ list->item_size; mem_sys_memmove( - (char *) PObj_bufstart(&chunk->data) + + (char *) Buffer_bufstart(&chunk->data) + idx * list->item_size, - (char *) PObj_bufstart(&chunk->data) + + (char *) Buffer_bufstart(&chunk->data) + (idx + n_items) * list->item_size, tmp_size); #else mem_sys_memmove( - (char *) PObj_bufstart(&chunk->data) + + (char *) Buffer_bufstart(&chunk->data) + idx * list->item_size, - (char *) PObj_bufstart(&chunk->data) + + (char *) Buffer_bufstart(&chunk->data) + (idx + n_items) * list->item_size, (chunk->items - idx - n_items) * list->item_size); #endif Index: src/pmc.c =================================================================== --- src/pmc.c (revision 40530) +++ src/pmc.c (revision 40667) @@ -42,14 +42,6 @@ UINTVAL flags) __attribute__nonnull__(1); -static INTVAL pmc_reuse_check_pmc_ext(PARROT_INTERP, - ARGMOD(PMC * pmc), - INTVAL newflags, - INTVAL flags) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(* pmc); - PARROT_CANNOT_RETURN_NULL static PMC* pmc_reuse_no_init(PARROT_INTERP, ARGIN(PMC *pmc), @@ -64,9 +56,6 @@ PARROT_ASSERT_ARG(interp) #define ASSERT_ARGS_get_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) -#define ASSERT_ARGS_pmc_reuse_check_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) \ - || PARROT_ASSERT_ARG(pmc) #define ASSERT_ARGS_pmc_reuse_no_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pmc) @@ -233,8 +222,6 @@ if (PObj_active_destroy_TEST(pmc)) VTABLE_destroy(interp, pmc); - new_flags = pmc_reuse_check_pmc_ext(interp, pmc, new_flags, new_vtable->flags); - /* we are a PMC + maybe is_PMC_EXT */ PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags); @@ -280,9 +267,6 @@ if (PObj_active_destroy_TEST(pmc)) VTABLE_destroy(interp, pmc); - new_flags = pmc_reuse_check_pmc_ext(interp, pmc, - new_flags, new_vtable->flags); - /* we are a PMC + maybe is_PMC_EXT */ PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags); @@ -341,45 +325,6 @@ /* -=item C - -We are converting one PMC type into another, such as in C or -C. Check to make sure that we have a pmc_ext if we need -one, and that we don't have it if we don't need it. Returns the updated -flags field with the C flag set if necessary. - -=cut - -*/ - -static INTVAL -pmc_reuse_check_pmc_ext(PARROT_INTERP, ARGMOD(PMC * pmc), - INTVAL newflags, INTVAL flags) -{ - ASSERT_ARGS(pmc_reuse_check_pmc_ext) - /* Do we have an extension area? */ - INTVAL const has_ext = (PObj_is_PMC_EXT_TEST(pmc) && pmc->pmc_ext); - - /* Do we need one? */ - if (flags & VTABLE_PMC_NEEDS_EXT) { - /* If we need an ext area, go allocate one */ - Parrot_gc_add_pmc_ext(interp, pmc); - newflags |= PObj_is_PMC_EXT_FLAG; - PARROT_ASSERT((newflags & PObj_is_PMC_EXT_FLAG) != 0); - } - else { - Parrot_gc_free_pmc_ext(interp, pmc); - PMC_data(pmc) = NULL; - newflags &= ~PObj_is_PMC_EXT_FLAG; - PARROT_ASSERT((newflags & PObj_is_PMC_EXT_FLAG) == 0); - PARROT_ASSERT(pmc->pmc_ext == NULL); - } - return newflags; -} - -/* - =item C @@ -456,11 +401,8 @@ vtable = interp->vtables[base_type]; } - if (vtable_flags & VTABLE_PMC_NEEDS_EXT) { - flags |= PObj_is_PMC_EXT_FLAG; - if (vtable_flags & VTABLE_IS_SHARED_FLAG) - flags |= PObj_is_PMC_shared_FLAG; - } + if (vtable_flags & VTABLE_IS_SHARED_FLAG) + flags |= PObj_is_PMC_shared_FLAG; pmc = Parrot_gc_new_pmc_header(interp, flags); pmc->vtable = vtable; @@ -810,11 +752,10 @@ * original because we have a singleton. Just set the singleton to * be our class object, but don't mess with its vtable. */ if ((interp->vtables[type]->flags & VTABLE_PMC_IS_SINGLETON) - && (_class == _class->vtable->pmc_class)) { + && (_class == _class->vtable->pmc_class)) interp->vtables[type]->pmc_class = _class; - } else { - Parrot_gc_free_pmc_ext(interp, _class); + Parrot_gc_free_pmc_sync(interp, _class); gc_flag_CLEAR(is_special_PMC, _class); PObj_is_PMC_shared_CLEAR(_class); interp->vtables[type]->pmc_class = _class; Index: src/interp/inter_misc.c =================================================================== --- src/interp/inter_misc.c (revision 40530) +++ src/interp/inter_misc.c (revision 40667) @@ -252,9 +252,6 @@ case IMPATIENT_PMCS: ret = Parrot_gc_impatient_pmcs(interp); break; - case EXTENDED_PMCS: - ret = Parrot_gc_extended_pmcs(interp); - break; case CURRENT_RUNCORE: ret = interp->run_core; break; Index: src/string/encoding/fixed_8.c =================================================================== --- src/string/encoding/fixed_8.c (revision 40530) +++ src/string/encoding/fixed_8.c (revision 40667) @@ -634,7 +634,7 @@ { ASSERT_ARGS(fixed8_set_position) iter->bytepos = iter->charpos = pos; - PARROT_ASSERT(pos <= PObj_buflen(iter->str)); + PARROT_ASSERT(pos <= Buffer_buflen(iter->str)); } Index: src/string/encoding/utf8.c =================================================================== --- src/string/encoding/utf8.c (revision 40530) +++ src/string/encoding/utf8.c (revision 40667) @@ -525,7 +525,7 @@ i->bytepos += (new_pos - pos); /* XXX possible buffer overrun exception? */ - PARROT_ASSERT(i->bytepos <= PObj_buflen(s)); + PARROT_ASSERT(i->bytepos <= Buffer_buflen(s)); i->charpos++; } Index: src/string/charset/iso-8859-1.c =================================================================== --- src/string/charset/iso-8859-1.c (revision 40530) +++ src/string/charset/iso-8859-1.c (revision 40667) @@ -268,12 +268,12 @@ for (offs = 0; offs < src->strlen; ++offs) { const UINTVAL c = ENCODING_GET_BYTE(interp, src, offs); - if (iter.bytepos >= PObj_buflen(dest) - 4) { + if (iter.bytepos >= Buffer_buflen(dest) - 4) { UINTVAL need = (UINTVAL)((src->strlen - offs) * 1.5); if (need < 16) need = 16; Parrot_gc_reallocate_string_storage(interp, dest, - PObj_buflen(dest) + need); + Buffer_buflen(dest) + need); } iter.set_and_advance(interp, &iter, c); } Index: src/string/charset/unicode.c =================================================================== --- src/string/charset/unicode.c (revision 40530) +++ src/string/charset/unicode.c (revision 40667) @@ -440,7 +440,7 @@ /* use all available space - see below XXX */ /* TODO downcase, titlecase too */ - dest_len = PObj_buflen(src) / sizeof (UChar); + dest_len = Buffer_buflen(src) / sizeof (UChar); src_len = src->bufused / sizeof (UChar); /* Index: src/string/api.c =================================================================== --- src/string/api.c (revision 40530) +++ src/string/api.c (revision 40667) @@ -89,16 +89,16 @@ * also be sure not to allocate from the constant pool */ PObj_flags_CLEARALL(&for_alloc); - Parrot_gc_allocate_string_storage(interp, &for_alloc, PObj_buflen(s)); + Parrot_gc_allocate_string_storage(interp, &for_alloc, Buffer_buflen(s)); /* now copy memory over */ mem_sys_memcopy(for_alloc.strstart, s->strstart, s->bufused); /* and finally use that string memory */ - PObj_bufstart(s) = PObj_bufstart(&for_alloc); + Buffer_bufstart(s) = Buffer_bufstart(&for_alloc); s->strstart = for_alloc.strstart; - PObj_buflen(s) = PObj_buflen(&for_alloc); + Buffer_buflen(s) = Buffer_buflen(&for_alloc); /* COW_FLAG | external_FLAG */ PObj_is_external_CLEARALL(s); @@ -148,7 +148,7 @@ /* XXX FIXME hack to avoid cross-interpreter issue until it * is fixed correctly. */ if (n_interpreters > 1 && PObj_is_movable_TESTALL(s) && - !Parrot_gc_ptr_in_memory_pool(interp, PObj_bufstart(s))) { + !Parrot_gc_ptr_in_memory_pool(interp, Buffer_bufstart(s))) { Parrot_str_write_COW(interp, d); Parrot_io_eprintf(interp, "cross-interpreter copy of " "relocatable string '%Ss' into tid %d\n", @@ -215,8 +215,8 @@ if (dest) { /* && dest != src */ /* they are different, dest is not an external string */ #ifdef GC_IS_MALLOC - if (!PObj_is_cowed_TESTALL(dest) && PObj_bufstart(dest)) { - mem_sys_free(PObj_bufallocstart(dest)); + if (!PObj_is_cowed_TESTALL(dest) && Buffer_bufstart(dest)) { + mem_sys_free(Buffer_bufallocstart(dest)); } #endif dest = Parrot_str_reuse_COW(interp, src, dest); @@ -338,7 +338,7 @@ { ASSERT_ARGS(string_capacity) - return ((ptrcast_t)PObj_bufstart(s) + PObj_buflen(s) - + return ((ptrcast_t)Buffer_bufstart(s) + Buffer_buflen(s) - (ptrcast_t)s->strstart); } @@ -524,7 +524,7 @@ return a; /* Is A real? */ - if (a == NULL || PObj_bufstart(a) == NULL) + if (a == NULL || Buffer_bufstart(a) == NULL) return Parrot_str_copy(interp, b); saneify_string(a); @@ -806,8 +806,8 @@ it was safe by setting PObj_external_FLAG. (The cast is necessary to pacify TenDRA's tcc.) */ - PObj_bufstart(s) = s->strstart = PARROT_const_cast(char *, buffer); - PObj_buflen(s) = s->bufused = len; + Buffer_bufstart(s) = s->strstart = PARROT_const_cast(char *, buffer); + Buffer_buflen(s) = s->bufused = len; if (encoding == Parrot_fixed_8_encoding_ptr) s->strlen = len; @@ -855,7 +855,7 @@ /* Don't check buflen, if we are here, we already checked. */ Parrot_gc_reallocate_string_storage(interp, - s, PObj_buflen(s) + string_max_bytes(interp, s, addlen)); + s, Buffer_buflen(s) + string_max_bytes(interp, s, addlen)); return s; } @@ -1328,7 +1328,7 @@ diff = (end_byte - start_byte) - rep->bufused; if (diff >= 0 - || ((INTVAL)src->bufused - (INTVAL)PObj_buflen(src)) <= diff) { + || ((INTVAL)src->bufused - (INTVAL)Buffer_buflen(src)) <= diff) { Parrot_str_write_COW(interp, src); if (diff != 0) { @@ -2479,11 +2479,11 @@ */ Parrot_str_write_COW(interp, s); - size = PObj_buflen(s); + size = Buffer_buflen(s); memory = (char *)mem_sys_allocate(size); - mem_sys_memcopy(memory, PObj_bufstart(s), size); - PObj_bufstart(s) = memory; + mem_sys_memcopy(memory, Buffer_bufstart(s), size); + Buffer_bufstart(s) = memory; s->strstart = memory; /* Mark the memory as both from the system and immobile */ @@ -2516,10 +2516,10 @@ return; Parrot_str_write_COW(interp, s); - size = PObj_buflen(s); + size = Buffer_buflen(s); /* We need a handle on the fixed memory so we can get rid of it later */ - memory = PObj_bufstart(s); + memory = Buffer_bufstart(s); /* Reallocate it the same size * NOTE can't use Parrot_gc_reallocate_string_storage because of the LEA @@ -2530,7 +2530,7 @@ Parrot_block_GC_sweep(interp); Parrot_gc_allocate_string_storage(interp, s, size); Parrot_unblock_GC_sweep(interp); - mem_sys_memcopy(PObj_bufstart(s), memory, size); + mem_sys_memcopy(Buffer_bufstart(s), memory, size); /* Mark the memory as neither immobile nor system allocated */ PObj_sysmem_CLEAR(s); @@ -2722,7 +2722,7 @@ i += hex->strlen; /* and usable len */ - charlen = PObj_buflen(result); + charlen = Buffer_buflen(result); dp = (unsigned char *)result->strstart; PARROT_ASSERT(i <= charlen); Index: src/key.c =================================================================== --- src/key.c (revision 40530) +++ src/key.c (revision 40667) @@ -544,7 +544,7 @@ ASSERT_ARGS(key_next) PMC *next_key; - if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key")) && key->pmc_ext) { + if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key"))) { GETATTR_Key_next_key(interp, key, next_key); return next_key; } Index: src/pmc/lexinfo.pmc =================================================================== --- src/pmc/lexinfo.pmc (revision 40530) +++ src/pmc/lexinfo.pmc (revision 40667) @@ -23,8 +23,7 @@ /* * LexInfo contains a constant Hash with constant string - * keys and integer indices - no marking and no pmc_ext - * needed (except for freeze/thaw + * keys and integer indices */ pmclass LexInfo extends Hash need_ext provides hash no_ro { Index: src/pmc/continuation.pmc =================================================================== --- src/pmc/continuation.pmc (revision 40530) +++ src/pmc/continuation.pmc (revision 40667) @@ -42,7 +42,7 @@ * context a pointer to the register frame, which contains active objects. * Additionally ct->current_cont has the continuation of the caller. * To avoid deep recursion during marking of nested subroutines, we - * need the next_for_GC pointer in the pmc_ext area. + * need the next_for_GC pointer. */ pmclass Continuation need_ext { Index: src/pmc/unmanagedstruct.pmc =================================================================== --- src/pmc/unmanagedstruct.pmc (revision 40530) +++ src/pmc/unmanagedstruct.pmc (revision 40667) @@ -382,7 +382,7 @@ ret = *(PMC**) p; /* now check if initializer has a signature attached */ - if (ptr->pmc_ext && PMC_metadata(ptr)) { + if (PMC_metadata(ptr)) { STRING *signature_str = CONST_STRING(interp, "_signature"); PMC *sig = VTABLE_getprop(interp, ptr, signature_str); if (VTABLE_defined(interp, sig)) { @@ -398,9 +398,8 @@ /* check the metadata for an initializer */ /* grab the struct from the metadata */ - if (ptr->pmc_ext && PMC_metadata(ptr)) { + if (PMC_metadata(ptr)) ret = VTABLE_getprop(interp, ptr, CONST_STRING(interp, "_struct")); - } else { Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, Index: src/pmc/default.pmc =================================================================== --- src/pmc/default.pmc (revision 40530) +++ src/pmc/default.pmc (revision 40667) @@ -230,9 +230,6 @@ make_prop_hash(PARROT_INTERP, PMC *self) { PMC *prop; - if (!self->pmc_ext) - Parrot_gc_add_pmc_ext(interp, self); - PMC_metadata(self) = prop = pmc_new(interp, enum_class_Hash); GC_WRITE_BARRIER(interp, self, NULL, prop); propagate_std_props(interp, self, prop); @@ -377,7 +374,7 @@ */ VTABLE PMC *getprop(STRING *key) { - if (SELF->pmc_ext && PMC_metadata(SELF)) + if (PMC_metadata(SELF)) return VTABLE_get_pmc_keyed_str(INTERP, PMC_metadata(SELF), key); else return check_get_std_props(interp, SELF, key); @@ -397,10 +394,8 @@ if (check_set_std_props(INTERP, SELF, key, value)) return; - if (SELF->pmc_ext && PMC_metadata(SELF)) { - VTABLE_set_pmc_keyed_str(INTERP, - PMC_metadata(SELF), key, value); - } + if (PMC_metadata(SELF)) + VTABLE_set_pmc_keyed_str(INTERP, PMC_metadata(SELF), key, value); else { PMC * const prop = make_prop_hash(INTERP, SELF); @@ -419,7 +414,7 @@ */ VTABLE void delprop(STRING *key) { - if (SELF->pmc_ext && PMC_metadata(SELF)) + if (PMC_metadata(SELF)) VTABLE_delete_keyed_str(INTERP, PMC_metadata(SELF), key); } @@ -434,9 +429,6 @@ */ VTABLE PMC *getprops() { - if (!SELF->pmc_ext) - Parrot_gc_add_pmc_ext(INTERP, SELF); - if (!PMC_metadata(SELF)) { if (has_pending_std_props(SELF)) return make_prop_hash(INTERP, SELF); @@ -1055,7 +1047,7 @@ VTABLE void visit(visit_info *info) { /* default - mark prop hash */ - if (SELF->pmc_ext && PMC_metadata(SELF) && + if (PMC_metadata(SELF) && info->extra_flags != EXTRA_IS_PROP_HASH) { info->extra_flags = EXTRA_IS_PROP_HASH; info->extra = PMC_metadata(SELF); @@ -1110,9 +1102,6 @@ VTABLE void thaw(visit_info *info) { /* default - initialize the PMC */ if (info->extra_flags == EXTRA_IS_PROP_HASH) { - if (!SELF->pmc_ext) - Parrot_gc_add_pmc_ext(INTERP, SELF); - info->thaw_ptr = &PMC_metadata(SELF); info->container = SELF; Index: src/pmc/key.pmc =================================================================== --- src/pmc/key.pmc (revision 40530) +++ src/pmc/key.pmc (revision 40667) @@ -278,9 +278,6 @@ VTABLE PMC *shift_pmc() { PMC *next_key; - if (!SELF->pmc_ext) - return NULL; - GET_ATTR_next_key(INTERP, SELF, next_key); return next_key; } Index: src/jit/i386/jit_defs.c =================================================================== --- src/jit/i386/jit_defs.c (revision 40530) +++ src/jit/i386/jit_defs.c (revision 40667) @@ -2265,16 +2265,16 @@ break; case 'v': break; - case 'b': /* buffer (void*) pass PObj_bufstart(SReg) */ + case 'b': /* buffer (void*) pass Buffer_bufstart(SReg) */ emitm_call_cfunc(pc, get_nci_S); emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, - (size_t) &PObj_bufstart((STRING *) NULL)); + (size_t) &Buffer_bufstart((STRING *) NULL)); emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset); break; - case 'B': /* buffer (void**) pass &PObj_bufstart(SReg) */ + case 'B': /* buffer (void**) pass &Buffer_bufstart(SReg) */ emitm_call_cfunc(pc, get_nci_S); emitm_lea_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, - (size_t) &PObj_bufstart((STRING *) NULL)); + (size_t) &Buffer_bufstart((STRING *) NULL)); emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset); break; case 'S': Index: src/pmc_freeze.c =================================================================== --- src/pmc_freeze.c (revision 40530) +++ src/pmc_freeze.c (revision 40667) @@ -113,10 +113,6 @@ __attribute__nonnull__(1) __attribute__nonnull__(2); -static void pmc_add_ext(PARROT_INTERP, ARGIN(PMC *pmc)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - static void push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -323,9 +319,6 @@ #define ASSERT_ARGS_op_check_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(s) -#define ASSERT_ARGS_pmc_add_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) \ - || PARROT_ASSERT_ARG(pmc) #define ASSERT_ARGS_push_ascii_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(io) @@ -463,17 +456,18 @@ str_append(PARROT_INTERP, ARGMOD(STRING *s), ARGIN(const void *b), size_t len) { ASSERT_ARGS(str_append) + const size_t used = s->bufused; - const int need_free = (int)PObj_buflen(s) - used - len; + const int need_free = (int)Buffer_buflen(s) - used - len; /* * grow by factor 1.5 or such */ if (need_free <= 16) { - size_t new_size = (size_t) (PObj_buflen(s) * 1.5); - if (new_size < PObj_buflen(s) - need_free + 512) - new_size = PObj_buflen(s) - need_free + 512; + size_t new_size = (size_t) (Buffer_buflen(s) * 1.5); + if (new_size < Buffer_buflen(s) - need_free + 512) + new_size = Buffer_buflen(s) - need_free + 512; Parrot_gc_reallocate_string_storage(interp, s, new_size); - PARROT_ASSERT(PObj_buflen(s) - used - len >= 15); + PARROT_ASSERT(Buffer_buflen(s) - used - len >= 15); } mem_sys_memcopy((void *)((ptrcast_t)s->strstart + used), b, len); s->bufused += len; @@ -591,6 +585,7 @@ shift_ascii_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io)) { ASSERT_ARGS(shift_ascii_integer) + char * const start = (char*)io->image->strstart; char *p = start; const INTVAL i = strtoul(p, &p, 10); @@ -599,7 +594,9 @@ PARROT_ASSERT(p <= start + io->image->bufused); io->image->strstart = p; io->image->bufused -= (p - start); + io->image->strlen -= (p - start); PARROT_ASSERT((int)io->image->bufused >= 0); + return i; } @@ -617,6 +614,7 @@ shift_ascii_number(SHIM_INTERP, ARGIN(IMAGE_IO *io)) { ASSERT_ARGS(shift_ascii_number) + char * const start = (char*)io->image->strstart; char *p = start; const FLOATVAL f = (FLOATVAL) strtod(p, &p); @@ -625,7 +623,9 @@ PARROT_ASSERT(p <= start + io->image->bufused); io->image->strstart = p; io->image->bufused -= (p - start); + io->image->strlen -= (p - start); PARROT_ASSERT((int)io->image->bufused >= 0); + return f; } @@ -656,9 +656,11 @@ PARROT_ASSERT(p <= start + io->image->bufused); io->image->strstart = p; io->image->bufused -= (p - start); + io->image->strlen -= (p - start); PARROT_ASSERT((int)io->image->bufused >= 0); s = string_make(interp, start, p - start - 1, "iso-8859-1", 0); /* s = string_make(interp, start, p - start - 1, "UTF-8", 0); */ + return s; } @@ -678,6 +680,7 @@ shift_ascii_pmc(SHIM_INTERP, ARGIN(IMAGE_IO *io)) { ASSERT_ARGS(shift_ascii_pmc) + char * const start = (char*)io->image->strstart; char *p = start; const unsigned long i = strtoul(p, &p, 16); @@ -685,7 +688,9 @@ PARROT_ASSERT(p <= start + io->image->bufused); io->image->strstart = p; io->image->bufused -= (p - start); + io->image->strlen -= (p - start); PARROT_ASSERT((int)io->image->bufused >= 0); + return (PMC*) i; } @@ -712,16 +717,17 @@ { ASSERT_ARGS(op_check_size) const size_t used = s->bufused; - const int need_free = (int)PObj_buflen(s) - used - len; + const int need_free = (int)Buffer_buflen(s) - used - len; + /* * grow by factor 1.5 or such */ if (need_free <= 16) { - size_t new_size = (size_t) (PObj_buflen(s) * 1.5); - if (new_size < PObj_buflen(s) - need_free + 512) - new_size = PObj_buflen(s) - need_free + 512; + size_t new_size = (size_t) (Buffer_buflen(s) * 1.5); + if (new_size < Buffer_buflen(s) - need_free + 512) + new_size = Buffer_buflen(s) - need_free + 512; Parrot_gc_reallocate_string_storage(interp, s, new_size); - PARROT_ASSERT(PObj_buflen(s) - used - len >= 15); + PARROT_ASSERT(Buffer_buflen(s) - used - len >= 15); } #ifndef DISABLE_GC_DEBUG Parrot_gc_compact_memory_pool(interp); @@ -785,6 +791,7 @@ push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), FLOATVAL v) { ASSERT_ARGS(push_opcode_number) + const size_t len = PF_size_number() * sizeof (opcode_t); STRING * const s = io->image; const size_t used = s->bufused; @@ -812,6 +819,7 @@ push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(STRING *v)) { ASSERT_ARGS(push_opcode_string) + const size_t len = PF_size_string(v) * sizeof (opcode_t); STRING * const s = io->image; const size_t used = s->bufused; @@ -862,6 +870,7 @@ (const opcode_t **)opcode); io->image->bufused -= ((char *)io->image->strstart - start); + io->image->strlen -= ((char *)io->image->strstart - start); PARROT_ASSERT((int)io->image->bufused >= 0); return i; @@ -903,12 +912,14 @@ shift_opcode_number(SHIM_INTERP, ARGIN(IMAGE_IO *io)) { ASSERT_ARGS(shift_opcode_number) + const char * const start = (const char *)io->image->strstart; char **opcode = &io->image->strstart; const FLOATVAL f = PF_fetch_number(io->pf, (const opcode_t **)opcode); io->image->bufused -= ((char *)io->image->strstart - start); + io->image->strlen -= ((char *)io->image->strstart - start); PARROT_ASSERT((int)io->image->bufused >= 0); return f; @@ -930,12 +941,15 @@ shift_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io)) { ASSERT_ARGS(shift_opcode_string) + char * const start = (char*)io->image->strstart; - char **opcode = &io->image->strstart; + char * opcode = io->image->strstart; STRING * const s = PF_fetch_string(interp, io->pf, - (const opcode_t **)opcode); + (const opcode_t **)&opcode); - io->image->bufused -= ((char *)io->image->strstart - start); + io->image->strstart = opcode; + io->image->bufused -= (opcode - start); + io->image->strlen -= (opcode - start); PARROT_ASSERT((int)io->image->bufused >= 0); return s; @@ -949,22 +963,10 @@ =over 4 -=item C - -Adds a C to C<*pmc>. - =cut */ -static void -pmc_add_ext(PARROT_INTERP, ARGIN(PMC *pmc)) -{ - ASSERT_ARGS(pmc_add_ext) - if (pmc->vtable->flags & VTABLE_PMC_NEEDS_EXT) - Parrot_gc_add_pmc_ext(interp, pmc); -} - /* * this function setup stuff may be replaced by a real PMC * in the future @@ -1019,6 +1021,7 @@ 16 - PACKFILE_HEADER_BYTES % 16 : 0); info->image_io = mem_allocate_typed(IMAGE_IO); + info->image_io->image = s = info->image; #if FREEZE_ASCII info->image_io->vtable = &ascii_funcs; @@ -1026,6 +1029,7 @@ info->image_io->vtable = &opcode_funcs; #endif pf = info->image_io->pf = PackFile_new(interp, 0); + if (info->what == VISIT_FREEZE_NORMAL || info->what == VISIT_FREEZE_AT_DESTRUCT) { @@ -1052,6 +1056,7 @@ mem_sys_memcopy(pf->header, s->strstart, PACKFILE_HEADER_BYTES); PackFile_assign_transforms(pf); s->bufused -= header_length; + s->strlen -= header_length; LVALUE_CAST(char *, s->strstart) += header_length; } @@ -1171,6 +1176,7 @@ info->extra_flags = EXTRA_IS_NULL; n = VTABLE_shift_pmc(interp, io); + if (((UINTVAL) n & 3) == 3) { /* pmc has extra data */ info->extra_flags = VTABLE_shift_integer(interp, io); @@ -1194,6 +1200,7 @@ *type = enum_class_Class; } } + *id = (UINTVAL) n; return seen; } @@ -1356,8 +1363,7 @@ } list_assign(interp, (List *)PMC_data(info->id_list), id, pmc, enum_type_PMC); /* remember nested aggregates depth first */ - if (pmc->pmc_ext) - list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC); + list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC); } @@ -1396,10 +1402,9 @@ add_pmc_next_for_GC(SHIM_INTERP, ARGIN(PMC *pmc), ARGOUT(visit_info *info)) { ASSERT_ARGS(add_pmc_next_for_GC) - if (pmc->pmc_ext) { - PMC_next_for_GC(info->mark_ptr) = pmc; - info->mark_ptr = PMC_next_for_GC(pmc) = pmc; - } + PMC_next_for_GC(info->mark_ptr) = pmc; + info->mark_ptr = PMC_next_for_GC(pmc) = pmc; + } /* @@ -1429,21 +1434,15 @@ return 1; } - /* - * we can only remember PMCs with a next_for_GC pointer - * which is located in pmc_ext - */ - if (pmc->pmc_ext) { - /* already seen? */ - if (!PMC_IS_NULL(PMC_next_for_GC(pmc))) { - seen = 1; - goto skip; - } - /* put pmc at the end of the list */ - PMC_next_for_GC(info->mark_ptr) = pmc; - /* make end self-referential */ - info->mark_ptr = PMC_next_for_GC(pmc) = pmc; + /* already seen? */ + if (!PMC_IS_NULL(PMC_next_for_GC(pmc))) { + seen = 1; + goto skip; } + /* put pmc at the end of the list */ + PMC_next_for_GC(info->mark_ptr) = pmc; + /* make end self-referential */ + info->mark_ptr = PMC_next_for_GC(pmc) = pmc; skip: *id = id_from_pmc(interp, pmc); return seen; @@ -1500,8 +1499,7 @@ parrot_hash_put(interp, (Hash *)VTABLE_get_pointer(interp, info->seen), pmc, (void*)*id); /* remember containers */ - if (pmc->pmc_ext) - list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC); + list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC); return 0; } @@ -1606,15 +1604,13 @@ ARGIN(visit_info *info)) { ASSERT_ARGS(visit_loop_next_for_GC) + PMC *prev = NULL; visit_next_for_GC(interp, current, info); - if (current->pmc_ext) { - PMC *prev = NULL; - while (current != prev) { - VTABLE_visit(interp, current, info); - prev = current; - current = PMC_next_for_GC(current); - } + while (current != prev) { + VTABLE_visit(interp, current, info); + prev = current; + current = PMC_next_for_GC(current); } } @@ -1685,11 +1681,8 @@ } /* on thawing call thawfinish for each processed PMC */ - if (!finished_first) { - /* the first create PMC might not be in the list, - * if it has no pmc_ext */ + if (!finished_first) list_unshift(interp, finish_list, info->thaw_result, enum_type_PMC); - } n = list_length(interp, finish_list); @@ -1797,7 +1790,8 @@ */ LVALUE_CAST(char *, image->strstart) -= bufused; image->bufused = bufused; - PARROT_ASSERT(image->strstart >= (char *)PObj_bufstart(image)); + image->strlen += bufused; + PARROT_ASSERT(image->strstart >= (char *)Buffer_bufstart(image)); if (gc_block) { Parrot_unblock_GC_mark(interp); Index: src/jit_debug_xcoff.c =================================================================== --- src/jit_debug_xcoff.c (revision 40530) +++ src/jit_debug_xcoff.c (revision 40667) @@ -118,64 +118,58 @@ fprintf(stabs, ".stabx \"STRING:t%d=*%d\"" ",0," C_DECL ",0\n", i, i+1); ++i; - fprintf(stabs, ".stabx \"Parrot_String:T%d=s%d" - "bufstart:14,%d,%d;" - "buflen:6,%d,%d;" /* XXX type */ - "flags:12,%d,%d;" - "bufused:12,%d,%d;" - "strstart:15,%d,%d;" /* fake a char* */ + fprintf(stabs, ".stabs \"Parrot_String:T(0,%d)=s%d" + "bufstart:(0,14),%d,%d;" + "buflen:(0,6),%d,%d;" + "flags:(0,12),%d,%d;" + "bufused:(0,12),%d,%d;" + "strstart:(0,15),%d,%d;" ";\"" - ",0," C_DECL ",0\n", i++, BYTE_SIZE(STRING), - BIT_OFFSET(STRING, cache._b._bufstart), BIT_SIZE(void*), - BIT_OFFSET(STRING, cache._b._buflen), BIT_SIZE(size_t), + "," N_LSYM ",0,0,0\n", i++, BYTE_SIZE(STRING), + BIT_OFFSET(STRING, _bufstart), BIT_SIZE(void*), + BIT_OFFSET(STRING, _buflen), BIT_SIZE(size_t), BIT_OFFSET(STRING, flags), BIT_SIZE(UINTVAL), BIT_OFFSET(STRING, bufused), BIT_SIZE(UINTVAL), BIT_OFFSET(STRING, strstart), BIT_SIZE(void*)); - fprintf(stabs, ".stabx \"PMCType:T%d=e", i++); + fprintf(stabs, ".stabs \"PMCType:T(0,%d)=e", i++); for (j = 0; j < interp->n_vtable_max; ++j) { if (interp->vtables[j] && interp->vtables[j]->whoami) { - STRING* name = interp->vtables[j]->whoami; - fwrite(name->strstart, name->strlen, 1, stabs); + STRING *name = interp->vtables[j]->whoami; + size_t items = fwrite(name->strstart, name->strlen, 1, stabs); + if (!items) + fprintf(stderr, "Error writing stabs!\n"); fprintf(stabs, ":%d,", j); } } - fprintf(stabs, ";\",0," C_DECL ",0\n"); - /* PMC type */ - fprintf(stabs, ".stabx \"PMC:T%d=s%d", i, BYTE_SIZE(PMC)); - fprintf(stabs, "cache:%d,%d,%d;", - i + 1, BIT_OFFSET(PMC, cache), BIT_SIZE(UnionVal)); - fprintf(stabs, "flags:%d,%d,%d;", - i + 1, BIT_OFFSET(PMC, flags), BIT_SIZE(Parrot_UInt)); - fprintf(stabs, "vtable:*%d,%d,%d;", - i + 3, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*)); - fprintf(stabs, "data:14,%d,%d;", - BIT_OFFSET(PMC, data), BIT_SIZE(void*)); - fprintf(stabs, "pmc_ext:*%d,%d,%d;", - i, BIT_OFFSET(PMC, pmc_ext), BIT_SIZE(void*)); - fprintf(stabs, ";\""); - fprintf(stabs, ",0," C_DECL ",0\n"); + fprintf(stabs, ";\"," N_LSYM ",0,0,0\n"); - fprintf(stabs, ".stabx \"cache:%d,%d,%d;" - "flags:12,%d,%d;" + fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d" + "flags:(0,12),%d,%d;" + "vtable:*(0,%d),%d,%d;" + "data:(0,14),%d,%d;" + "_metadata:*(0,%d),%d,%d;" + "_next_for_GC:*(0,%d),%d,%d;" ";\"" - ",0," C_DECL ",0\n", - i + 2, BIT_SIZE(UnionVal), BIT_SIZE(Parrot_UInt)); - fprintf(stabs, ".stabx \"UnionVal:T%d=u%d" - "int_val:12,%d,%d;" - "pmc_val:*%d,%d,%d;" + "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(PMC), + BIT_OFFSET(PMC, flags), BIT_SIZE(UINTVAL), + i + 1, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*), + BIT_OFFSET(PMC, data), BIT_SIZE(void*), + i, BIT_OFFSET(PMC, _metadata), BIT_SIZE(void*), + i, BIT_OFFSET(PMC, _next_for_GC), BIT_SIZE(void*)); + + i++; + + /* some one can add some field to this one */ + fprintf(stabs, ".stabs \"VTABLE:T(0,%d)=s%d" + "base_type:(0,12),%d,%d;" ";\"" - ",0," C_DECL ",0\n", i + 2, BYTE_SIZE(UnionVal), - BIT_OFFSET(UnionVal, int_val), BIT_SIZE(INTVAL), - i, BIT_OFFSET(UnionVal, pmc_val), BIT_SIZE(void*)); - fprintf(stabs, ".stabx \"VTABLE:T%d=s%d" - "base_type:%d,%d,%d;" - ";\"" - ",0," C_DECL ",0\n", i + 3, BYTE_SIZE(UnionVal), - i - 1, BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL)); - i += 4; + "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(_vtable), + BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL)); + i++; + } /* Index: src/call/pcc.c =================================================================== --- src/call/pcc.c (revision 40530) +++ src/call/pcc.c (revision 40667) @@ -1665,7 +1665,7 @@ * RT #54860 and others * Save current value while setting the optional */ - const UnionVal old_value = st->val; + const UnionCallStateVal old_value = st->val; while (dest->sig & PARROT_ARG_OPTIONAL) { null_val(st->dest.sig, st); Index: src/jit_debug.c =================================================================== --- src/jit_debug.c (revision 40530) +++ src/jit_debug.c (revision 40667) @@ -106,6 +106,7 @@ static void write_types(FILE *stabs, PARROT_INTERP) { + /* It would be create if this function would be auto generated */ int i, j; /* borrowed from mono */ static BaseTypes base_types[] = { @@ -152,14 +153,14 @@ ++i; fprintf(stabs, ".stabs \"Parrot_String:T(0,%d)=s%d" "bufstart:(0,14),%d,%d;" - "buflen:(0,6),%d,%d;" /* XXX type */ + "buflen:(0,6),%d,%d;" "flags:(0,12),%d,%d;" "bufused:(0,12),%d,%d;" - "strstart:(0,15),%d,%d;" /* fake a char* */ + "strstart:(0,15),%d,%d;" ";\"" "," N_LSYM ",0,0,0\n", i++, BYTE_SIZE(STRING), - BIT_OFFSET(STRING, cache._b._bufstart), BIT_SIZE(void*), - BIT_OFFSET(STRING, cache._b._buflen), BIT_SIZE(size_t), + BIT_OFFSET(STRING, _bufstart), BIT_SIZE(void*), + BIT_OFFSET(STRING, _buflen), BIT_SIZE(size_t), BIT_OFFSET(STRING, flags), BIT_SIZE(UINTVAL), BIT_OFFSET(STRING, bufused), BIT_SIZE(UINTVAL), BIT_OFFSET(STRING, strstart), BIT_SIZE(void*)); @@ -177,35 +178,30 @@ fprintf(stabs, ";\"," N_LSYM ",0,0,0\n"); - /* PMC type */ - fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d", i, BYTE_SIZE(PMC)); - fprintf(stabs, "cache:(0,%d),%d,%d;", - i + 1, BIT_OFFSET(PMC, cache), BIT_SIZE(UnionVal)); - fprintf(stabs, "flags:(0,%d),%d,%d;", - i + 1, BIT_OFFSET(PMC, flags), BIT_SIZE(Parrot_UInt)); - fprintf(stabs, "vtable:*(0,%d),%d,%d;", - i + 3, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*)); - fprintf(stabs, "data:(0,14),%d,%d;", - BIT_OFFSET(PMC, data), BIT_SIZE(void*)); - fprintf(stabs, "pmc_ext:*(0,%d),%d,%d;", - i, BIT_OFFSET(PMC, pmc_ext), BIT_SIZE(void*)); - fprintf(stabs, ";\""); - fprintf(stabs, "," N_LSYM ",0,0,0\n"); - - fprintf(stabs, ".stabs \"UnionVal:T(0,%d)=u%d" - "int_val:(0,12),%d,%d;" - "pmc_val:*(0,%d),%d,%d;" + fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d" + "flags:(0,12),%d,%d;" + "vtable:*(0,%d),%d,%d;" + "data:(0,14),%d,%d;" + "_metadata:*(0,%d),%d,%d;" + "_next_for_GC:*(0,%d),%d,%d;" ";\"" - "," N_LSYM ",0,0,0\n", i + 2, BYTE_SIZE(UnionVal), - BIT_OFFSET(UnionVal, _i._int_val), BIT_SIZE(INTVAL), - i, BIT_OFFSET(UnionVal, _ptrs._pmc_val), BIT_SIZE(void*)); + "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(PMC), + BIT_OFFSET(PMC, flags), BIT_SIZE(UINTVAL), + i + 1, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*), + BIT_OFFSET(PMC, data), BIT_SIZE(void*), + i, BIT_OFFSET(PMC, _metadata), BIT_SIZE(void*), + i, BIT_OFFSET(PMC, _next_for_GC), BIT_SIZE(void*)); + + i++; + + /* someone can add some field to this one */ fprintf(stabs, ".stabs \"VTABLE:T(0,%d)=s%d" - "base_type:(0,%d),%d,%d;" + "base_type:(0,12),%d,%d;" ";\"" - "," N_LSYM ",0,0,0\n", i + 3, BYTE_SIZE(UnionVal), - i - 1, BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL)); - i += 4; + "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(_vtable), + BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL)); + i++; } /* Index: docs/pdds/pdd17_pmc.pod =================================================================== --- docs/pdds/pdd17_pmc.pod (revision 40530) +++ docs/pdds/pdd17_pmc.pod (revision 40667) @@ -48,7 +48,9 @@ Parrot_UInt flags; VTABLE *vtable; DPOINTER *data; - struct PMC_EXT *pmc_ext; + PMC *_metadata; + struct _Sync *_synchronize; # [Note: may be deprecated, see STM] + PMC *_next_for_GC; }; where C is a C union: @@ -88,14 +90,6 @@ C holds a pointer to the core data associated with the PMC. This may be null. -C points to an extended PMC structure. This has the form: - - struct PMC_EXT { - PMC *_metadata; - struct _Sync *_synchronize; # [Note: may be deprecated, see STM] - PMC *_next_for_GC; - }; - C<_metadata> holds internal PMC metadata. The specification for this has not yet been finalized. @@ -104,9 +98,6 @@ C<_next_for_GC> determines the next PMC in the 'used' list during dead object detection in the GC. -PMCs are not required to have a C structure (i.e. C can be -null). - PMCs are used to implement the basic data types of the high level languages running on top of Parrot. For instance, a Perl 5 C will map onto one (or more) types of PMC, while particular Python datatypes will map onto different Index: docs/pdds/pdd09_gc.pod =================================================================== --- docs/pdds/pdd09_gc.pod (revision 40530) +++ docs/pdds/pdd09_gc.pod (revision 40667) @@ -299,8 +299,7 @@ The Arenas structure contains pointers to a variety of memory pools, each used for a specific purpose. Two are Memory_Pool pointers (memory_pool, constant_string_pool), and six are Small_Object_Pool structures (pmc_pool, -pmc_ext_pool, constant_pmc_pool, buffer_header_pool, -constant_string_header_pool). +constant_pmc_pool, constant_string_header_pool). The Arenas structure holds function pointers for the core defined interface of the currently active GC subsystem: C, C, Index: tools/build/nativecall.pl =================================================================== --- tools/build/nativecall.pl (revision 40530) +++ tools/build/nativecall.pl (revision 40667) @@ -405,7 +405,7 @@ /b/ && do { push @{$temps_ref}, "STRING *t_$temp_num;"; push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_S($reg_num);"; - return "PObj_bufstart(t_$temp_num)"; + return "Buffer_bufstart(t_$temp_num)"; }; /B/ && do { push @{$temps_ref}, "char *s_$temp_num;\n char *t_$temp_num;\n void** v_$temp_num = (void **) &t_$temp_num;"; Index: include/parrot/hash.h =================================================================== --- include/parrot/hash.h (revision 40530) +++ include/parrot/hash.h (revision 40667) @@ -28,11 +28,12 @@ /* * hash_entry is currently unused in the hash structure - */ + typedef struct _hash_entry { HashEntryType type; UnionVal val; } HashEntry; +*/ /* A BucketIndex is an index into the pool of available buckets. */ typedef UINTVAL BucketIndex; @@ -42,7 +43,7 @@ #define HASH_ALLOC_SIZE(n) (N_BUCKETS(n) * sizeof (HashBucket) + \ (n) * sizeof (HashBucket *)) -typedef int (*hash_comp_fn)(PARROT_INTERP, const void*const, const void*const); +typedef int (*hash_comp_fn)(PARROT_INTERP, const void *const, const void *const); typedef void (*hash_mark_key_fn)(PARROT_INTERP, PObj *); typedef size_t (*hash_hash_key_fn)(PARROT_INTERP, ARGIN(const void *), size_t seed); Index: include/parrot/list.h =================================================================== --- include/parrot/list.h (revision 40530) +++ include/parrot/list.h (revision 40667) @@ -15,7 +15,7 @@ #define PARROT_LIST_H_GUARD typedef struct List_chunk { - Buffer data; /* item store */ + Buffer data; /* item store, Buffer must be first element in struct*/ struct List_chunk *next; struct List_chunk *prev; UINTVAL flags; /* chunk flags */ Index: include/parrot/gc_api.h =================================================================== --- include/parrot/gc_api.h (revision 40530) +++ include/parrot/gc_api.h (revision 40667) @@ -172,11 +172,6 @@ int Parrot_gc_active_sized_buffers(PARROT_INTERP) __attribute__nonnull__(1); -void Parrot_gc_add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc)) - __attribute__nonnull__(1) - __attribute__nonnull__(2) - FUNC_MODIFIES(*pmc); - void Parrot_gc_add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -232,14 +227,11 @@ void Parrot_gc_destroy_memory_pools(PARROT_INTERP) __attribute__nonnull__(1); -UINTVAL Parrot_gc_extended_pmcs(PARROT_INTERP) - __attribute__nonnull__(1); - void Parrot_gc_finalize(PARROT_INTERP) __attribute__nonnull__(1); void Parrot_gc_free_bufferlike_header(PARROT_INTERP, - ARGMOD(PObj *obj), + ARGMOD(Buffer *obj), size_t size) __attribute__nonnull__(1) __attribute__nonnull__(2) @@ -259,15 +251,15 @@ __attribute__nonnull__(2) FUNC_MODIFIES(*pmc); -void Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p)) +void Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2) - FUNC_MODIFIES(*p); + FUNC_MODIFIES(*pmc); -void Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc)) +void Parrot_gc_free_pmc_sync(PARROT_INTERP, ARGMOD(PMC *p)) __attribute__nonnull__(1) __attribute__nonnull__(2) - FUNC_MODIFIES(*pmc); + FUNC_MODIFIES(*p); void Parrot_gc_free_string_header(PARROT_INTERP, ARGMOD(STRING *s)) __attribute__nonnull__(1) @@ -376,9 +368,6 @@ #define ASSERT_ARGS_Parrot_gc_active_sized_buffers \ __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) -#define ASSERT_ARGS_Parrot_gc_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) \ - || PARROT_ASSERT_ARG(pmc) #define ASSERT_ARGS_Parrot_gc_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pmc) @@ -416,8 +405,6 @@ #define ASSERT_ARGS_Parrot_gc_destroy_memory_pools \ __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) -#define ASSERT_ARGS_Parrot_gc_extended_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) #define ASSERT_ARGS_Parrot_gc_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) #define ASSERT_ARGS_Parrot_gc_free_bufferlike_header \ @@ -431,12 +418,12 @@ #define ASSERT_ARGS_Parrot_gc_free_pmc_attributes __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pmc) -#define ASSERT_ARGS_Parrot_gc_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \ - PARROT_ASSERT_ARG(interp) \ - || PARROT_ASSERT_ARG(p) #define ASSERT_ARGS_Parrot_gc_free_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(pmc) +#define ASSERT_ARGS_Parrot_gc_free_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \ + PARROT_ASSERT_ARG(interp) \ + || PARROT_ASSERT_ARG(p) #define ASSERT_ARGS_Parrot_gc_free_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \ PARROT_ASSERT_ARG(interp) \ || PARROT_ASSERT_ARG(s) Index: include/parrot/pobj.h =================================================================== --- include/parrot/pobj.h (revision 40530) +++ include/parrot/pobj.h (revision 40667) @@ -15,47 +15,20 @@ #include "parrot/config.h" -typedef union UnionVal { - struct _b { /* One Buffer structure */ - void * _bufstart; - size_t _buflen; - } _b; - struct _ptrs { /* or two pointers, both are defines */ - DPOINTER * _struct_val; - PMC * _pmc_val; - } _ptrs; - struct _i { - INTVAL _int_val; /* or 2 intvals */ - INTVAL _int_val2; - } _i; - FLOATVAL _num_val; /* or one float */ - struct parrot_string_t * _string_val; /* or a pointer to a string */ -} UnionVal; - -#define UVal_ptr(u) (u)._ptrs._struct_val -#define UVal_pmc(u) (u)._ptrs._pmc_val -#define UVal_int(u) (u)._i._int_val -#define UVal_int2(u) (u)._i._int_val2 -#define UVal_num(u) (u)._num_val -#define UVal_str(u) (u)._string_val - /* Parrot Object - base class for all others */ typedef struct pobj_t { - UnionVal u; Parrot_UInt flags; -} pobj_t; +} PObj; -/* plain Buffer is the smallest Parrot Obj */ -typedef struct Buffer { - UnionVal cache; +typedef struct buffer_t { Parrot_UInt flags; + void * _bufstart; + size_t _buflen; } Buffer; -typedef Buffer PObj; +#define Buffer_bufstart(buffer) (buffer)->_bufstart +#define Buffer_buflen(buffer) (buffer)->_buflen -#define PObj_bufstart(pmc) (pmc)->cache._b._bufstart -#define PObj_buflen(pmc) (pmc)->cache._b._buflen - /* See src/gc/alloc_resources.c. the basic idea is that buffer memory is set up as follows: +-----------------+ @@ -84,24 +57,20 @@ v v v v */ -typedef struct Buffer_alloc_unit { - INTVAL ref_count; - UnionVal buffer[1]; /* Guarantee it's suitably aligned */ -} Buffer_alloc_unit; /* Given a pointer to the buffer, find the ref_count and the actual start of the allocated space. Setting ref_count is clunky because we avoid lvalue casts. */ #ifdef GC_IS_MALLOC /* see src/gc/res_lea.c */ # define Buffer_alloc_offset (offsetof(Buffer_alloc_unit, buffer)) -# define PObj_bufallocstart(b) ((char *)PObj_bufstart(b) - Buffer_alloc_offset) -# define PObj_bufrefcount(b) (((Buffer_alloc_unit *)PObj_bufallocstart(b))->ref_count) -# define PObj_bufrefcountptr(b) (&PObj_bufrefcount(b)) +# define Buffer_bufallocstart(b) ((char *)Buffer_bufstart(b) - Buffer_alloc_offset) +# define Buffer_bufrefcount(b) (((Buffer_alloc_unit *)Buffer_bufallocstart(b))->ref_count) +# define Buffer_bufrefcountptr(b) (&Buffer_bufrefcount(b)) #else /* see src/gc/alloc_resources.c */ # define Buffer_alloc_offset sizeof (INTVAL) -# define PObj_bufallocstart(b) ((char *)PObj_bufstart(b) - Buffer_alloc_offset) -# define PObj_bufrefcount(b) (*(INTVAL *)PObj_bufallocstart(b)) -# define PObj_bufrefcountptr(b) ((INTVAL *)PObj_bufallocstart(b)) +# define Buffer_bufallocstart(b) ((char *)Buffer_bufstart(b) - Buffer_alloc_offset) +# define Buffer_bufrefcount(b) (*(INTVAL *)Buffer_bufallocstart(b)) +# define Buffer_bufrefcountptr(b) ((INTVAL *)Buffer_bufallocstart(b)) #endif typedef enum { @@ -112,8 +81,9 @@ } parrot_string_representation_t; struct parrot_string_t { - UnionVal cache; Parrot_UInt flags; + void * _bufstart; + size_t _buflen; char *strstart; UINTVAL bufused; UINTVAL strlen; @@ -124,18 +94,14 @@ const struct _charset *charset; }; +struct _Sync; /* forward decl */ + /* note that cache and flags are isomorphic with Buffer and PObj */ struct PMC { - UnionVal cache; Parrot_UInt flags; VTABLE *vtable; DPOINTER *data; - struct PMC_EXT *pmc_ext; -}; -struct _Sync; /* forward decl */ - -typedef struct PMC_EXT { PMC *_metadata; /* properties */ /* * PMC access synchronization for shared PMCs @@ -160,21 +126,16 @@ stuff, which'd merit an extra dereference when setting, but let us memset the actual GC data in a big block */ -} PMC_EXT; +}; -#ifdef NDEBUG -# define PMC_ext_checked(pmc) (pmc)->pmc_ext -#else -# define PMC_ext_checked(pmc) (PARROT_ASSERT((pmc)->pmc_ext), (pmc)->pmc_ext) -#endif /* NDEBUG */ #define PMC_data(pmc) (pmc)->data #define PMC_data_typed(pmc, type) (type)(pmc)->data /* do not allow PMC_data2 as lvalue */ #define PMC_data0(pmc) (1 ? (pmc)->data : 0) #define PMC_data0_typed(pmc) (type)(1 ? (pmc)->data : 0) -#define PMC_metadata(pmc) PMC_ext_checked(pmc)->_metadata -#define PMC_next_for_GC(pmc) PMC_ext_checked(pmc)->_next_for_GC -#define PMC_sync(pmc) PMC_ext_checked(pmc)->_synchronize +#define PMC_metadata(pmc) ((pmc)->_metadata) +#define PMC_next_for_GC(pmc) ((pmc)->_next_for_GC) +#define PMC_sync(pmc) ((pmc)->_synchronize) #define POBJ_FLAG(n) ((UINTVAL)1 << (n)) /* PObj flags */ @@ -199,8 +160,6 @@ PObj_is_string_FLAG = POBJ_FLAG(8), /* PObj is a PMC */ PObj_is_PMC_FLAG = POBJ_FLAG(9), - /* the PMC has a PMC_EXT structure appended */ - PObj_is_PMC_EXT_FLAG = POBJ_FLAG(10), /* the PMC is a shared PMC */ PObj_is_PMC_shared_FLAG = POBJ_FLAG(11), /* Same as PObj_is_shared_FLAG */ /* PObj is otherwise shared */ @@ -333,7 +292,6 @@ if ((PObj_get_FLAGS(o) & \ (PObj_active_destroy_FLAG | \ PObj_custom_mark_FLAG | \ - PObj_is_PMC_EXT_FLAG | \ PObj_needs_early_gc_FLAG))) \ gc_flag_SET(is_special_PMC, o); \ else \ @@ -369,9 +327,6 @@ #define PObj_is_PMC_TEST(o) PObj_flag_TEST(is_PMC, o) -#define PObj_is_PMC_EXT_TEST(o) PObj_flag_TEST(is_PMC_EXT, o) -#define PObj_is_PMC_EXT_SET(o) PObj_special_SET(is_PMC_EXT, o) - #define PObj_is_PMC_shared_TEST(o) PObj_flag_TEST(is_PMC_shared, o) #define PObj_is_PMC_shared_SET(o) PObj_flag_SET(is_PMC_shared, o) #define PObj_is_PMC_shared_CLEAR(o) PObj_flag_CLEAR(is_PMC_shared, o) Index: include/parrot/call.h =================================================================== --- include/parrot/call.h (revision 40530) +++ include/parrot/call.h (revision 40667) @@ -70,10 +70,30 @@ INTVAL slurp_n; /* number of :flat/:slurpy args/params to match */ } call_state_item; +typedef union UnionCallStateVal { + struct _ptrs { /* or two pointers, both are defines */ + DPOINTER * _struct_val; + PMC * _pmc_val; + } _ptrs; + struct _i { + INTVAL _int_val; /* or 2 intvals */ + INTVAL _int_val2; + } _i; + FLOATVAL _num_val; /* or one float */ + struct parrot_string_t * _string_val; /* or a pointer to a string */ +} UnionCallStateVal; + +#define UVal_ptr(u) (u)._ptrs._struct_val +#define UVal_pmc(u) (u)._ptrs._pmc_val +#define UVal_int(u) (u)._i._int_val +#define UVal_int2(u) (u)._i._int_val2 +#define UVal_num(u) (u)._num_val +#define UVal_str(u) (u)._string_val + typedef struct call_state { call_state_item src; call_state_item dest; - UnionVal val; + UnionCallStateVal val; int n_actual_args; /* arguments incl. flatten */ int optionals; /* sum of optionals */ int params; /* sum of params */ Index: compilers/imcc/imcparser.c =================================================================== --- compilers/imcc/imcparser.c (revision 40530) +++ compilers/imcc/imcparser.c (revision 40667) @@ -3221,17 +3221,17 @@ { case 2: #line 1144 "compilers/imcc/imcc.y" - { if (yynerrs) YYABORT; (yyval.i) = 0; ;} + { if (yynerrs) YYABORT; (yyval.i) = 0; } break; case 5: #line 1153 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(1) - (1)].i); ;} + { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 6: #line 1154 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(1) - (1)].i); ;} + { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 7: @@ -3240,7 +3240,7 @@ (yyval.i) = (yyvsp[(1) - (1)].i); imc_close_unit(interp, IMCC_INFO(interp)->cur_unit); IMCC_INFO(interp)->cur_unit = 0; - ;} + } break; case 8: @@ -3249,32 +3249,32 @@ (yyval.i) = (yyvsp[(1) - (1)].i); imc_close_unit(interp, IMCC_INFO(interp)->cur_unit); IMCC_INFO(interp)->cur_unit = 0; - ;} + } break; case 9: #line 1167 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 10: #line 1168 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 11: #line 1169 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 12: #line 1170 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 13: #line 1174 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 14: @@ -3283,7 +3283,7 @@ (yyval.i) = 0; do_loadlib(interp, (yyvsp[(2) - (3)].s)); mem_sys_free((yyvsp[(2) - (3)].s)); - ;} + } break; case 15: @@ -3292,7 +3292,7 @@ IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s)); /* set_filename() frees the STRINGC */ set_filename(interp, (yyvsp[(4) - (5)].s)); - ;} + } break; case 16: @@ -3300,7 +3300,7 @@ { /* set_filename() frees the STRINGC */ set_filename(interp, (yyvsp[(2) - (3)].s)); - ;} + } break; case 17: @@ -3311,7 +3311,7 @@ SymReg * const key = mk_const(interp, (yyvsp[(2) - (4)].s), 'S'); (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, ".annotate", 2, key, (yyvsp[(4) - (4)].sr)); mem_sys_free((yyvsp[(2) - (4)].s)); - ;} + } break; case 18: @@ -3324,12 +3324,12 @@ IMCC_INFO(interp)->cur_namespace = NULL; mem_sys_free((yyvsp[(2) - (2)].s)); (yyval.t) = 0; - ;} + } break; case 19: #line 1223 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 20: @@ -3338,12 +3338,12 @@ mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1); mem_sys_free((yyvsp[(4) - (6)].s)); IMCC_INFO(interp)->is_def = 0; - ;} + } break; case 21: #line 1232 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 22: @@ -3352,12 +3352,12 @@ (yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s)); mem_sys_free((yyvsp[(6) - (6)].s)); IMCC_INFO(interp)->is_def = 0; - ;} + } break; case 23: #line 1239 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 24: @@ -3367,37 +3367,37 @@ mem_sys_free((yyvsp[(3) - (6)].s)); mem_sys_free((yyvsp[(6) - (6)].s)); IMCC_INFO(interp)->is_def = 0; - ;} + } break; case 29: #line 1258 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 30: #line 1259 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 31: #line 1260 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 32: #line 1261 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 33: #line 1262 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(1) - (1)].i); ;} + { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 36: #line 1267 "compilers/imcc/imcc.y" - { clear_state(interp); ;} + { clear_state(interp); } break; case 37: @@ -3407,7 +3407,7 @@ (yyvsp[(2) - (3)].s), 0, IMCC_INFO(interp)->regs, IMCC_INFO(interp)->nargs, IMCC_INFO(interp) -> keyvec, 1); mem_sys_free((yyvsp[(2) - (3)].s)); - ;} + } break; case 38: @@ -3415,7 +3415,7 @@ { imc_close_unit(interp, IMCC_INFO(interp)->cur_unit); IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); - ;} + } break; case 39: @@ -3426,14 +3426,14 @@ mk_sub_label(interp, (yyvsp[(4) - (4)].s))); IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(3) - (4)].t); mem_sys_free((yyvsp[(4) - (4)].s)); - ;} + } break; case 40: #line 1289 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); - ;} + } break; case 41: @@ -3449,17 +3449,17 @@ mem_sys_free(name); mem_sys_free((yyvsp[(2) - (4)].s)); mem_sys_free((yyvsp[(4) - (4)].s)); - ;} + } break; case 42: #line 1305 "compilers/imcc/imcc.y" - { (yyval.i) = 0;;} + { (yyval.i) = 0;} break; case 44: #line 1313 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); ;} + { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); } break; case 45: @@ -3470,7 +3470,7 @@ emit_flush(interp); */ (yyval.i) = 0; - ;} + } break; case 48: @@ -3485,33 +3485,33 @@ IMCC_INFO(interp)->cur_namespace = (yyvsp[(2) - (3)].sr); if (re_open) IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); - ;} + } break; case 49: #line 1347 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(2) - (3)].sr); - ;} + } break; case 50: #line 1350 "compilers/imcc/imcc.y" - { (yyval.sr) = NULL; ;} + { (yyval.sr) = NULL; } break; case 51: #line 1355 "compilers/imcc/imcc.y" { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB); - ;} + } break; case 52: #line 1359 "compilers/imcc/imcc.y" { iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr)); - ;} + } break; case 53: @@ -3522,22 +3522,22 @@ IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = mem_sys_strdup( IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->name); } - ;} + } break; case 54: #line 1371 "compilers/imcc/imcc.y" - { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;} + { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; } break; case 55: #line 1375 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 56: #line 1376 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 57: @@ -3550,17 +3550,17 @@ } else add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); - ;} + } break; case 58: #line 1390 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 59: #line 1390 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; ;} + { (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; } break; case 60: @@ -3572,12 +3572,12 @@ (yyval.sr) = mk_ident(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t)); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); mem_sys_free((yyvsp[(2) - (3)].s)); - ;} + } break; case 61: #line 1408 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 62: @@ -3586,7 +3586,7 @@ (yyval.t) = 0; IMCC_INFO(interp)->cur_unit->outer = mk_sub_address_fromc(interp, (yyvsp[(3) - (4)].s)); mem_sys_free((yyvsp[(3) - (4)].s)); - ;} + } break; case 63: @@ -3595,7 +3595,7 @@ (yyval.t) = 0; IMCC_INFO(interp)->cur_unit->outer = mk_const(interp, (yyvsp[(3) - (4)].s), 'S'); mem_sys_free((yyvsp[(3) - (4)].s)); - ;} + } break; case 64: @@ -3604,7 +3604,7 @@ (yyval.t) = P_VTABLE; IMCC_INFO(interp)->cur_unit->vtable_name = NULL; IMCC_INFO(interp)->cur_unit->is_vtable_method = 1; - ;} + } break; case 65: @@ -3613,7 +3613,7 @@ (yyval.t) = P_VTABLE; IMCC_INFO(interp)->cur_unit->vtable_name = (yyvsp[(3) - (4)].s); IMCC_INFO(interp)->cur_unit->is_vtable_method = 1; - ;} + } break; case 66: @@ -3622,7 +3622,7 @@ (yyval.t) = P_METHOD; IMCC_INFO(interp)->cur_unit->method_name = NULL; IMCC_INFO(interp)->cur_unit->is_method = 1; - ;} + } break; case 67: @@ -3631,7 +3631,7 @@ (yyval.t) = P_METHOD; IMCC_INFO(interp)->cur_unit->method_name = (yyvsp[(3) - (4)].s); IMCC_INFO(interp)->cur_unit->is_method = 1; - ;} + } break; case 68: @@ -3640,7 +3640,7 @@ (yyval.t) = 0; IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL; IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1; - ;} + } break; case 69: @@ -3649,7 +3649,7 @@ (yyval.t) = 0; IMCC_INFO(interp)->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s); IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1; - ;} + } break; case 70: @@ -3657,7 +3657,7 @@ { (yyval.t) = 0; IMCC_INFO(interp)->cur_unit->instance_of = (yyvsp[(3) - (4)].s); - ;} + } break; case 71: @@ -3665,7 +3665,7 @@ { (yyval.t) = 0; IMCC_INFO(interp)->cur_unit->subid = NULL; - ;} + } break; case 72: @@ -3675,14 +3675,14 @@ IMCC_INFO(interp)->cur_unit->subid = mk_const(interp, (yyvsp[(3) - (4)].s), 'S'); IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = str_dup_remove_quotes((yyvsp[(3) - (4)].s)); mem_sys_free((yyvsp[(3) - (4)].s)); - ;} + } break; case 73: #line 1496 "compilers/imcc/imcc.y" { add_pcc_multi(IMCC_INFO(interp)->cur_call, NULL); - ;} + } break; case 74: @@ -3690,7 +3690,7 @@ { (yyval.t) = 0; add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr)); - ;} + } break; case 75: @@ -3698,27 +3698,27 @@ { (yyval.t) = 0; add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr)); - ;} + } break; case 76: #line 1512 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, "INTVAL", 'S'); ;} + { (yyval.sr) = mk_const(interp, "INTVAL", 'S'); } break; case 77: #line 1513 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); ;} + { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); } break; case 78: #line 1514 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, "PMC", 'S'); ;} + { (yyval.sr) = mk_const(interp, "PMC", 'S'); } break; case 79: #line 1515 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, "STRING", 'S'); ;} + { (yyval.sr) = mk_const(interp, "STRING", 'S'); } break; case 80: @@ -3732,7 +3732,7 @@ } mem_sys_free((yyvsp[(1) - (1)].s)); (yyval.sr) = r; - ;} + } break; case 81: @@ -3746,12 +3746,12 @@ } mem_sys_free((yyvsp[(1) - (1)].s)); (yyval.sr) = r; - ;} + } break; case 82: #line 1538 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(2) - (3)].sr); ;} + { (yyval.sr) = (yyvsp[(2) - (3)].sr); } break; case 85: @@ -3778,82 +3778,82 @@ r1 = IMCC_INFO(interp)->cur_unit->instructions->symregs[0]; if (r1 && r1->pcc_sub) r1->pcc_sub->calls_a_sub |= 1; - ;} + } break; case 86: #line 1576 "compilers/imcc/imcc.y" - { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;} + { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; } break; case 87: #line 1580 "compilers/imcc/imcc.y" - { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; ;} + { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; } break; case 88: #line 1581 "compilers/imcc/imcc.y" - { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; ;} + { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; } break; case 89: #line 1585 "compilers/imcc/imcc.y" - { (yyval.i) = NULL; ;} + { (yyval.i) = NULL; } break; case 90: #line 1586 "compilers/imcc/imcc.y" - { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); ;} + { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); } break; case 91: #line 1590 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 93: #line 1595 "compilers/imcc/imcc.y" - { (yyval.t) = (yyvsp[(1) - (1)].t); ;} + { (yyval.t) = (yyvsp[(1) - (1)].t); } break; case 94: #line 1596 "compilers/imcc/imcc.y" - { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;} + { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } break; case 95: #line 1600 "compilers/imcc/imcc.y" - { (yyval.t) = P_LOAD; ;} + { (yyval.t) = P_LOAD; } break; case 96: #line 1601 "compilers/imcc/imcc.y" - { (yyval.t) = P_INIT; ;} + { (yyval.t) = P_INIT; } break; case 97: #line 1602 "compilers/imcc/imcc.y" - { (yyval.t) = P_MAIN; ;} + { (yyval.t) = P_MAIN; } break; case 98: #line 1603 "compilers/imcc/imcc.y" - { (yyval.t) = P_IMMEDIATE; ;} + { (yyval.t) = P_IMMEDIATE; } break; case 99: #line 1604 "compilers/imcc/imcc.y" - { (yyval.t) = P_POSTCOMP; ;} + { (yyval.t) = P_POSTCOMP; } break; case 100: #line 1605 "compilers/imcc/imcc.y" - { (yyval.t) = P_ANON; ;} + { (yyval.t) = P_ANON; } break; case 101: #line 1606 "compilers/imcc/imcc.y" - { (yyval.t) = P_NEED_LEX; ;} + { (yyval.t) = P_NEED_LEX; } break; case 109: @@ -3861,14 +3861,14 @@ { add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr)); add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr)); - ;} + } break; case 110: #line 1623 "compilers/imcc/imcc.y" { add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); - ;} + } break; case 111: @@ -3876,21 +3876,21 @@ { add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI; - ;} + } break; case 112: #line 1632 "compilers/imcc/imcc.y" { add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); - ;} + } break; case 113: #line 1636 "compilers/imcc/imcc.y" { add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S')); - ;} + } break; case 114: @@ -3898,7 +3898,7 @@ { add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr)); add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr)); - ;} + } break; case 115: @@ -3906,27 +3906,27 @@ { add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S')); add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr)); - ;} + } break; case 116: #line 1653 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 117: #line 1654 "compilers/imcc/imcc.y" - { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); ;} + { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); } break; case 118: #line 1658 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(2) - (2)].sr); ;} + { (yyval.sr) = (yyvsp[(2) - (2)].sr); } break; case 119: #line 1663 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 120: @@ -3934,17 +3934,17 @@ { if ((yyvsp[(2) - (3)].sr)) add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); - ;} + } break; case 121: #line 1672 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;} + { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } break; case 122: #line 1673 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 123: @@ -3959,62 +3959,62 @@ UNUSED(ignored); IMCC_INFO(interp)->is_def = 0; (yyval.sr) = 0; - ;} + } break; case 124: #line 1688 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 125: #line 1689 "compilers/imcc/imcc.y" - { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;} + { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } break; case 126: #line 1693 "compilers/imcc/imcc.y" - { (yyval.t) = VT_FLAT; ;} + { (yyval.t) = VT_FLAT; } break; case 127: #line 1694 "compilers/imcc/imcc.y" - { (yyval.t) = VT_OPTIONAL; ;} + { (yyval.t) = VT_OPTIONAL; } break; case 128: #line 1695 "compilers/imcc/imcc.y" - { (yyval.t) = VT_OPT_FLAG; ;} + { (yyval.t) = VT_OPT_FLAG; } break; case 129: #line 1696 "compilers/imcc/imcc.y" - { (yyval.t) = VT_NAMED; ;} + { (yyval.t) = VT_NAMED; } break; case 130: #line 1697 "compilers/imcc/imcc.y" - { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;} + { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); } break; case 131: #line 1698 "compilers/imcc/imcc.y" - { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;} + { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); } break; case 132: #line 1699 "compilers/imcc/imcc.y" - { (yyval.t) = VT_UNIQUE_REG; ;} + { (yyval.t) = VT_UNIQUE_REG; } break; case 133: #line 1704 "compilers/imcc/imcc.y" - { begin_return_or_yield(interp, 0); ;} + { begin_return_or_yield(interp, 0); } break; case 134: #line 1706 "compilers/imcc/imcc.y" - { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;} + { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; } break; case 135: @@ -4022,22 +4022,22 @@ { IMCC_INFO(interp)->asm_state = AsmDefault; (yyval.i) = 0; - ;} + } break; case 136: #line 1715 "compilers/imcc/imcc.y" - { begin_return_or_yield(interp, 1); ;} + { begin_return_or_yield(interp, 1); } break; case 137: #line 1717 "compilers/imcc/imcc.y" - { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;} + { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; } break; case 138: #line 1721 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 139: @@ -4045,7 +4045,7 @@ { if ((yyvsp[(1) - (2)].sr)) add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr)); - ;} + } break; case 140: @@ -4053,12 +4053,12 @@ { if ((yyvsp[(2) - (3)].sr)) add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr)); - ;} + } break; case 141: #line 1735 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 142: @@ -4066,7 +4066,7 @@ { if ((yyvsp[(1) - (2)].sr)) add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr)); - ;} + } break; case 143: @@ -4074,17 +4074,17 @@ { if ((yyvsp[(2) - (3)].sr)) add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr)); - ;} + } break; case 144: #line 1749 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;} + { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } break; case 145: #line 1753 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;} + { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } break; case 146: @@ -4092,7 +4092,7 @@ { if (IMCC_INFO(interp)->asm_state == AsmDefault) begin_return_or_yield(interp, (yyvsp[(1) - (2)].t)); - ;} + } break; case 147: @@ -4100,22 +4100,22 @@ { IMCC_INFO(interp)->asm_state = AsmDefault; (yyval.t) = 0; - ;} + } break; case 148: #line 1770 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 149: #line 1771 "compilers/imcc/imcc.y" - { (yyval.t) = 1; ;} + { (yyval.t) = 1; } break; case 150: #line 1775 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 151: @@ -4128,7 +4128,7 @@ } else add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (1)].sr)); - ;} + } break; case 152: @@ -4136,7 +4136,7 @@ { SymReg * const name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S'); add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(3) - (3)].sr)); - ;} + } break; case 153: @@ -4149,7 +4149,7 @@ } else add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(3) - (3)].sr)); - ;} + } break; case 154: @@ -4157,47 +4157,47 @@ { SymReg * const name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S'); add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(5) - (5)].sr)); - ;} + } break; case 157: #line 1823 "compilers/imcc/imcc.y" - { clear_state(interp); ;} + { clear_state(interp); } break; case 158: #line 1828 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(2) - (2)].i); ;} + { (yyval.i) = (yyvsp[(2) - (2)].i); } break; case 159: #line 1829 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 160: #line 1830 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 161: #line 1831 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 162: #line 1832 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 163: #line 1833 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(1) - (1)].i); ;} + { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 164: #line 1837 "compilers/imcc/imcc.y" - { (yyval.i) = NULL; ;} + { (yyval.i) = NULL; } break; case 168: @@ -4206,12 +4206,12 @@ Instruction * const i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s))); mem_sys_free((yyvsp[(1) - (1)].s)); (yyval.i) = i; - ;} + } break; case 169: #line 1858 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(2) - (3)].i); ;} + { (yyval.i) = (yyvsp[(2) - (3)].i); } break; case 170: @@ -4222,7 +4222,7 @@ YYABORT; } yyerrok; - ;} + } break; case 171: @@ -4231,7 +4231,7 @@ IdList* const l = (yyvsp[(1) - (1)].idlist); l->next = NULL; (yyval.idlist) = l; - ;} + } break; case 172: @@ -4240,7 +4240,7 @@ IdList* const l = (yyvsp[(3) - (3)].idlist); l->next = (yyvsp[(1) - (3)].idlist); (yyval.idlist) = l; - ;} + } break; case 173: @@ -4250,22 +4250,22 @@ l->id = (yyvsp[(1) - (2)].s); l->unique_reg = (yyvsp[(2) - (2)].t); (yyval.idlist) = l; - ;} + } break; case 174: #line 1896 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 175: #line 1897 "compilers/imcc/imcc.y" - { (yyval.t) = 1; ;} + { (yyval.t) = 1; } break; case 178: #line 1904 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 179: @@ -4284,7 +4284,7 @@ mem_sys_free(l1); } IMCC_INFO(interp)->is_def = 0; (yyval.i) = 0; - ;} + } break; case 180: @@ -4297,7 +4297,7 @@ set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0; mem_sys_free((yyvsp[(2) - (4)].s)); mem_sys_free(name); - ;} + } break; case 181: @@ -4306,12 +4306,12 @@ SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U'); set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0; mem_sys_free((yyvsp[(2) - (4)].s)); - ;} + } break; case 182: #line 1936 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 183: @@ -4320,12 +4320,12 @@ mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0); IMCC_INFO(interp)->is_def = 0; mem_sys_free((yyvsp[(4) - (6)].s)); - ;} + } break; case 185: #line 1944 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->is_def = 1; ;} + { IMCC_INFO(interp)->is_def = 1; } break; case 186: @@ -4334,7 +4334,7 @@ mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1); IMCC_INFO(interp)->is_def = 0; mem_sys_free((yyvsp[(4) - (6)].s)); - ;} + } break; case 187: @@ -4343,14 +4343,14 @@ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isTAIL_CALL; IMCC_INFO(interp)->cur_call = NULL; - ;} + } break; case 188: #line 1957 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr)); - ;} + } break; case 189: @@ -4365,47 +4365,47 @@ IMCC_INFO(interp)->keyvec, 1); mem_sys_free((yyvsp[(1) - (2)].s)); - ;} + } break; case 190: #line 1972 "compilers/imcc/imcc.y" - { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); ;} + { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); } break; case 191: #line 1973 "compilers/imcc/imcc.y" - { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;} + { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; } break; case 192: #line 1974 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 195: #line 1977 "compilers/imcc/imcc.y" - { (yyval.i) = 0;;} + { (yyval.i) = 0;} break; case 196: #line 1981 "compilers/imcc/imcc.y" - { (yyval.t) = 'I'; ;} + { (yyval.t) = 'I'; } break; case 197: #line 1982 "compilers/imcc/imcc.y" - { (yyval.t) = 'N'; ;} + { (yyval.t) = 'N'; } break; case 198: #line 1983 "compilers/imcc/imcc.y" - { (yyval.t) = 'S'; ;} + { (yyval.t) = 'S'; } break; case 199: #line 1984 "compilers/imcc/imcc.y" - { (yyval.t) = 'P'; ;} + { (yyval.t) = 'P'; } break; case 200: @@ -4418,37 +4418,37 @@ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Unknown PMC type '%s'\n", (yyvsp[(1) - (1)].s)); } - ;} + } break; case 201: #line 2002 "compilers/imcc/imcc.y" - { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); ;} + { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); } break; case 202: #line 2004 "compilers/imcc/imcc.y" - { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); ;} + { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); } break; case 203: #line 2006 "compilers/imcc/imcc.y" - { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); ;} + { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); } break; case 204: #line 2008 "compilers/imcc/imcc.y" - { (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); ;} + { (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); } break; case 205: #line 2010 "compilers/imcc/imcc.y" - { (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); ;} + { (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); } break; case 206: #line 2015 "compilers/imcc/imcc.y" - { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); ;} + { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); } break; case 207: @@ -4457,14 +4457,14 @@ add_pcc_result((yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr)); IMCC_INFO(interp)->cur_call = NULL; (yyval.i) = 0; - ;} + } break; case 208: #line 2024 "compilers/imcc/imcc.y" { (yyval.i) = IMCC_create_itcall_label(interp); - ;} + } break; case 209: @@ -4472,144 +4472,144 @@ { IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr)); IMCC_INFO(interp)->cur_call = NULL; - ;} + } break; case 213: #line 2036 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr)); - ;} + } break; case 214: #line 2043 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"not"; ;} + { (yyval.s) = (char *)"not"; } break; case 215: #line 2044 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"bnot"; ;} + { (yyval.s) = (char *)"bnot"; } break; case 216: #line 2045 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"neg"; ;} + { (yyval.s) = (char *)"neg"; } break; case 217: #line 2049 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"sub"; ;} + { (yyval.s) = (char *)"sub"; } break; case 218: #line 2050 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"add"; ;} + { (yyval.s) = (char *)"add"; } break; case 219: #line 2051 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"mul"; ;} + { (yyval.s) = (char *)"mul"; } break; case 220: #line 2052 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"div"; ;} + { (yyval.s) = (char *)"div"; } break; case 221: #line 2053 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"mod"; ;} + { (yyval.s) = (char *)"mod"; } break; case 222: #line 2054 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"fdiv"; ;} + { (yyval.s) = (char *)"fdiv"; } break; case 223: #line 2055 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"pow"; ;} + { (yyval.s) = (char *)"pow"; } break; case 224: #line 2056 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"concat"; ;} + { (yyval.s) = (char *)"concat"; } break; case 225: #line 2057 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"iseq"; ;} + { (yyval.s) = (char *)"iseq"; } break; case 226: #line 2058 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"isne"; ;} + { (yyval.s) = (char *)"isne"; } break; case 227: #line 2059 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"isgt"; ;} + { (yyval.s) = (char *)"isgt"; } break; case 228: #line 2060 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"isge"; ;} + { (yyval.s) = (char *)"isge"; } break; case 229: #line 2061 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"islt"; ;} + { (yyval.s) = (char *)"islt"; } break; case 230: #line 2062 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"isle"; ;} + { (yyval.s) = (char *)"isle"; } break; case 231: #line 2063 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"shl"; ;} + { (yyval.s) = (char *)"shl"; } break; case 232: #line 2064 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"shr"; ;} + { (yyval.s) = (char *)"shr"; } break; case 233: #line 2065 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"lsr"; ;} + { (yyval.s) = (char *)"lsr"; } break; case 234: #line 2066 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"and"; ;} + { (yyval.s) = (char *)"and"; } break; case 235: #line 2067 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"or"; ;} + { (yyval.s) = (char *)"or"; } break; case 236: #line 2068 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"xor"; ;} + { (yyval.s) = (char *)"xor"; } break; case 237: #line 2069 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"band"; ;} + { (yyval.s) = (char *)"band"; } break; case 238: #line 2070 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"bor"; ;} + { (yyval.s) = (char *)"bor"; } break; case 239: #line 2071 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"bxor"; ;} + { (yyval.s) = (char *)"bxor"; } break; case 240: @@ -4618,84 +4618,84 @@ (yyval.i) = IMCC_create_itcall_label(interp); (yyval.i)->type &= ~ITCALL; (yyval.i)->type |= ITRESULT; - ;} + } break; case 241: #line 2082 "compilers/imcc/imcc.y" - { (yyval.i) = 0; ;} + { (yyval.i) = 0; } break; case 242: #line 2089 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); - ;} + } break; case 243: #line 2095 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"add"; ;} + { (yyval.s) = (char *)"add"; } break; case 244: #line 2096 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"sub"; ;} + { (yyval.s) = (char *)"sub"; } break; case 245: #line 2097 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"mul"; ;} + { (yyval.s) = (char *)"mul"; } break; case 246: #line 2098 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"div"; ;} + { (yyval.s) = (char *)"div"; } break; case 247: #line 2099 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"mod"; ;} + { (yyval.s) = (char *)"mod"; } break; case 248: #line 2100 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"fdiv"; ;} + { (yyval.s) = (char *)"fdiv"; } break; case 249: #line 2101 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"concat"; ;} + { (yyval.s) = (char *)"concat"; } break; case 250: #line 2102 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"band"; ;} + { (yyval.s) = (char *)"band"; } break; case 251: #line 2103 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"bor"; ;} + { (yyval.s) = (char *)"bor"; } break; case 252: #line 2104 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"bxor"; ;} + { (yyval.s) = (char *)"bxor"; } break; case 253: #line 2105 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"shr"; ;} + { (yyval.s) = (char *)"shr"; } break; case 254: #line 2106 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"shl"; ;} + { (yyval.s) = (char *)"shl"; } break; case 255: #line 2107 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"lsr"; ;} + { (yyval.s) = (char *)"lsr"; } break; case 256: @@ -4706,22 +4706,22 @@ IMCC_INFO(interp) -> nargs, IMCC_INFO(interp) -> keyvec, 1); mem_sys_free((yyvsp[(3) - (4)].s)); - ;} + } break; case 257: #line 2123 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 258: #line 2124 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 259: #line 2125 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 260: @@ -4730,7 +4730,7 @@ (yyval.sr) = (yyvsp[(1) - (1)].sr); if ((yyvsp[(1) - (1)].sr)->set != 'P') IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Sub isn't a PMC"); - ;} + } break; case 261: @@ -4747,7 +4747,7 @@ IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); - ;} + } break; case 262: @@ -4756,7 +4756,7 @@ IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'U'); mem_sys_free((yyvsp[(3) - (3)].s)); - ;} + } break; case 263: @@ -4765,12 +4765,12 @@ IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'S'); mem_sys_free((yyvsp[(3) - (3)].s)); - ;} + } break; case 264: #line 2158 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); ;} + { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); } break; case 265: @@ -4778,17 +4778,17 @@ { (yyval.i) = IMCC_create_itcall_label(interp); IMCC_itcall_sub(interp, (yyvsp[(1) - (1)].sr)); - ;} + } break; case 266: #line 2168 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(2) - (5)].i); ;} + { (yyval.i) = (yyvsp[(2) - (5)].i); } break; case 267: #line 2172 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 268: @@ -4801,7 +4801,7 @@ } else add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr)); - ;} + } break; case 269: @@ -4814,7 +4814,7 @@ } else add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr)); - ;} + } break; case 270: @@ -4824,7 +4824,7 @@ add_pcc_named_arg(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr)); mem_sys_free((yyvsp[(3) - (5)].s)); - ;} + } break; case 271: @@ -4832,7 +4832,7 @@ { (yyval.sr) = 0; add_pcc_named_arg_var(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); - ;} + } break; case 272: @@ -4842,47 +4842,47 @@ add_pcc_named_arg(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr)); mem_sys_free((yyvsp[(1) - (3)].s)); - ;} + } break; case 273: #line 2215 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;} + { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); } break; case 274: #line 2219 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 275: #line 2220 "compilers/imcc/imcc.y" - { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;} + { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } break; case 276: #line 2224 "compilers/imcc/imcc.y" - { (yyval.t) = VT_FLAT; ;} + { (yyval.t) = VT_FLAT; } break; case 277: #line 2225 "compilers/imcc/imcc.y" - { (yyval.t) = VT_NAMED; ;} + { (yyval.t) = VT_NAMED; } break; case 278: #line 2228 "compilers/imcc/imcc.y" - { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;} + { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; } break; case 279: #line 2229 "compilers/imcc/imcc.y" - { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;} + { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; } break; case 280: #line 2233 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;} + { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); } break; case 281: @@ -4895,7 +4895,7 @@ } else add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr)); - ;} + } break; case 282: @@ -4904,7 +4904,7 @@ add_pcc_named_result(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr)); mem_sys_free((yyvsp[(3) - (5)].s)); - ;} + } break; case 283: @@ -4917,7 +4917,7 @@ } else add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr)); - ;} + } break; case 284: @@ -4925,124 +4925,124 @@ { add_pcc_named_result(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr)); mem_sys_free((yyvsp[(1) - (3)].s)); - ;} + } break; case 285: #line 2268 "compilers/imcc/imcc.y" - { (yyval.sr) = 0; ;} + { (yyval.sr) = 0; } break; case 286: #line 2272 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(1) - (1)].i); ;} + { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 287: #line 2273 "compilers/imcc/imcc.y" - { (yyval.i) = (yyvsp[(1) - (1)].i); ;} + { (yyval.i) = (yyvsp[(1) - (1)].i); } break; case 288: #line 2278 "compilers/imcc/imcc.y" { (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); - ;} + } break; case 289: #line 2282 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); - ;} + } break; case 290: #line 2286 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); - ;} + } break; case 291: #line 2293 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); - ;} + } break; case 292: #line 2297 "compilers/imcc/imcc.y" { (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); - ;} + } break; case 293: #line 2301 "compilers/imcc/imcc.y" { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); - ;} + } break; case 294: #line 2307 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 295: #line 2308 "compilers/imcc/imcc.y" - { (yyval.t) = 0; ;} + { (yyval.t) = 0; } break; case 296: #line 2312 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"eq"; ;} + { (yyval.s) = (char *)"eq"; } break; case 297: #line 2313 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"ne"; ;} + { (yyval.s) = (char *)"ne"; } break; case 298: #line 2314 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"gt"; ;} + { (yyval.s) = (char *)"gt"; } break; case 299: #line 2315 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"ge"; ;} + { (yyval.s) = (char *)"ge"; } break; case 300: #line 2316 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"lt"; ;} + { (yyval.s) = (char *)"lt"; } break; case 301: #line 2317 "compilers/imcc/imcc.y" - { (yyval.s) = (char *)"le"; ;} + { (yyval.s) = (char *)"le"; } break; case 304: #line 2326 "compilers/imcc/imcc.y" - { (yyval.sr) = NULL; ;} + { (yyval.sr) = NULL; } break; case 305: #line 2327 "compilers/imcc/imcc.y" - { (yyval.sr) = (yyvsp[(1) - (1)].sr); ;} + { (yyval.sr) = (yyvsp[(1) - (1)].sr); } break; case 306: #line 2331 "compilers/imcc/imcc.y" - { (yyval.sr) = IMCC_INFO(interp)->regs[0]; ;} + { (yyval.sr) = IMCC_INFO(interp)->regs[0]; } break; case 308: #line 2336 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); ;} + { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); } break; case 309: @@ -5052,7 +5052,7 @@ IMCC_INFO(interp) -> keyvec |= KEY_BIT(IMCC_INFO(interp)->nargs); IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(3) - (4)].sr); (yyval.sr) = (yyvsp[(1) - (4)].sr); - ;} + } break; case 310: @@ -5060,44 +5060,44 @@ { IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr); (yyval.sr) = (yyvsp[(2) - (3)].sr); - ;} + } break; case 312: #line 2352 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 313: #line 2353 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 314: #line 2357 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 315: #line 2358 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 316: #line 2362 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 317: #line 2363 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 322: #line 2377 "compilers/imcc/imcc.y" { IMCC_INFO(interp)->nkeys = 0; - ;} + } break; case 323: @@ -5106,14 +5106,14 @@ (yyval.sr) = link_keys(interp, IMCC_INFO(interp)->nkeys, IMCC_INFO(interp)->keys, 0); - ;} + } break; case 324: #line 2389 "compilers/imcc/imcc.y" { IMCC_INFO(interp)->nkeys = 0; - ;} + } break; case 325: @@ -5122,12 +5122,12 @@ (yyval.sr) = link_keys(interp, IMCC_INFO(interp)->nkeys, IMCC_INFO(interp)->keys, 1); - ;} + } break; case 326: #line 2401 "compilers/imcc/imcc.y" - { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); ;} + { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); } break; case 327: @@ -5135,59 +5135,59 @@ { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr); (yyval.sr) = IMCC_INFO(interp)->keys[0]; - ;} + } break; case 328: #line 2411 "compilers/imcc/imcc.y" { (yyval.sr) = (yyvsp[(1) - (1)].sr); - ;} + } break; case 329: #line 2417 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); ;} + { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); } break; case 330: #line 2418 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); ;} + { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); } break; case 331: #line 2419 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); ;} + { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); } break; case 332: #line 2420 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); ;} + { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); } break; case 333: #line 2421 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 334: #line 2425 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 335: #line 2426 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 336: #line 2427 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; case 337: #line 2428 "compilers/imcc/imcc.y" - { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); ;} + { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); } break; Index: t/pmc/complex.t =================================================================== --- t/pmc/complex.t (revision 40530) +++ t/pmc/complex.t (revision 40667) @@ -732,7 +732,7 @@ .complex_op_is("-2+0i", "0.693147+3.141593i", 'ln' ) .complex_op_is("-1+0i", "0.000000+3.141593i", 'ln' ) .complex_op_is("-0.5+0i", "-0.693147+3.141593i", 'ln' ) - .complex_op_is("0.5+0i", "-0.693147+0.000000i", 'ln' ) + #.complex_op_is("0.5+0i", "-0.693147+0.000000i", 'ln' ) .complex_op_is("1+0i", "0.000000+0.000000i", 'ln' ) .complex_op_is("2+0i", "0.693147+0.000000i", 'ln' ) .complex_op_is("0-2i", "0.693147-1.570796i", 'ln' )