Fix non-tail recursive inline recursive compilation
parent
77a877789a
commit
bd02eef38e
|
@ -40,7 +40,7 @@ SYMBOL: labels
|
||||||
V{ } clone calls set ;
|
V{ } clone calls set ;
|
||||||
|
|
||||||
: generate-insns ( asm -- code )
|
: generate-insns ( asm -- code )
|
||||||
dup word>> [
|
dup label>> [
|
||||||
init-generator
|
init-generator
|
||||||
instructions>> [
|
instructions>> [
|
||||||
[ class insn-counts get inc-at ]
|
[ class insn-counts get inc-at ]
|
||||||
|
|
|
@ -4,7 +4,7 @@ USING: arrays byte-arrays byte-vectors generic assocs hashtables
|
||||||
io.binary kernel kernel.private math namespaces make sequences
|
io.binary kernel kernel.private math namespaces make sequences
|
||||||
words quotations strings alien.accessors alien.strings layouts
|
words quotations strings alien.accessors alien.strings layouts
|
||||||
system combinators math.bitwise math.order
|
system combinators math.bitwise math.order
|
||||||
accessors growable fry generalizations compiler.constants ;
|
accessors growable fry compiler.constants ;
|
||||||
IN: compiler.codegen.fixup
|
IN: compiler.codegen.fixup
|
||||||
|
|
||||||
! Owner
|
! Owner
|
||||||
|
@ -114,8 +114,7 @@ SYMBOL: relocation-table
|
||||||
init-fixup
|
init-fixup
|
||||||
@
|
@
|
||||||
label-table [ resolve-labels ] change
|
label-table [ resolve-labels ] change
|
||||||
compiling-word get
|
|
||||||
literal-table get >array
|
literal-table get >array
|
||||||
relocation-table get >byte-array
|
relocation-table get >byte-array
|
||||||
label-table get
|
label-table get
|
||||||
] B{ } make 5 narray ; inline
|
] B{ } make 4array ; inline
|
||||||
|
|
|
@ -113,17 +113,16 @@ void factor_vm::primitive_modify_code_heap()
|
||||||
case ARRAY_TYPE:
|
case ARRAY_TYPE:
|
||||||
{
|
{
|
||||||
array *compiled_data = data.as<array>().untagged();
|
array *compiled_data = data.as<array>().untagged();
|
||||||
cell owner = array_nth(compiled_data,0);
|
cell literals = array_nth(compiled_data,0);
|
||||||
cell literals = array_nth(compiled_data,1);
|
cell relocation = array_nth(compiled_data,1);
|
||||||
cell relocation = array_nth(compiled_data,2);
|
cell labels = array_nth(compiled_data,2);
|
||||||
cell labels = array_nth(compiled_data,3);
|
cell code = array_nth(compiled_data,3);
|
||||||
cell code = array_nth(compiled_data,4);
|
|
||||||
|
|
||||||
code_block *compiled = add_code_block(
|
code_block *compiled = add_code_block(
|
||||||
code_block_optimized,
|
code_block_optimized,
|
||||||
code,
|
code,
|
||||||
labels,
|
labels,
|
||||||
owner,
|
word.value(),
|
||||||
relocation,
|
relocation,
|
||||||
literals);
|
literals);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue