More load fixes

db4
Slava Pestov 2008-08-12 03:38:56 -05:00
parent 56d272df9e
commit a5ff214d67
6 changed files with 51 additions and 50 deletions

View File

@ -35,7 +35,7 @@ nl
roll -roll declare not
array? hashtable? vector?
tuple? sbuf? node? tombstone?
tuple? sbuf? tombstone?
array-nth set-array-nth

View File

@ -2,8 +2,9 @@
! See http://factorcode.org/license.txt for BSD license.
USING: kernel namespaces arrays sequences io debugger words
compiler.units continuations vocabs assocs dlists definitions
math compiler.errors threads graphs generic combinators dequeues
search-dequeues ;
math threads graphs generic combinators dequeues search-dequeues
stack-checker stack-checker.state compiler.generator
compiler.errors compiler.tree.builder compiler.tree.optimizer ;
IN: compiler
SYMBOL: +failed+
@ -51,8 +52,8 @@ SYMBOL: +failed+
{
[ compile-begins ]
[
[ word-dataflow ] [ compile-failed return ] recover
optimize
[ build-tree-from-word ] [ compile-failed return ] recover
optimize-tree
]
[ dup generate ]
[ compile-succeeded ]

View File

@ -1,10 +1,10 @@
! Copyright (C) 2006, 2007 Slava Pestov.
! Copyright (C) 2006, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs classes classes.private classes.algebra
combinators cpu.architecture generator.fixup hashtables kernel
layouts math namespaces quotations sequences system vectors
words effects alien byte-arrays
accessors sets math.order ;
combinators hashtables kernel layouts math namespaces quotations
sequences system vectors words effects alien byte-arrays
accessors sets math.order cpu.architecture
compiler.generator.fixup ;
IN: compiler.generator.registers
SYMBOL: +input+

View File

@ -4,7 +4,7 @@ USING: alien.c-types arrays cpu.x86.assembler
cpu.x86.architecture cpu.x86.intrinsics cpu.x86.allot
cpu.architecture kernel kernel.private math namespaces sequences
compiler.generator.registers compiler.generator.fixup
compiler.generator system layouts alien.compiler combinators
compiler.generator system layouts combinators
command-line compiler compiler.units io vocabs.loader accessors
init ;
IN: cpu.x86.32

View File

@ -289,45 +289,45 @@ IN: cpu.x86.intrinsics
{ +clobber+ { "n" } }
} define-intrinsic
\ (tuple) [
tuple "layout" get size>> 2 + cells [
! Store layout
"layout" get "scratch" get load-literal
1 object@ "scratch" operand MOV
! Store tagged ptr in reg
"tuple" get tuple %store-tagged
] %allot
] H{
{ +input+ { { [ ] "layout" } } }
{ +scratch+ { { f "tuple" } { f "scratch" } } }
{ +output+ { "tuple" } }
} define-intrinsic
\ (array) [
array "n" get 2 + cells [
! Store length
1 object@ "n" operand MOV
! Store tagged ptr in reg
"array" get object %store-tagged
] %allot
] H{
{ +input+ { { [ ] "n" } } }
{ +scratch+ { { f "array" } } }
{ +output+ { "array" } }
} define-intrinsic
\ (byte-array) [
byte-array "n" get 2 cells + [
! Store length
1 object@ "n" operand MOV
! Store tagged ptr in reg
"array" get object %store-tagged
] %allot
] H{
{ +input+ { { [ ] "n" } } }
{ +scratch+ { { f "array" } } }
{ +output+ { "array" } }
} define-intrinsic
! \ (tuple) [
! tuple "layout" get size>> 2 + cells [
! ! Store layout
! "layout" get "scratch" get load-literal
! 1 object@ "scratch" operand MOV
! ! Store tagged ptr in reg
! "tuple" get tuple %store-tagged
! ] %allot
! ] H{
! { +input+ { { [ ] "layout" } } }
! { +scratch+ { { f "tuple" } { f "scratch" } } }
! { +output+ { "tuple" } }
! } define-intrinsic
!
! \ (array) [
! array "n" get 2 + cells [
! ! Store length
! 1 object@ "n" operand MOV
! ! Store tagged ptr in reg
! "array" get object %store-tagged
! ] %allot
! ] H{
! { +input+ { { [ ] "n" } } }
! { +scratch+ { { f "array" } } }
! { +output+ { "array" } }
! } define-intrinsic
!
! \ (byte-array) [
! byte-array "n" get 2 cells + [
! ! Store length
! 1 object@ "n" operand MOV
! ! Store tagged ptr in reg
! "array" get object %store-tagged
! ] %allot
! ] H{
! { +input+ { { [ ] "n" } } }
! { +scratch+ { { f "array" } } }
! { +output+ { "array" } }
! } define-intrinsic
\ <ratio> [
ratio 3 cells [