add-literal fix
parent
a5377b2e6a
commit
0f34d6ecec
|
|
@ -1,4 +1,9 @@
|
|||
- UI word wrap problem
|
||||
- crash:
|
||||
- start UI
|
||||
- redefine new-size
|
||||
- recompile all
|
||||
- full gc
|
||||
- crash!
|
||||
|
||||
- unix i/o: problems with passing f to syscalls
|
||||
- if a primitive throws an error, :c doesn't show the call frame there
|
||||
|
|
@ -36,6 +41,7 @@
|
|||
- fix remaining HTML stream issues
|
||||
- need to present $list in a useful way
|
||||
- better line spacing in ui and html - related issue
|
||||
- get rid of style stack
|
||||
|
||||
+ fix compiled gc check
|
||||
- there was a performance hit, investigate
|
||||
|
|
@ -57,6 +63,8 @@
|
|||
|
||||
+ ui:
|
||||
|
||||
- { } H{ } [ ] tabular-output -- excess newline
|
||||
- multiple listener-run-files is broken
|
||||
- word wrap in UI broken again
|
||||
- table line styles
|
||||
- x11 input methods
|
||||
|
|
@ -65,6 +73,7 @@
|
|||
- browse generic words and classes
|
||||
- need actions for reloading the source file and opening word in jEdit
|
||||
- highlight showing panes in originating list
|
||||
- single set of tabs across the top
|
||||
- toggle/radio buttons/tabs or something
|
||||
- make-frame should compile
|
||||
- speed up ideas:
|
||||
|
|
|
|||
|
|
@ -150,8 +150,7 @@ call
|
|||
{ "cd" "io" }
|
||||
{ "compiled-offset" "assembler" }
|
||||
{ "set-compiled-offset" "assembler" }
|
||||
{ "literal-top" "assembler" }
|
||||
{ "set-literal-top" "assembler" }
|
||||
{ "add-literal" "assembler" }
|
||||
{ "address" "memory" }
|
||||
{ "dlopen" "alien" }
|
||||
{ "dlsym" "alien" }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ GENERIC: set-fill
|
|||
: expand ( len seq -- )
|
||||
[ underlying resize ] keep set-underlying ; inline
|
||||
|
||||
: new-size ( n -- n ) 3 * dup 50 < [ drop 50 ] when ;
|
||||
: new-size ( n -- n ) 1+ 3 * ; inline
|
||||
|
||||
: ensure ( n seq -- )
|
||||
2dup length >= [
|
||||
|
|
|
|||
|
|
@ -16,10 +16,6 @@ math memory namespaces ;
|
|||
: compile-aligned ( n -- )
|
||||
compiled-offset 8 align set-compiled-offset ; inline
|
||||
|
||||
: add-literal ( obj -- lit# )
|
||||
address literal-top [ set-compiled-cell ] keep
|
||||
dup cell + set-literal-top ;
|
||||
|
||||
: assemble-1 ( n -- )
|
||||
compiled-offset set-compiled-1
|
||||
compiled-offset 1+ set-compiled-offset ; inline
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@ HELP: set-compiled-offset "( n -- )"
|
|||
{ $values { "n" "an address" } }
|
||||
{ $description "Sets the pointer to the top of the code heap where new code can be compiled." } ;
|
||||
|
||||
HELP: literal-top "( -- n )"
|
||||
{ $values { "n" "an address" } }
|
||||
{ $description "Outputs a pointer to the top of the literal data area. The compiler deposits references made to heap-allocated objects from compiled code in this area." } ;
|
||||
|
||||
HELP: set-literal-top "( -- n )"
|
||||
{ $values { "n" "an address" } }
|
||||
{ $description "Sets the pointer to the top of the literal data area. The compiler deposits references made to heap-allocated objects from compiled code in this area." } ;
|
||||
HELP: add-literal "( obj -- n )"
|
||||
{ $values { "obj" "an object" } { "n" "an address" } }
|
||||
{ $description "Adds a pointer to the object to the compiled literal area and outputs a pointer to a pointer to the object." } ;
|
||||
|
||||
HELP: flush-icache "( -- )"
|
||||
{ $description "Flushes the CPUs instruction cache on PowerPC, and does nothing on other architectures. PowerPC CPUs do not automatically invalidate the cache when memory contents change, so the compiler must do this explicitly." } ;
|
||||
|
|
|
|||
|
|
@ -293,9 +293,7 @@ sequences strings vectors words prettyprint ;
|
|||
|
||||
\ set-compiled-offset [ [ integer ] [ ] ] "infer-effect" set-word-prop
|
||||
|
||||
\ literal-top [ [ ] [ integer ] ] "infer-effect" set-word-prop
|
||||
|
||||
\ set-literal-top [ [ integer ] [ ] ] "infer-effect" set-word-prop
|
||||
\ add-literal [ [ object ] [ integer ] ] "infer-effect" set-word-prop
|
||||
|
||||
\ address [ [ object ] [ integer ] ] "infer-effect" set-word-prop
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ unit-test
|
|||
unit-test
|
||||
|
||||
[ { "a" "b" "c" "d" "e" "f" } ]
|
||||
[ "aXXbXXcXXdXXeXXf" "XX" split ] unit-test
|
||||
[ "aXbYcXdYeXf" "XY" split ] unit-test
|
||||
|
||||
[ "Hello world" t ] [ "Hello world\n" "\n" ?tail ] unit-test
|
||||
[ "Hello world" f ] [ "Hello world" "\n" ?tail ] unit-test
|
||||
|
|
|
|||
|
|
@ -25,17 +25,15 @@ void primitive_set_compiled_offset(void)
|
|||
}
|
||||
}
|
||||
|
||||
void primitive_literal_top(void)
|
||||
void primitive_add_literal(void)
|
||||
{
|
||||
box_unsigned_cell(literal_top);
|
||||
}
|
||||
|
||||
void primitive_set_literal_top(void)
|
||||
{
|
||||
CELL offset = unbox_unsigned_cell();
|
||||
if(offset >= literal_max)
|
||||
critical_error("Too many compiled literals",offset);
|
||||
literal_top = offset;
|
||||
CELL object = dpeek();
|
||||
CELL offset = literal_top;
|
||||
put(literal_top,object);
|
||||
literal_top += CELLS;
|
||||
if(literal_top >= literal_max)
|
||||
critical_error("Too many compiled literals",literal_top);
|
||||
drepl(tag_cell(offset));
|
||||
}
|
||||
|
||||
void primitive_flush_icache(void)
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ CELL literal_max;
|
|||
void init_compiler(CELL size);
|
||||
void primitive_compiled_offset(void);
|
||||
void primitive_set_compiled_offset(void);
|
||||
void primitive_literal_top(void);
|
||||
void primitive_set_literal_top(void);
|
||||
void primitive_add_literal(void);
|
||||
void collect_literals(void);
|
||||
|
||||
#ifdef FACTOR_PPC
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ INLINE CELL tag_header(CELL cell)
|
|||
|
||||
INLINE CELL untag_header(CELL cell)
|
||||
{
|
||||
/* if((cell & TAG_MASK) != OBJECT_TYPE)
|
||||
critical_error("Corrupt object header",cell); */
|
||||
|
||||
return cell >> TAG_BITS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ void* primitives[] = {
|
|||
primitive_cd,
|
||||
primitive_compiled_offset,
|
||||
primitive_set_compiled_offset,
|
||||
primitive_literal_top,
|
||||
primitive_set_literal_top,
|
||||
primitive_add_literal,
|
||||
primitive_address,
|
||||
primitive_dlopen,
|
||||
primitive_dlsym,
|
||||
|
|
|
|||
Loading…
Reference in New Issue