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

db4
Joe Groff 2009-11-08 21:00:46 -06:00
commit 4bb95b60ec
4 changed files with 21 additions and 8 deletions

View File

@ -3,7 +3,8 @@ classes.tuple classes.union compiler.units continuations
definitions eval generic generic.math generic.standard definitions eval generic generic.math generic.standard
hashtables io io.streams.string kernel layouts math math.order hashtables io io.streams.string kernel layouts math math.order
namespaces parser prettyprint quotations sequences sorting namespaces parser prettyprint quotations sequences sorting
strings tools.test vectors words generic.single ; strings tools.test vectors words generic.single
compiler.crossref ;
IN: generic.tests IN: generic.tests
GENERIC: foobar ( x -- y ) GENERIC: foobar ( x -- y )

View File

@ -1,7 +1,7 @@
USING: arrays generic assocs kernel math namespaces USING: arrays generic assocs kernel math namespaces
sequences tools.test words definitions parser quotations sequences tools.test words definitions parser quotations
vocabs continuations classes.tuple compiler.units vocabs continuations classes.tuple compiler.units
io.streams.string accessors eval words.symbol ; io.streams.string accessors eval words.symbol grouping ;
IN: words.tests IN: words.tests
[ 4 ] [ [ 4 ] [
@ -121,7 +121,7 @@ DEFER: x
[ { } ] [ { } ]
[ [
all-words [ all-words [
"compiled-uses" word-prop "compiled-uses" word-prop 2 <groups>
keys [ "forgotten" word-prop ] filter keys [ "forgotten" word-prop ] filter
] map harvest ] map harvest
] unit-test ] unit-test

View File

@ -3,6 +3,20 @@
namespace factor namespace factor
{ {
context::context(cell ds_size, cell rs_size) :
callstack_top(NULL),
callstack_bottom(NULL),
datastack(0),
retainstack(0),
datastack_save(0),
retainstack_save(0),
magic_frame(NULL),
datastack_region(new segment(ds_size,false)),
retainstack_region(new segment(rs_size,false)),
catchstack_save(0),
current_callback_save(0),
next(NULL) {}
void factor_vm::reset_datastack() void factor_vm::reset_datastack()
{ {
ds = ds_bot - sizeof(cell); ds = ds_bot - sizeof(cell);
@ -42,11 +56,7 @@ context *factor_vm::alloc_context()
unused_contexts = unused_contexts->next; unused_contexts = unused_contexts->next;
} }
else else
{ new_context = new context(ds_size,rs_size);
new_context = new context;
new_context->datastack_region = new segment(ds_size,false);
new_context->retainstack_region = new segment(rs_size,false);
}
return new_context; return new_context;
} }

View File

@ -46,6 +46,8 @@ struct context {
cell current_callback_save; cell current_callback_save;
context *next; context *next;
context(cell ds_size, cell rs_size);
}; };
#define ds_bot (ctx->datastack_region->start) #define ds_bot (ctx->datastack_region->start)