aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-03-08 17:50:45 +0000
committerdos-reis <gdr@axiomatics.org>2009-03-08 17:50:45 +0000
commit2da25f5f77b5e1b500ced33c51166dff7a43338d (patch)
treef9c1dcd49c3edead9ea03c7cc2c0b332d35738c6 /src/boot
parent4eff9ac27bbd21e51053b5366558c18e561ae0fd (diff)
downloadopen-axiom-2da25f5f77b5e1b500ced33c51166dff7a43338d.tar.gz
* interp/fnewmeta.lisp (PARSE-Import): Parse extern entity
signature import. * interp/functor.boot (encodeLocalFunctionName): New. * interp/define.boot (compDefine1): Avoid getAbbreviation. (doIt): Handle %SignatureImport nodes. * interp/compiler.boot (emitLocalCallInsn): New. (applyMapping): Use it. (compApplication): Likewise. (bootDenotation): New. (getBasicFFIType): Likewise. (getFFIDatatype): Likewise. (getBootType): Likewise. (checkExternalEntityType): Likewise. (checkExternalEntity): Likewise. (removeModifiers): Likewise. (compSignatureImport): Likewise. * interp/vmlisp.lisp (|compileLispDefinition|): New. * interp/boot-pkg.lisp: Import genImportDeclaration. * boot/initial-env.lisp: Export genImportDeclaration. * boot/ast.boot: Tidy. Accept `readwrite' modifier.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/ast.boot20
-rw-r--r--src/boot/initial-env.lisp5
2 files changed, 13 insertions, 12 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 270b1221..819f79d4 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -1249,9 +1249,9 @@ genTypeAlias(head,body) ==
-- This is used to communicate data between native
-- functions and OpenAxiom functions. The `buffer' type
-- constructor must be used in conjunction with one of the
--- modifier `readonly' or `writeonly', and instantiated
--- with one of `char', `byte', `int', `float', and `double'.
--- It cannot be used a function return type.
+-- modifiers `readonly', `writeonly', or `readwrite', and
+-- instantiated with one of `char', `byte', `int', `float',
+-- and `double'. It cannot be used as function return type.
-- Note that the length of the array is not stored as
-- part of the data being transmitted.
@@ -1327,7 +1327,7 @@ nativeArgumentType t ==
coreError '"invalid argument type for a native function"
[m,[c,t']] := t
-- Require a modifier.
- not (m in '(readonly writeonly)) =>
+ not (m in '(readonly writeonly readwrite)) =>
coreError '"missing modifier for argument type for a native function"
-- Only 'pointer' and 'buffer' can be instantiated.
not (c in '(buffer pointer)) =>
@@ -1339,7 +1339,7 @@ nativeArgumentType t ==
++ True if objects of type native type `t' are sensible to GC.
needsStableReference? t ==
- not atom t and first t in '(readonly writeonly)
+ not atom t and first t in '(readonly writeonly readwrite)
++ coerce argument `a' to native type `t', in preparation for
++ a call to a native functions.
@@ -1471,9 +1471,9 @@ genCLISPnativeTranslation(op,s,t,op') ==
[KEYWORD::LANGUAGE,KEYWORD::STDC]]
-- The forwarding function. We have to introduce local foreign
- -- variables to hold the address of converted Lisp obejcts. Then
- -- we have to copy back those that are `writeonly' to simulate
- -- the reference semantics. Don't try ever try to pass around
+ -- variables to hold the address of converted Lisp objects. Then
+ -- we have to copy back those that are `writeonly' or `readwrite' to
+ -- simulate the reference semantics. Don't ever try to pass around
-- gigantic buffer, you might find out that it is insanely inefficient.
forwardingFun :=
null unstableArgs => ["DEFUN",op,parms, [n,:parms]]
@@ -1483,11 +1483,11 @@ genCLISPnativeTranslation(op,s,t,op') ==
actualArg(p,pairs) ==
a' := rest ASSOC(p,pairs) => rest rest a'
p
- -- Fix up the call if there is any `writeonly' parameter.
+ -- Fix up the call if there is any `write' parameter.
call :=
fixups := [q | not null (q := copyBack p) for p in localPairs] where
copyBack [p,x,y,:a] ==
- x isnt ["writeonly",:.] => nil
+ x is ["readonly",:.] => nil
["SETF", p, [bfColonColon("FFI","FOREIGN-VALUE"), a]]
null fixups => [call]
[["PROG1",call, :fixups]]
diff --git a/src/boot/initial-env.lisp b/src/boot/initial-env.lisp
index 7c98e734..dd67e0c4 100644
--- a/src/boot/initial-env.lisp
+++ b/src/boot/initial-env.lisp
@@ -1,6 +1,6 @@
;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
;; All rights reserved.
-;; Copyright (C) 2007-2008, Gabriel Dos Reis.
+;; Copyright (C) 2007-2009, Gabriel Dos Reis.
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,8 @@
(:export "loadNativeModule"
"loadSystemRuntimeCore"
"$InteractiveMode"
- "string2BootTree"))
+ "string2BootTree"
+ "genImportDeclaration"))
(in-package "BOOTTRAN")