Another inconclusive session: still nothing works, still making progress.
This commit is contained in:
parent
ef59563e25
commit
eed4711fee
35 changed files with 317 additions and 232 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* payloads/stack.h
|
||||
* payloads/stack.c
|
||||
*
|
||||
* a Lisp stack frame.
|
||||
*
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
#include "payloads/cons.h"
|
||||
|
||||
#include "ops/reverse.h"
|
||||
#include "ops/list_ops.h"
|
||||
|
||||
/**
|
||||
* @brief Construct a stack frame with this `previous` pointer, and arguments
|
||||
|
|
@ -43,7 +44,7 @@ struct pso_pointer make_frame( int arg_count, struct pso_pointer previous,
|
|||
|
||||
struct pso4 *prev_frame = pointer_to_pso4( previous );
|
||||
struct pso_pointer new_pointer =
|
||||
allocate( pointer_to_pso4( previous ), STACKTAG, 4 );
|
||||
allocate( previous, STACKTAG, 4 );
|
||||
struct pso4* new_frame = pointer_to_pso4(new_pointer);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
@ -78,7 +79,7 @@ struct pso_pointer make_frame( int arg_count, struct pso_pointer previous,
|
|||
|
||||
for ( ; cursor < arg_count; cursor++ ) {
|
||||
more_args =
|
||||
make_cons( prev_frame, va_arg( args, struct pso_pointer ),
|
||||
make_cons( previous, va_arg( args, struct pso_pointer ),
|
||||
more_args );
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +118,7 @@ struct pso_pointer make_frame_with_env( int arg_count,
|
|||
|
||||
struct pso4 *prev_frame = pointer_to_pso4( previous );
|
||||
struct pso_pointer new_pointer =
|
||||
allocate( pointer_to_pso4( previous ), STACKTAG, 4 );
|
||||
allocate( previous, STACKTAG, 4 );
|
||||
struct pso4* new_frame = pointer_to_pso4(new_pointer);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
@ -152,7 +153,7 @@ struct pso_pointer make_frame_with_env( int arg_count,
|
|||
|
||||
for ( ; cursor < arg_count; cursor++ ) {
|
||||
more_args =
|
||||
make_cons( prev_frame, va_arg( args, struct pso_pointer ),
|
||||
make_cons( previous, va_arg( args, struct pso_pointer ),
|
||||
more_args );
|
||||
}
|
||||
|
||||
|
|
@ -184,10 +185,10 @@ struct pso_pointer make_frame_with_arglist_and_env( struct pso_pointer previous,
|
|||
struct pso_pointer env) {
|
||||
struct pso4 *prev_frame = pointer_to_pso4( previous );
|
||||
struct pso_pointer new_pointer =
|
||||
allocate( pointer_to_pso4( previous ), STACKTAG, 4 );
|
||||
allocate( previous, STACKTAG, 4 );
|
||||
struct pso4* new_frame = pointer_to_pso4(new_pointer);
|
||||
int arg_count = c_length(argvalues);
|
||||
|
||||
struct pso_pointer arg_length = length(make_frame(1, previous, argvalues));
|
||||
int arg_count = integerp(arg_length) ? pointer_to_object(arg_length)->payload.integer.value : 0;
|
||||
#ifdef DEBUG
|
||||
debug_printf( DEBUG_ALLOC, 0,
|
||||
L"\nAllocating stack frame with %d arguments at page %d, "
|
||||
|
|
@ -216,7 +217,7 @@ struct pso_pointer make_frame_with_arglist_and_env( struct pso_pointer previous,
|
|||
argvalues = cdr( make_frame( 1, previous, argvalues));
|
||||
}
|
||||
if ( cursor < arg_count ) {
|
||||
new_frame->payload.stack_frame.more = inc_ref( cursor);
|
||||
new_frame->payload.stack_frame.more = inc_ref( argvalues);
|
||||
} else {
|
||||
for ( ; cursor < args_in_frame; cursor++ ) {
|
||||
new_frame->payload.stack_frame.arg[cursor] = nil;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue