Merge branch 'master' of git://factorcode.org/git/factor
commit
4bb95b60ec
|
@ -3,7 +3,8 @@ classes.tuple classes.union compiler.units continuations
|
|||
definitions eval generic generic.math generic.standard
|
||||
hashtables io io.streams.string kernel layouts math math.order
|
||||
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
|
||||
|
||||
GENERIC: foobar ( x -- y )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: arrays generic assocs kernel math namespaces
|
||||
sequences tools.test words definitions parser quotations
|
||||
vocabs continuations classes.tuple compiler.units
|
||||
io.streams.string accessors eval words.symbol ;
|
||||
io.streams.string accessors eval words.symbol grouping ;
|
||||
IN: words.tests
|
||||
|
||||
[ 4 ] [
|
||||
|
@ -121,7 +121,7 @@ DEFER: x
|
|||
[ { } ]
|
||||
[
|
||||
all-words [
|
||||
"compiled-uses" word-prop
|
||||
"compiled-uses" word-prop 2 <groups>
|
||||
keys [ "forgotten" word-prop ] filter
|
||||
] map harvest
|
||||
] unit-test
|
||||
|
|
|
@ -3,6 +3,20 @@
|
|||
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()
|
||||
{
|
||||
ds = ds_bot - sizeof(cell);
|
||||
|
@ -42,11 +56,7 @@ context *factor_vm::alloc_context()
|
|||
unused_contexts = unused_contexts->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_context = new context;
|
||||
new_context->datastack_region = new segment(ds_size,false);
|
||||
new_context->retainstack_region = new segment(rs_size,false);
|
||||
}
|
||||
new_context = new context(ds_size,rs_size);
|
||||
|
||||
return new_context;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ struct context {
|
|||
cell current_callback_save;
|
||||
|
||||
context *next;
|
||||
|
||||
context(cell ds_size, cell rs_size);
|
||||
};
|
||||
|
||||
#define ds_bot (ctx->datastack_region->start)
|
||||
|
|
Loading…
Reference in New Issue