diff options
author | mikebarnett <unknown> | 2011-02-24 16:28:46 +0000 |
---|---|---|
committer | mikebarnett <unknown> | 2011-02-24 16:28:46 +0000 |
commit | 52c7b0169c73ff1351582d2b02b2adb52bc0d20c (patch) | |
tree | a906c149d1581caba36b55d2af4fc37e3a3ac2f5 /BCT/RegressionTests | |
parent | c4686e4c674da1c737522a76e99ee46ffbbaf0e1 (diff) |
Added a new type, Type, that represents runtime types. The Heap interface now provides a way to declare a new user-defined type and to represent the expressions "typeof(T)" or "o.Type" in the BPL program using a new function $DynamicType. Added a method to the Sink so that any of the translation visitors can find or declare a new type. When an object is allocated, an assumption is generated that gives its dynamic type.
Fixed the dynamic dispatch inlining so that the $DynamicType of the object is used to decide which override to call.
Diffstat (limited to 'BCT/RegressionTests')
-rw-r--r-- | BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt b/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt index ea98c61b..d200d8d8 100644 --- a/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt +++ b/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt @@ -31,6 +31,8 @@ implementation Alloc() returns (x: ref) +type Type;
+
type Field;
var $Heap: HeapType where IsGoodHeap($Heap);
@@ -53,6 +55,10 @@ function {:inline true} Write(H: HeapType, o: ref, f: Field, v: box) : HeapType H[o, f := v]
}
+function $DynamicType(ref) : Type;
+
+const unique RegressionTestInput.AsyncAttribute: Type;
+
procedure RegressionTestInput.AsyncAttribute.#ctor(this: int);
@@ -64,6 +70,8 @@ implementation RegressionTestInput.AsyncAttribute.#ctor(this: int) +const unique RegressionTestInput.ClassWithBoolTypes: Type;
+
var RegressionTestInput.ClassWithBoolTypes.staticB: bool;
const unique RegressionTestInput.ClassWithBoolTypes.b: Field;
@@ -132,6 +140,8 @@ implementation RegressionTestInput.ClassWithBoolTypes.Main() +const unique RegressionTestInput.ClassWithArrayTypes: Type;
+
var RegressionTestInput.ClassWithArrayTypes.s: int;
const unique RegressionTestInput.ClassWithArrayTypes.a: Field;
@@ -257,6 +267,8 @@ implementation RegressionTestInput.ClassWithArrayTypes.#ctor(this: int) +const unique RegressionTestInput.Class0: Type;
+
var RegressionTestInput.Class0.StaticInt: int;
procedure RegressionTestInput.Class0.StaticMethod$System.Int32(x$in: int) returns ($result: int);
|