Author: housel
Date: Mon Oct 17 03:36:42 2005
New Revision: 10271
Modified:
trunk/src/d2c/compiler/base/ctype.dylan
trunk/src/d2c/compiler/cback/heap.dylan
Log:
Bug: 7265
Make <limited-integer-ctype> a valid <eql-ct-value> so that
singleton() of a <limited-integer-ctype> can be evaluated at
compile-time.
* src/d2c/compiler/base/ctype.dylan (<limited-integer-ctype>): Inherit
from <eql-ct-value> instead of <ct-value>.
* src/d2c/compiler/cback/heap.dylan
(object-label): Define an object-label method for
<limited-integer-ctype> so that different libraries will refer to
the same literal value.
(defer-for-global-heap?): Cause dumping of <limited-integer-ctype> to be
deferred to the global heap.
Modified: trunk/src/d2c/compiler/base/ctype.dylan
==============================================================================
--- trunk/src/d2c/compiler/base/ctype.dylan (original)
+++ trunk/src/d2c/compiler/base/ctype.dylan Mon Oct 17 03:36:42 2005
@@ -923,7 +923,7 @@
define constant $limited-integer-table = make(<limited-integer-table>);
-define class <limited-integer-ctype> (<limited-ctype>, <ct-value>)
+define class <limited-integer-ctype> (<limited-ctype>, <eql-ct-value>)
constant slot low-bound :: false-or(<extended-integer>),
required-init-keyword: low-bound:;
constant slot high-bound :: false-or(<extended-integer>),
Modified: trunk/src/d2c/compiler/cback/heap.dylan
==============================================================================
--- trunk/src/d2c/compiler/cback/heap.dylan (original)
+++ trunk/src/d2c/compiler/cback/heap.dylan Mon Oct 17 03:36:42 2005
@@ -560,6 +560,17 @@
"Z", getter-defn.defn-name.c-name-global, "_SLOT_HEAP");
end;
+define method object-label
+ (object :: <limited-integer-ctype>)
+ => (label :: <byte-string>);
+ let bounds = format-to-string("%d$%d", object.low-bound, object.high-bound);
+ concatenate("LIMITED_",
+ object.base-class.class-defn.defn-name.c-name,
+ "Z",
+ bounds.string-to-c-name,
+ "_HEAP");
+end method;
+
// entry-name -- internal.
//
// Return the name of the function that corresponds to this entry point.
@@ -705,6 +716,14 @@
#t;
end method defer-for-global-heap?;
+// We also need to ensure that <literal-integer-ctype> instances are
+// unique at compile-time and run-time.
+//
+define method defer-for-global-heap?
+ (object :: <limited-integer-ctype>, state :: <local-heap-file-state>)
+ => defer? :: <boolean>;
+ #t;
+end method defer-for-global-heap?;
// Open generic functions must be deferred, because they need to be populated
// with any methods defined elsewhere.
--
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
https://gauss.gwydiondylan.org/mailman/listinfo/gd-chatter
|
|