diff --git a/basis/cpu/x86/x86.factor b/basis/cpu/x86/x86.factor index 798b67bc1a..c142818c7f 100644 --- a/basis/cpu/x86/x86.factor +++ b/basis/cpu/x86/x86.factor @@ -1,5 +1,6 @@ ! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. +<<<<<<< HEAD USING: accessors assocs alien alien.c-types arrays strings cpu.x86.assembler cpu.x86.assembler.private cpu.x86.assembler.operands cpu.architecture kernel kernel.private math memory namespaces make @@ -12,6 +13,14 @@ compiler.cfg.comparisons compiler.cfg.stack-frame compiler.codegen compiler.codegen.fixup ; +======= +USING: accessors alien combinators compiler.cfg.comparisons +compiler.cfg.intrinsics compiler.cfg.registers +compiler.cfg.stack-frame compiler.codegen.fixup compiler.constants +cpu.architecture cpu.x86.assembler cpu.x86.assembler.operands fry +kernel layouts locals make math math.order namespaces sequences system +vm ; +>>>>>>> Added a vm C-STRUCT, using it for struct offsets in x86 asm IN: cpu.x86 << enable-fixnum-log2 >> @@ -742,8 +751,8 @@ M:: x86 %save-context ( temp1 temp2 callback-allowed? -- ) #! Save Factor stack pointers in case the C code calls a #! callback which does a GC, which must reliably trace #! all roots. - temp1 0 MOV rc-absolute-cell rt-vm rel-fixup ! stack-chain is first item in vm struct. TODO: make vm C-STRUCT - temp1 temp1 [] MOV + temp1 0 MOV rc-absolute-cell rt-vm rel-fixup + temp1 temp1 "stack_chain" vm-offset [+] MOV temp2 stack-reg cell neg [+] LEA temp1 [] temp2 MOV callback-allowed? [ diff --git a/basis/vm/authors.txt b/basis/vm/authors.txt new file mode 100644 index 0000000000..b125620d17 --- /dev/null +++ b/basis/vm/authors.txt @@ -0,0 +1 @@ +Phil Dawes \ No newline at end of file diff --git a/basis/vm/summary.txt b/basis/vm/summary.txt new file mode 100644 index 0000000000..bfa1067bc7 --- /dev/null +++ b/basis/vm/summary.txt @@ -0,0 +1 @@ +Layout of the C vm structure diff --git a/basis/vm/vm.factor b/basis/vm/vm.factor new file mode 100644 index 0000000000..335f80918b --- /dev/null +++ b/basis/vm/vm.factor @@ -0,0 +1,8 @@ +! Copyright (C) 2009 Phil Dawes. +! See http://factorcode.org/license.txt for BSD license. +USING: alien.structs alien.syntax ; +IN: vm + +C-STRUCT: vm { "context*" "stack_chain" } ; + +: vm-offset ( field -- offset ) "vm" offset-of ; \ No newline at end of file