Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2010-10-09 15:28:52 -07:00
commit 809f4ee396
7 changed files with 16 additions and 14 deletions

View File

@ -69,12 +69,10 @@ CONSTANT: SOCK_RAW 3
CONSTANT: AF_UNSPEC 0 CONSTANT: AF_UNSPEC 0
CONSTANT: AF_UNIX 1 CONSTANT: AF_UNIX 1
CONSTANT: AF_INET 2 CONSTANT: AF_INET 2
CONSTANT: AF_INET6 30
ALIAS: PF_UNSPEC AF_UNSPEC ALIAS: PF_UNSPEC AF_UNSPEC
ALIAS: PF_UNIX AF_UNIX ALIAS: PF_UNIX AF_UNIX
ALIAS: PF_INET AF_INET ALIAS: PF_INET AF_INET
ALIAS: PF_INET6 AF_INET6
CONSTANT: IPPROTO_TCP 6 CONSTANT: IPPROTO_TCP 6
CONSTANT: IPPROTO_UDP 17 CONSTANT: IPPROTO_UDP 17

View File

@ -1,6 +1,9 @@
USING: alien.c-types alien.syntax classes.struct unix.types ; USING: alien.c-types alien.syntax classes.struct unix.types ;
IN: unix.ffi IN: unix.ffi
CONSTANT: AF_INET6 28
ALIAS: PF_INET6 AF_INET6
CONSTANT: FD_SETSIZE 1024 CONSTANT: FD_SETSIZE 1024
STRUCT: addrinfo STRUCT: addrinfo

View File

@ -1,6 +1,9 @@
USING: alien.c-types alien.syntax classes.struct unix.types ; USING: alien.c-types alien.syntax classes.struct unix.types ;
IN: unix.ffi IN: unix.ffi
CONSTANT: AF_INET6 24
ALIAS: PF_INET6 AF_INET6
CONSTANT: FD_SETSIZE 1024 CONSTANT: FD_SETSIZE 1024
STRUCT: addrinfo STRUCT: addrinfo

View File

@ -230,8 +230,8 @@ struct call_frame_scrubber {
gc_info *info = compiled->block_gc_info(); gc_info *info = compiled->block_gc_info();
assert(return_address < compiled->size()); assert(return_address < compiled->size());
int index = info->return_address_index(return_address); cell index = info->return_address_index(return_address);
if(index != -1) if(index != (cell)-1)
ctx->scrub_stacks(info,index); ctx->scrub_stacks(info,index);
} }
}; };

View File

@ -13,7 +13,7 @@ cell gc_info::return_address_index(cell return_address)
return i; return i;
} }
return gc_info_missing_value; return (cell)-1;
} }
} }

View File

@ -1,8 +1,6 @@
namespace factor namespace factor
{ {
const u32 gc_info_missing_value = (u32)-1;
struct gc_info { struct gc_info {
u32 scrub_d_count; u32 scrub_d_count;
u32 scrub_r_count; u32 scrub_r_count;
@ -58,7 +56,7 @@ struct gc_info {
+ index * gc_root_count; + index * gc_root_count;
} }
cell lookup_base_pointer(cell index, cell derived_root) u32 lookup_base_pointer(cell index, cell derived_root)
{ {
return base_pointer_map()[index * derived_root_count + derived_root]; return base_pointer_map()[index * derived_root_count + derived_root];
} }

View File

@ -292,8 +292,8 @@ struct call_frame_slot_visitor {
gc_info *info = compiled->block_gc_info(); gc_info *info = compiled->block_gc_info();
assert(return_address < compiled->size()); assert(return_address < compiled->size());
u32 callsite = info->return_address_index(return_address); cell callsite = info->return_address_index(return_address);
if(callsite == gc_info_missing_value) if(callsite == (cell)-1)
return; return;
#ifdef DEBUG_GC_MAPS #ifdef DEBUG_GC_MAPS
@ -305,8 +305,8 @@ struct call_frame_slot_visitor {
/* Subtract old value of base pointer from every derived pointer. */ /* Subtract old value of base pointer from every derived pointer. */
for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++) for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++)
{ {
cell base_pointer = info->lookup_base_pointer(callsite, spill_slot); u32 base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if(base_pointer != gc_info_missing_value) if(base_pointer != (u32)-1)
{ {
#ifdef DEBUG_GC_MAPS #ifdef DEBUG_GC_MAPS
std::cout << "visiting derived root " << spill_slot std::cout << "visiting derived root " << spill_slot
@ -334,8 +334,8 @@ struct call_frame_slot_visitor {
/* Add the base pointers to obtain new derived pointer values. */ /* Add the base pointers to obtain new derived pointer values. */
for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++) for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++)
{ {
cell base_pointer = info->lookup_base_pointer(callsite, spill_slot); u32 base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if(base_pointer != gc_info_missing_value) if(base_pointer != (u32)-1)
stack_pointer[spill_slot] += stack_pointer[base_pointer]; stack_pointer[spill_slot] += stack_pointer[base_pointer];
} }
} }