From 869fa46f3852ec3c258b974dfaa3036af252be99 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Mon, 30 Apr 2018 23:00:34 +0200 Subject: [PATCH 1/5] Add generated sources for simplification --- .../cached/Abstraction-implem-decl-after.hh | 94 + .../main/cached/Abstraction-implem-decl.hh | 7 + vm/boostenv/main/cached/Abstraction-implem.hh | 116 ++ .../main/cached/Arity-implem-decl-after.hh | 79 + vm/boostenv/main/cached/Arity-implem-decl.hh | 7 + vm/boostenv/main/cached/Arity-implem.hh | 83 + .../main/cached/Array-implem-decl-after.hh | 100 + vm/boostenv/main/cached/Array-implem-decl.hh | 7 + vm/boostenv/main/cached/Array-implem.hh | 126 ++ vm/boostenv/main/cached/ArrayLike-interf.hh | 104 + .../main/cached/Atom-implem-decl-after.hh | 106 + vm/boostenv/main/cached/Atom-implem-decl.hh | 7 + vm/boostenv/main/cached/Atom-implem.hh | 131 ++ vm/boostenv/main/cached/AtomLike-interf.hh | 20 + .../main/cached/BaseDottable-interf.hh | 85 + .../main/cached/BigInt-implem-decl-after.hh | 100 + vm/boostenv/main/cached/BigInt-implem-decl.hh | 1 + vm/boostenv/main/cached/BigInt-implem.hh | 121 ++ .../main/cached/BindableReadOnly-interf.hh | 19 + .../main/cached/Boolean-implem-decl-after.hh | 109 ++ .../main/cached/Boolean-implem-decl.hh | 7 + vm/boostenv/main/cached/Boolean-implem.hh | 136 ++ .../main/cached/BuiltinCallable-interf.hh | 54 + .../BuiltinProcedure-implem-decl-after.hh | 92 + .../cached/BuiltinProcedure-implem-decl.hh | 7 + .../main/cached/BuiltinProcedure-implem.hh | 107 ++ .../cached/ByteString-implem-decl-after.hh | 91 + .../main/cached/ByteString-implem-decl.hh | 1 + vm/boostenv/main/cached/ByteString-implem.hh | 106 + vm/boostenv/main/cached/Callable-interf.hh | 84 + .../main/cached/Cell-implem-decl-after.hh | 61 + vm/boostenv/main/cached/Cell-implem-decl.hh | 1 + vm/boostenv/main/cached/Cell-implem.hh | 64 + vm/boostenv/main/cached/CellLike-interf.hh | 72 + .../main/cached/Chunk-implem-decl-after.hh | 64 + vm/boostenv/main/cached/Chunk-implem-decl.hh | 7 + vm/boostenv/main/cached/Chunk-implem.hh | 63 + vm/boostenv/main/cached/ChunkLike-interf.hh | 27 + .../main/cached/CodeArea-implem-decl-after.hh | 82 + .../main/cached/CodeArea-implem-decl.hh | 7 + vm/boostenv/main/cached/CodeArea-implem.hh | 88 + .../main/cached/CodeAreaProvider-interf.hh | 42 + vm/boostenv/main/cached/Comparable-interf.hh | 35 + .../main/cached/Cons-implem-decl-after.hh | 103 + vm/boostenv/main/cached/Cons-implem-decl.hh | 1 + vm/boostenv/main/cached/Cons-implem.hh | 126 ++ .../main/cached/DataflowVariable-interf.hh | 81 + .../cached/Dictionary-implem-decl-after.hh | 106 + .../main/cached/Dictionary-implem-decl.hh | 1 + vm/boostenv/main/cached/Dictionary-implem.hh | 139 ++ .../main/cached/DictionaryLike-interf.hh | 230 +++ .../main/cached/DotAssignable-interf.hh | 44 + .../cached/FailedSpace-implem-decl-after.hh | 60 + .../main/cached/FailedSpace-implem-decl.hh | 7 + vm/boostenv/main/cached/FailedSpace-implem.hh | 55 + .../cached/FailedValue-implem-decl-after.hh | 60 + .../main/cached/FailedValue-implem-decl.hh | 7 + vm/boostenv/main/cached/FailedValue-implem.hh | 63 + .../main/cached/Float-implem-decl-after.hh | 175 ++ vm/boostenv/main/cached/Float-implem-decl.hh | 7 + vm/boostenv/main/cached/Float-implem.hh | 246 +++ vm/boostenv/main/cached/FloatLike-interf.hh | 361 ++++ .../ForeignPointer-implem-decl-after.hh | 49 + .../main/cached/ForeignPointer-implem-decl.hh | 1 + .../main/cached/ForeignPointer-implem.hh | 42 + .../cached/GRedToStable-implem-decl-after.hh | 26 + .../main/cached/GRedToStable-implem-decl.hh | 7 + .../main/cached/GRedToStable-implem.hh | 5 + .../GRedToUnstable-implem-decl-after.hh | 26 + .../main/cached/GRedToUnstable-implem-decl.hh | 7 + .../main/cached/GRedToUnstable-implem.hh | 5 + .../cached/GlobalName-implem-decl-after.hh | 106 + .../main/cached/GlobalName-implem-decl.hh | 1 + vm/boostenv/main/cached/GlobalName-implem.hh | 139 ++ vm/boostenv/main/cached/Literal-interf.hh | 32 + .../cached/MergedSpace-implem-decl-after.hh | 60 + .../main/cached/MergedSpace-implem-decl.hh | 7 + vm/boostenv/main/cached/MergedSpace-implem.hh | 55 + vm/boostenv/main/cached/ModOS-builtin.json | 614 ++++++ vm/boostenv/main/cached/ModVM-builtin.json | 135 ++ vm/boostenv/main/cached/NameLike-interf.hh | 30 + .../cached/NamedName-implem-decl-after.hh | 115 ++ .../main/cached/NamedName-implem-decl.hh | 1 + vm/boostenv/main/cached/NamedName-implem.hh | 154 ++ vm/boostenv/main/cached/Numeric-interf.hh | 229 +++ .../main/cached/Object-implem-decl-after.hh | 103 + vm/boostenv/main/cached/Object-implem-decl.hh | 7 + vm/boostenv/main/cached/Object-implem.hh | 131 ++ vm/boostenv/main/cached/ObjectLike-interf.hh | 88 + .../main/cached/OptName-implem-decl-after.hh | 100 + .../main/cached/OptName-implem-decl.hh | 7 + vm/boostenv/main/cached/OptName-implem.hh | 129 ++ .../main/cached/OptVar-implem-decl-after.hh | 60 + vm/boostenv/main/cached/OptVar-implem-decl.hh | 7 + vm/boostenv/main/cached/OptVar-implem.hh | 69 + .../cached/PatMatCapture-implem-decl-after.hh | 54 + .../main/cached/PatMatCapture-implem-decl.hh | 7 + .../main/cached/PatMatCapture-implem.hh | 51 + .../PatMatConjunction-implem-decl-after.hh | 69 + .../cached/PatMatConjunction-implem-decl.hh | 7 + .../main/cached/PatMatConjunction-implem.hh | 73 + .../PatMatOpenRecord-implem-decl-after.hh | 66 + .../cached/PatMatOpenRecord-implem-decl.hh | 7 + .../main/cached/PatMatOpenRecord-implem.hh | 68 + .../main/cached/Port-implem-decl-after.hh | 58 + vm/boostenv/main/cached/Port-implem-decl.hh | 1 + vm/boostenv/main/cached/Port-implem.hh | 59 + vm/boostenv/main/cached/PortLike-interf.hh | 62 + .../main/cached/PotentialFeature-interf.hh | 20 + .../main/cached/ReadOnly-implem-decl-after.hh | 63 + .../main/cached/ReadOnly-implem-decl.hh | 7 + vm/boostenv/main/cached/ReadOnly-implem.hh | 68 + .../ReadOnlyVariable-implem-decl-after.hh | 60 + .../cached/ReadOnlyVariable-implem-decl.hh | 1 + .../main/cached/ReadOnlyVariable-implem.hh | 61 + .../main/cached/Record-implem-decl-after.hh | 112 ++ vm/boostenv/main/cached/Record-implem-decl.hh | 7 + vm/boostenv/main/cached/Record-implem.hh | 138 ++ vm/boostenv/main/cached/RecordLike-interf.hh | 259 +++ .../cached/Reference-implem-decl-after.hh | 38 + .../main/cached/Reference-implem-decl.hh | 7 + vm/boostenv/main/cached/Reference-implem.hh | 29 + .../ReflectiveEntity-implem-decl-after.hh | 50 + .../cached/ReflectiveEntity-implem-decl.hh | 1 + .../main/cached/ReflectiveEntity-implem.hh | 37 + .../ReflectiveVariable-implem-decl-after.hh | 63 + .../cached/ReflectiveVariable-implem-decl.hh | 1 + .../main/cached/ReflectiveVariable-implem.hh | 66 + .../cached/ReifiedGNode-implem-decl-after.hh | 45 + .../main/cached/ReifiedGNode-implem-decl.hh | 7 + .../main/cached/ReifiedGNode-implem.hh | 30 + .../cached/ReifiedSpace-implem-decl-after.hh | 66 + .../main/cached/ReifiedSpace-implem-decl.hh | 7 + .../main/cached/ReifiedSpace-implem.hh | 73 + .../cached/ReifiedThread-implem-decl-after.hh | 63 + .../main/cached/ReifiedThread-implem-decl.hh | 7 + .../main/cached/ReifiedThread-implem.hh | 64 + .../cached/Serialized-implem-decl-after.hh | 38 + .../main/cached/Serialized-implem-decl.hh | 7 + vm/boostenv/main/cached/Serialized-implem.hh | 25 + .../cached/Serializer-implem-decl-after.hh | 42 + .../main/cached/Serializer-implem-decl.hh | 1 + vm/boostenv/main/cached/Serializer-implem.hh | 25 + .../main/cached/SmallInt-implem-decl-after.hh | 106 + .../main/cached/SmallInt-implem-decl.hh | 7 + vm/boostenv/main/cached/SmallInt-implem.hh | 131 ++ vm/boostenv/main/cached/SpaceLike-interf.hh | 114 ++ .../main/cached/String-implem-decl-after.hh | 91 + vm/boostenv/main/cached/String-implem-decl.hh | 1 + vm/boostenv/main/cached/String-implem.hh | 106 + vm/boostenv/main/cached/StringLike-interf.hh | 139 ++ .../main/cached/StructuralEquatable-interf.hh | 26 + vm/boostenv/main/cached/ThreadLike-interf.hh | 53 + .../main/cached/Tuple-implem-decl-after.hh | 115 ++ vm/boostenv/main/cached/Tuple-implem-decl.hh | 7 + vm/boostenv/main/cached/Tuple-implem.hh | 143 ++ .../cached/UniqueName-implem-decl-after.hh | 109 ++ .../main/cached/UniqueName-implem-decl.hh | 7 + vm/boostenv/main/cached/UniqueName-implem.hh | 136 ++ .../main/cached/Unit-implem-decl-after.hh | 106 + vm/boostenv/main/cached/Unit-implem-decl.hh | 7 + vm/boostenv/main/cached/Unit-implem.hh | 131 ++ .../main/cached/VMPort-implem-decl-after.hh | 61 + vm/boostenv/main/cached/VMPort-implem-decl.hh | 7 + vm/boostenv/main/cached/VMPort-implem.hh | 56 + .../main/cached/ValueEquatable-interf.hh | 44 + .../main/cached/Variable-implem-decl-after.hh | 63 + .../main/cached/Variable-implem-decl.hh | 1 + vm/boostenv/main/cached/Variable-implem.hh | 66 + vm/boostenv/main/cached/Wakeable-interf.hh | 33 + .../cached/WeakReference-implem-decl-after.hh | 38 + .../main/cached/WeakReference-implem-decl.hh | 7 + .../main/cached/WeakReference-implem.hh | 27 + .../main/cached/WithPrintName-interf.hh | 34 + vm/boostenv/main/cached/boostenv.gen | 0 vm/boostenv/main/cached/boostenvbuiltins.cc | 230 +++ vm/boostenv/main/cached/boostenvbuiltins.hh | 12 + .../cached/Abstraction-implem-decl-after.hh | 94 + vm/vm/main/cached/Abstraction-implem-decl.hh | 7 + vm/vm/main/cached/Abstraction-implem.hh | 116 ++ vm/vm/main/cached/Arity-implem-decl-after.hh | 79 + vm/vm/main/cached/Arity-implem-decl.hh | 7 + vm/vm/main/cached/Arity-implem.hh | 83 + vm/vm/main/cached/Array-implem-decl-after.hh | 100 + vm/vm/main/cached/Array-implem-decl.hh | 7 + vm/vm/main/cached/Array-implem.hh | 126 ++ vm/vm/main/cached/ArrayLike-interf.hh | 104 + vm/vm/main/cached/Atom-implem-decl-after.hh | 106 + vm/vm/main/cached/Atom-implem-decl.hh | 7 + vm/vm/main/cached/Atom-implem.hh | 131 ++ vm/vm/main/cached/AtomLike-interf.hh | 20 + vm/vm/main/cached/BaseDottable-interf.hh | 85 + vm/vm/main/cached/BigInt-implem-decl-after.hh | 100 + vm/vm/main/cached/BigInt-implem-decl.hh | 1 + vm/vm/main/cached/BigInt-implem.hh | 121 ++ vm/vm/main/cached/BindableReadOnly-interf.hh | 19 + .../main/cached/Boolean-implem-decl-after.hh | 109 ++ vm/vm/main/cached/Boolean-implem-decl.hh | 7 + vm/vm/main/cached/Boolean-implem.hh | 136 ++ vm/vm/main/cached/BuiltinCallable-interf.hh | 54 + .../BuiltinProcedure-implem-decl-after.hh | 92 + .../cached/BuiltinProcedure-implem-decl.hh | 7 + vm/vm/main/cached/BuiltinProcedure-implem.hh | 107 ++ .../cached/ByteString-implem-decl-after.hh | 91 + vm/vm/main/cached/ByteString-implem-decl.hh | 1 + vm/vm/main/cached/ByteString-implem.hh | 106 + vm/vm/main/cached/Callable-interf.hh | 84 + vm/vm/main/cached/Cell-implem-decl-after.hh | 61 + vm/vm/main/cached/Cell-implem-decl.hh | 1 + vm/vm/main/cached/Cell-implem.hh | 64 + vm/vm/main/cached/CellLike-interf.hh | 72 + vm/vm/main/cached/Chunk-implem-decl-after.hh | 64 + vm/vm/main/cached/Chunk-implem-decl.hh | 7 + vm/vm/main/cached/Chunk-implem.hh | 63 + vm/vm/main/cached/ChunkLike-interf.hh | 27 + .../main/cached/CodeArea-implem-decl-after.hh | 82 + vm/vm/main/cached/CodeArea-implem-decl.hh | 7 + vm/vm/main/cached/CodeArea-implem.hh | 88 + vm/vm/main/cached/CodeAreaProvider-interf.hh | 42 + vm/vm/main/cached/Comparable-interf.hh | 35 + vm/vm/main/cached/Cons-implem-decl-after.hh | 103 + vm/vm/main/cached/Cons-implem-decl.hh | 1 + vm/vm/main/cached/Cons-implem.hh | 126 ++ vm/vm/main/cached/DataflowVariable-interf.hh | 81 + .../cached/Dictionary-implem-decl-after.hh | 106 + vm/vm/main/cached/Dictionary-implem-decl.hh | 1 + vm/vm/main/cached/Dictionary-implem.hh | 139 ++ vm/vm/main/cached/DictionaryLike-interf.hh | 230 +++ vm/vm/main/cached/DotAssignable-interf.hh | 44 + .../cached/FailedSpace-implem-decl-after.hh | 60 + vm/vm/main/cached/FailedSpace-implem-decl.hh | 7 + vm/vm/main/cached/FailedSpace-implem.hh | 55 + .../cached/FailedValue-implem-decl-after.hh | 60 + vm/vm/main/cached/FailedValue-implem-decl.hh | 7 + vm/vm/main/cached/FailedValue-implem.hh | 63 + vm/vm/main/cached/Float-implem-decl-after.hh | 175 ++ vm/vm/main/cached/Float-implem-decl.hh | 7 + vm/vm/main/cached/Float-implem.hh | 246 +++ vm/vm/main/cached/FloatLike-interf.hh | 361 ++++ .../ForeignPointer-implem-decl-after.hh | 49 + .../main/cached/ForeignPointer-implem-decl.hh | 1 + vm/vm/main/cached/ForeignPointer-implem.hh | 42 + .../cached/GRedToStable-implem-decl-after.hh | 26 + vm/vm/main/cached/GRedToStable-implem-decl.hh | 7 + vm/vm/main/cached/GRedToStable-implem.hh | 5 + .../GRedToUnstable-implem-decl-after.hh | 26 + .../main/cached/GRedToUnstable-implem-decl.hh | 7 + vm/vm/main/cached/GRedToUnstable-implem.hh | 5 + .../cached/GlobalName-implem-decl-after.hh | 106 + vm/vm/main/cached/GlobalName-implem-decl.hh | 1 + vm/vm/main/cached/GlobalName-implem.hh | 139 ++ vm/vm/main/cached/Literal-interf.hh | 32 + .../cached/MergedSpace-implem-decl-after.hh | 60 + vm/vm/main/cached/MergedSpace-implem-decl.hh | 7 + vm/vm/main/cached/MergedSpace-implem.hh | 55 + vm/vm/main/cached/ModArray-builtin.json | 142 ++ vm/vm/main/cached/ModAtom-builtin.json | 22 + vm/vm/main/cached/ModBoot-builtin.json | 38 + vm/vm/main/cached/ModBrowser-builtin.json | 142 ++ vm/vm/main/cached/ModCell-builtin.json | 90 + vm/vm/main/cached/ModChunk-builtin.json | 38 + vm/vm/main/cached/ModCoders-builtin.json | 54 + .../main/cached/ModCompactString-builtin.json | 170 ++ .../cached/ModCompilerSupport-builtin.json | 270 +++ vm/vm/main/cached/ModDebug-builtin.json | 63 + vm/vm/main/cached/ModDictionary-builtin.json | 278 +++ vm/vm/main/cached/ModException-builtin.json | 39 + vm/vm/main/cached/ModFloat-builtin.json | 406 ++++ .../cached/ModForeignPointer-builtin.json | 38 + vm/vm/main/cached/ModGNode-builtin.json | 90 + vm/vm/main/cached/ModInt-builtin.json | 96 + vm/vm/main/cached/ModLiteral-builtin.json | 22 + vm/vm/main/cached/ModName-builtin.json | 102 + vm/vm/main/cached/ModNumber-builtin.json | 116 ++ vm/vm/main/cached/ModObject-builtin.json | 183 ++ vm/vm/main/cached/ModPickle-builtin.json | 78 + vm/vm/main/cached/ModPort-builtin.json | 74 + vm/vm/main/cached/ModProcedure-builtin.json | 54 + vm/vm/main/cached/ModProperty-builtin.json | 78 + vm/vm/main/cached/ModRecord-builtin.json | 218 +++ vm/vm/main/cached/ModReflection-builtin.json | 102 + vm/vm/main/cached/ModSerializer-builtin.json | 58 + vm/vm/main/cached/ModSpace-builtin.json | 146 ++ vm/vm/main/cached/ModSystem-builtin.json | 143 ++ vm/vm/main/cached/ModThread-builtin.json | 110 ++ vm/vm/main/cached/ModTime-builtin.json | 46 + vm/vm/main/cached/ModTuple-builtin.json | 42 + vm/vm/main/cached/ModValue-builtin.json | 586 ++++++ .../cached/ModVirtualByteString-builtin.json | 74 + .../main/cached/ModVirtualString-builtin.json | 106 + .../main/cached/ModWeakReference-builtin.json | 54 + vm/vm/main/cached/NameLike-interf.hh | 30 + .../cached/NamedName-implem-decl-after.hh | 115 ++ vm/vm/main/cached/NamedName-implem-decl.hh | 1 + vm/vm/main/cached/NamedName-implem.hh | 154 ++ vm/vm/main/cached/Numeric-interf.hh | 229 +++ vm/vm/main/cached/Object-implem-decl-after.hh | 103 + vm/vm/main/cached/Object-implem-decl.hh | 7 + vm/vm/main/cached/Object-implem.hh | 131 ++ vm/vm/main/cached/ObjectLike-interf.hh | 88 + .../main/cached/OptName-implem-decl-after.hh | 100 + vm/vm/main/cached/OptName-implem-decl.hh | 7 + vm/vm/main/cached/OptName-implem.hh | 129 ++ vm/vm/main/cached/OptVar-implem-decl-after.hh | 60 + vm/vm/main/cached/OptVar-implem-decl.hh | 7 + vm/vm/main/cached/OptVar-implem.hh | 69 + .../cached/PatMatCapture-implem-decl-after.hh | 54 + .../main/cached/PatMatCapture-implem-decl.hh | 7 + vm/vm/main/cached/PatMatCapture-implem.hh | 51 + .../PatMatConjunction-implem-decl-after.hh | 69 + .../cached/PatMatConjunction-implem-decl.hh | 7 + vm/vm/main/cached/PatMatConjunction-implem.hh | 73 + .../PatMatOpenRecord-implem-decl-after.hh | 66 + .../cached/PatMatOpenRecord-implem-decl.hh | 7 + vm/vm/main/cached/PatMatOpenRecord-implem.hh | 68 + vm/vm/main/cached/Port-implem-decl-after.hh | 58 + vm/vm/main/cached/Port-implem-decl.hh | 1 + vm/vm/main/cached/Port-implem.hh | 59 + vm/vm/main/cached/PortLike-interf.hh | 62 + vm/vm/main/cached/PotentialFeature-interf.hh | 20 + .../main/cached/ReadOnly-implem-decl-after.hh | 63 + vm/vm/main/cached/ReadOnly-implem-decl.hh | 7 + vm/vm/main/cached/ReadOnly-implem.hh | 68 + .../ReadOnlyVariable-implem-decl-after.hh | 60 + .../cached/ReadOnlyVariable-implem-decl.hh | 1 + vm/vm/main/cached/ReadOnlyVariable-implem.hh | 61 + vm/vm/main/cached/Record-implem-decl-after.hh | 112 ++ vm/vm/main/cached/Record-implem-decl.hh | 7 + vm/vm/main/cached/Record-implem.hh | 138 ++ vm/vm/main/cached/RecordLike-interf.hh | 259 +++ .../cached/Reference-implem-decl-after.hh | 38 + vm/vm/main/cached/Reference-implem-decl.hh | 7 + vm/vm/main/cached/Reference-implem.hh | 29 + .../ReflectiveEntity-implem-decl-after.hh | 50 + .../cached/ReflectiveEntity-implem-decl.hh | 1 + vm/vm/main/cached/ReflectiveEntity-implem.hh | 37 + .../ReflectiveVariable-implem-decl-after.hh | 63 + .../cached/ReflectiveVariable-implem-decl.hh | 1 + .../main/cached/ReflectiveVariable-implem.hh | 66 + .../cached/ReifiedGNode-implem-decl-after.hh | 45 + vm/vm/main/cached/ReifiedGNode-implem-decl.hh | 7 + vm/vm/main/cached/ReifiedGNode-implem.hh | 30 + .../cached/ReifiedSpace-implem-decl-after.hh | 66 + vm/vm/main/cached/ReifiedSpace-implem-decl.hh | 7 + vm/vm/main/cached/ReifiedSpace-implem.hh | 73 + .../cached/ReifiedThread-implem-decl-after.hh | 63 + .../main/cached/ReifiedThread-implem-decl.hh | 7 + vm/vm/main/cached/ReifiedThread-implem.hh | 64 + .../cached/Serialized-implem-decl-after.hh | 38 + vm/vm/main/cached/Serialized-implem-decl.hh | 7 + vm/vm/main/cached/Serialized-implem.hh | 25 + .../cached/Serializer-implem-decl-after.hh | 42 + vm/vm/main/cached/Serializer-implem-decl.hh | 1 + vm/vm/main/cached/Serializer-implem.hh | 25 + .../main/cached/SmallInt-implem-decl-after.hh | 106 + vm/vm/main/cached/SmallInt-implem-decl.hh | 7 + vm/vm/main/cached/SmallInt-implem.hh | 131 ++ vm/vm/main/cached/SpaceLike-interf.hh | 114 ++ vm/vm/main/cached/String-implem-decl-after.hh | 91 + vm/vm/main/cached/String-implem-decl.hh | 1 + vm/vm/main/cached/String-implem.hh | 106 + vm/vm/main/cached/StringLike-interf.hh | 139 ++ .../main/cached/StructuralEquatable-interf.hh | 26 + vm/vm/main/cached/ThreadLike-interf.hh | 53 + vm/vm/main/cached/Tuple-implem-decl-after.hh | 115 ++ vm/vm/main/cached/Tuple-implem-decl.hh | 7 + vm/vm/main/cached/Tuple-implem.hh | 143 ++ .../cached/UniqueName-implem-decl-after.hh | 109 ++ vm/vm/main/cached/UniqueName-implem-decl.hh | 7 + vm/vm/main/cached/UniqueName-implem.hh | 136 ++ vm/vm/main/cached/Unit-implem-decl-after.hh | 106 + vm/vm/main/cached/Unit-implem-decl.hh | 7 + vm/vm/main/cached/Unit-implem.hh | 131 ++ vm/vm/main/cached/VMPort-implem-decl-after.hh | 61 + vm/vm/main/cached/VMPort-implem-decl.hh | 7 + vm/vm/main/cached/VMPort-implem.hh | 56 + vm/vm/main/cached/ValueEquatable-interf.hh | 44 + .../main/cached/Variable-implem-decl-after.hh | 63 + vm/vm/main/cached/Variable-implem-decl.hh | 1 + vm/vm/main/cached/Variable-implem.hh | 66 + vm/vm/main/cached/Wakeable-interf.hh | 33 + .../cached/WeakReference-implem-decl-after.hh | 38 + .../main/cached/WeakReference-implem-decl.hh | 7 + vm/vm/main/cached/WeakReference-implem.hh | 27 + vm/vm/main/cached/WithPrintName-interf.hh | 34 + vm/vm/main/cached/emulate-inline.cc | 35 + vm/vm/main/cached/mozart.gen | 0 vm/vm/main/cached/mozartbuiltins.cc | 1712 +++++++++++++++++ vm/vm/main/cached/mozartbuiltins.hh | 216 +++ 389 files changed, 28386 insertions(+) create mode 100644 vm/boostenv/main/cached/Abstraction-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Abstraction-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Abstraction-implem.hh create mode 100644 vm/boostenv/main/cached/Arity-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Arity-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Arity-implem.hh create mode 100644 vm/boostenv/main/cached/Array-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Array-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Array-implem.hh create mode 100644 vm/boostenv/main/cached/ArrayLike-interf.hh create mode 100644 vm/boostenv/main/cached/Atom-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Atom-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Atom-implem.hh create mode 100644 vm/boostenv/main/cached/AtomLike-interf.hh create mode 100644 vm/boostenv/main/cached/BaseDottable-interf.hh create mode 100644 vm/boostenv/main/cached/BigInt-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/BigInt-implem-decl.hh create mode 100644 vm/boostenv/main/cached/BigInt-implem.hh create mode 100644 vm/boostenv/main/cached/BindableReadOnly-interf.hh create mode 100644 vm/boostenv/main/cached/Boolean-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Boolean-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Boolean-implem.hh create mode 100644 vm/boostenv/main/cached/BuiltinCallable-interf.hh create mode 100644 vm/boostenv/main/cached/BuiltinProcedure-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/BuiltinProcedure-implem-decl.hh create mode 100644 vm/boostenv/main/cached/BuiltinProcedure-implem.hh create mode 100644 vm/boostenv/main/cached/ByteString-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ByteString-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ByteString-implem.hh create mode 100644 vm/boostenv/main/cached/Callable-interf.hh create mode 100644 vm/boostenv/main/cached/Cell-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Cell-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Cell-implem.hh create mode 100644 vm/boostenv/main/cached/CellLike-interf.hh create mode 100644 vm/boostenv/main/cached/Chunk-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Chunk-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Chunk-implem.hh create mode 100644 vm/boostenv/main/cached/ChunkLike-interf.hh create mode 100644 vm/boostenv/main/cached/CodeArea-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/CodeArea-implem-decl.hh create mode 100644 vm/boostenv/main/cached/CodeArea-implem.hh create mode 100644 vm/boostenv/main/cached/CodeAreaProvider-interf.hh create mode 100644 vm/boostenv/main/cached/Comparable-interf.hh create mode 100644 vm/boostenv/main/cached/Cons-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Cons-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Cons-implem.hh create mode 100644 vm/boostenv/main/cached/DataflowVariable-interf.hh create mode 100644 vm/boostenv/main/cached/Dictionary-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Dictionary-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Dictionary-implem.hh create mode 100644 vm/boostenv/main/cached/DictionaryLike-interf.hh create mode 100644 vm/boostenv/main/cached/DotAssignable-interf.hh create mode 100644 vm/boostenv/main/cached/FailedSpace-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/FailedSpace-implem-decl.hh create mode 100644 vm/boostenv/main/cached/FailedSpace-implem.hh create mode 100644 vm/boostenv/main/cached/FailedValue-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/FailedValue-implem-decl.hh create mode 100644 vm/boostenv/main/cached/FailedValue-implem.hh create mode 100644 vm/boostenv/main/cached/Float-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Float-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Float-implem.hh create mode 100644 vm/boostenv/main/cached/FloatLike-interf.hh create mode 100644 vm/boostenv/main/cached/ForeignPointer-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ForeignPointer-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ForeignPointer-implem.hh create mode 100644 vm/boostenv/main/cached/GRedToStable-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/GRedToStable-implem-decl.hh create mode 100644 vm/boostenv/main/cached/GRedToStable-implem.hh create mode 100644 vm/boostenv/main/cached/GRedToUnstable-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/GRedToUnstable-implem-decl.hh create mode 100644 vm/boostenv/main/cached/GRedToUnstable-implem.hh create mode 100644 vm/boostenv/main/cached/GlobalName-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/GlobalName-implem-decl.hh create mode 100644 vm/boostenv/main/cached/GlobalName-implem.hh create mode 100644 vm/boostenv/main/cached/Literal-interf.hh create mode 100644 vm/boostenv/main/cached/MergedSpace-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/MergedSpace-implem-decl.hh create mode 100644 vm/boostenv/main/cached/MergedSpace-implem.hh create mode 100644 vm/boostenv/main/cached/ModOS-builtin.json create mode 100644 vm/boostenv/main/cached/ModVM-builtin.json create mode 100644 vm/boostenv/main/cached/NameLike-interf.hh create mode 100644 vm/boostenv/main/cached/NamedName-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/NamedName-implem-decl.hh create mode 100644 vm/boostenv/main/cached/NamedName-implem.hh create mode 100644 vm/boostenv/main/cached/Numeric-interf.hh create mode 100644 vm/boostenv/main/cached/Object-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Object-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Object-implem.hh create mode 100644 vm/boostenv/main/cached/ObjectLike-interf.hh create mode 100644 vm/boostenv/main/cached/OptName-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/OptName-implem-decl.hh create mode 100644 vm/boostenv/main/cached/OptName-implem.hh create mode 100644 vm/boostenv/main/cached/OptVar-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/OptVar-implem-decl.hh create mode 100644 vm/boostenv/main/cached/OptVar-implem.hh create mode 100644 vm/boostenv/main/cached/PatMatCapture-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/PatMatCapture-implem-decl.hh create mode 100644 vm/boostenv/main/cached/PatMatCapture-implem.hh create mode 100644 vm/boostenv/main/cached/PatMatConjunction-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/PatMatConjunction-implem-decl.hh create mode 100644 vm/boostenv/main/cached/PatMatConjunction-implem.hh create mode 100644 vm/boostenv/main/cached/PatMatOpenRecord-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/PatMatOpenRecord-implem-decl.hh create mode 100644 vm/boostenv/main/cached/PatMatOpenRecord-implem.hh create mode 100644 vm/boostenv/main/cached/Port-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Port-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Port-implem.hh create mode 100644 vm/boostenv/main/cached/PortLike-interf.hh create mode 100644 vm/boostenv/main/cached/PotentialFeature-interf.hh create mode 100644 vm/boostenv/main/cached/ReadOnly-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReadOnly-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReadOnly-implem.hh create mode 100644 vm/boostenv/main/cached/ReadOnlyVariable-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReadOnlyVariable-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReadOnlyVariable-implem.hh create mode 100644 vm/boostenv/main/cached/Record-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Record-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Record-implem.hh create mode 100644 vm/boostenv/main/cached/RecordLike-interf.hh create mode 100644 vm/boostenv/main/cached/Reference-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Reference-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Reference-implem.hh create mode 100644 vm/boostenv/main/cached/ReflectiveEntity-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReflectiveEntity-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReflectiveEntity-implem.hh create mode 100644 vm/boostenv/main/cached/ReflectiveVariable-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReflectiveVariable-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReflectiveVariable-implem.hh create mode 100644 vm/boostenv/main/cached/ReifiedGNode-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReifiedGNode-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReifiedGNode-implem.hh create mode 100644 vm/boostenv/main/cached/ReifiedSpace-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReifiedSpace-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReifiedSpace-implem.hh create mode 100644 vm/boostenv/main/cached/ReifiedThread-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/ReifiedThread-implem-decl.hh create mode 100644 vm/boostenv/main/cached/ReifiedThread-implem.hh create mode 100644 vm/boostenv/main/cached/Serialized-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Serialized-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Serialized-implem.hh create mode 100644 vm/boostenv/main/cached/Serializer-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Serializer-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Serializer-implem.hh create mode 100644 vm/boostenv/main/cached/SmallInt-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/SmallInt-implem-decl.hh create mode 100644 vm/boostenv/main/cached/SmallInt-implem.hh create mode 100644 vm/boostenv/main/cached/SpaceLike-interf.hh create mode 100644 vm/boostenv/main/cached/String-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/String-implem-decl.hh create mode 100644 vm/boostenv/main/cached/String-implem.hh create mode 100644 vm/boostenv/main/cached/StringLike-interf.hh create mode 100644 vm/boostenv/main/cached/StructuralEquatable-interf.hh create mode 100644 vm/boostenv/main/cached/ThreadLike-interf.hh create mode 100644 vm/boostenv/main/cached/Tuple-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Tuple-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Tuple-implem.hh create mode 100644 vm/boostenv/main/cached/UniqueName-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/UniqueName-implem-decl.hh create mode 100644 vm/boostenv/main/cached/UniqueName-implem.hh create mode 100644 vm/boostenv/main/cached/Unit-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Unit-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Unit-implem.hh create mode 100644 vm/boostenv/main/cached/VMPort-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/VMPort-implem-decl.hh create mode 100644 vm/boostenv/main/cached/VMPort-implem.hh create mode 100644 vm/boostenv/main/cached/ValueEquatable-interf.hh create mode 100644 vm/boostenv/main/cached/Variable-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/Variable-implem-decl.hh create mode 100644 vm/boostenv/main/cached/Variable-implem.hh create mode 100644 vm/boostenv/main/cached/Wakeable-interf.hh create mode 100644 vm/boostenv/main/cached/WeakReference-implem-decl-after.hh create mode 100644 vm/boostenv/main/cached/WeakReference-implem-decl.hh create mode 100644 vm/boostenv/main/cached/WeakReference-implem.hh create mode 100644 vm/boostenv/main/cached/WithPrintName-interf.hh create mode 100644 vm/boostenv/main/cached/boostenv.gen create mode 100644 vm/boostenv/main/cached/boostenvbuiltins.cc create mode 100644 vm/boostenv/main/cached/boostenvbuiltins.hh create mode 100644 vm/vm/main/cached/Abstraction-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Abstraction-implem-decl.hh create mode 100644 vm/vm/main/cached/Abstraction-implem.hh create mode 100644 vm/vm/main/cached/Arity-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Arity-implem-decl.hh create mode 100644 vm/vm/main/cached/Arity-implem.hh create mode 100644 vm/vm/main/cached/Array-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Array-implem-decl.hh create mode 100644 vm/vm/main/cached/Array-implem.hh create mode 100644 vm/vm/main/cached/ArrayLike-interf.hh create mode 100644 vm/vm/main/cached/Atom-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Atom-implem-decl.hh create mode 100644 vm/vm/main/cached/Atom-implem.hh create mode 100644 vm/vm/main/cached/AtomLike-interf.hh create mode 100644 vm/vm/main/cached/BaseDottable-interf.hh create mode 100644 vm/vm/main/cached/BigInt-implem-decl-after.hh create mode 100644 vm/vm/main/cached/BigInt-implem-decl.hh create mode 100644 vm/vm/main/cached/BigInt-implem.hh create mode 100644 vm/vm/main/cached/BindableReadOnly-interf.hh create mode 100644 vm/vm/main/cached/Boolean-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Boolean-implem-decl.hh create mode 100644 vm/vm/main/cached/Boolean-implem.hh create mode 100644 vm/vm/main/cached/BuiltinCallable-interf.hh create mode 100644 vm/vm/main/cached/BuiltinProcedure-implem-decl-after.hh create mode 100644 vm/vm/main/cached/BuiltinProcedure-implem-decl.hh create mode 100644 vm/vm/main/cached/BuiltinProcedure-implem.hh create mode 100644 vm/vm/main/cached/ByteString-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ByteString-implem-decl.hh create mode 100644 vm/vm/main/cached/ByteString-implem.hh create mode 100644 vm/vm/main/cached/Callable-interf.hh create mode 100644 vm/vm/main/cached/Cell-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Cell-implem-decl.hh create mode 100644 vm/vm/main/cached/Cell-implem.hh create mode 100644 vm/vm/main/cached/CellLike-interf.hh create mode 100644 vm/vm/main/cached/Chunk-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Chunk-implem-decl.hh create mode 100644 vm/vm/main/cached/Chunk-implem.hh create mode 100644 vm/vm/main/cached/ChunkLike-interf.hh create mode 100644 vm/vm/main/cached/CodeArea-implem-decl-after.hh create mode 100644 vm/vm/main/cached/CodeArea-implem-decl.hh create mode 100644 vm/vm/main/cached/CodeArea-implem.hh create mode 100644 vm/vm/main/cached/CodeAreaProvider-interf.hh create mode 100644 vm/vm/main/cached/Comparable-interf.hh create mode 100644 vm/vm/main/cached/Cons-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Cons-implem-decl.hh create mode 100644 vm/vm/main/cached/Cons-implem.hh create mode 100644 vm/vm/main/cached/DataflowVariable-interf.hh create mode 100644 vm/vm/main/cached/Dictionary-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Dictionary-implem-decl.hh create mode 100644 vm/vm/main/cached/Dictionary-implem.hh create mode 100644 vm/vm/main/cached/DictionaryLike-interf.hh create mode 100644 vm/vm/main/cached/DotAssignable-interf.hh create mode 100644 vm/vm/main/cached/FailedSpace-implem-decl-after.hh create mode 100644 vm/vm/main/cached/FailedSpace-implem-decl.hh create mode 100644 vm/vm/main/cached/FailedSpace-implem.hh create mode 100644 vm/vm/main/cached/FailedValue-implem-decl-after.hh create mode 100644 vm/vm/main/cached/FailedValue-implem-decl.hh create mode 100644 vm/vm/main/cached/FailedValue-implem.hh create mode 100644 vm/vm/main/cached/Float-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Float-implem-decl.hh create mode 100644 vm/vm/main/cached/Float-implem.hh create mode 100644 vm/vm/main/cached/FloatLike-interf.hh create mode 100644 vm/vm/main/cached/ForeignPointer-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ForeignPointer-implem-decl.hh create mode 100644 vm/vm/main/cached/ForeignPointer-implem.hh create mode 100644 vm/vm/main/cached/GRedToStable-implem-decl-after.hh create mode 100644 vm/vm/main/cached/GRedToStable-implem-decl.hh create mode 100644 vm/vm/main/cached/GRedToStable-implem.hh create mode 100644 vm/vm/main/cached/GRedToUnstable-implem-decl-after.hh create mode 100644 vm/vm/main/cached/GRedToUnstable-implem-decl.hh create mode 100644 vm/vm/main/cached/GRedToUnstable-implem.hh create mode 100644 vm/vm/main/cached/GlobalName-implem-decl-after.hh create mode 100644 vm/vm/main/cached/GlobalName-implem-decl.hh create mode 100644 vm/vm/main/cached/GlobalName-implem.hh create mode 100644 vm/vm/main/cached/Literal-interf.hh create mode 100644 vm/vm/main/cached/MergedSpace-implem-decl-after.hh create mode 100644 vm/vm/main/cached/MergedSpace-implem-decl.hh create mode 100644 vm/vm/main/cached/MergedSpace-implem.hh create mode 100644 vm/vm/main/cached/ModArray-builtin.json create mode 100644 vm/vm/main/cached/ModAtom-builtin.json create mode 100644 vm/vm/main/cached/ModBoot-builtin.json create mode 100644 vm/vm/main/cached/ModBrowser-builtin.json create mode 100644 vm/vm/main/cached/ModCell-builtin.json create mode 100644 vm/vm/main/cached/ModChunk-builtin.json create mode 100644 vm/vm/main/cached/ModCoders-builtin.json create mode 100644 vm/vm/main/cached/ModCompactString-builtin.json create mode 100644 vm/vm/main/cached/ModCompilerSupport-builtin.json create mode 100644 vm/vm/main/cached/ModDebug-builtin.json create mode 100644 vm/vm/main/cached/ModDictionary-builtin.json create mode 100644 vm/vm/main/cached/ModException-builtin.json create mode 100644 vm/vm/main/cached/ModFloat-builtin.json create mode 100644 vm/vm/main/cached/ModForeignPointer-builtin.json create mode 100644 vm/vm/main/cached/ModGNode-builtin.json create mode 100644 vm/vm/main/cached/ModInt-builtin.json create mode 100644 vm/vm/main/cached/ModLiteral-builtin.json create mode 100644 vm/vm/main/cached/ModName-builtin.json create mode 100644 vm/vm/main/cached/ModNumber-builtin.json create mode 100644 vm/vm/main/cached/ModObject-builtin.json create mode 100644 vm/vm/main/cached/ModPickle-builtin.json create mode 100644 vm/vm/main/cached/ModPort-builtin.json create mode 100644 vm/vm/main/cached/ModProcedure-builtin.json create mode 100644 vm/vm/main/cached/ModProperty-builtin.json create mode 100644 vm/vm/main/cached/ModRecord-builtin.json create mode 100644 vm/vm/main/cached/ModReflection-builtin.json create mode 100644 vm/vm/main/cached/ModSerializer-builtin.json create mode 100644 vm/vm/main/cached/ModSpace-builtin.json create mode 100644 vm/vm/main/cached/ModSystem-builtin.json create mode 100644 vm/vm/main/cached/ModThread-builtin.json create mode 100644 vm/vm/main/cached/ModTime-builtin.json create mode 100644 vm/vm/main/cached/ModTuple-builtin.json create mode 100644 vm/vm/main/cached/ModValue-builtin.json create mode 100644 vm/vm/main/cached/ModVirtualByteString-builtin.json create mode 100644 vm/vm/main/cached/ModVirtualString-builtin.json create mode 100644 vm/vm/main/cached/ModWeakReference-builtin.json create mode 100644 vm/vm/main/cached/NameLike-interf.hh create mode 100644 vm/vm/main/cached/NamedName-implem-decl-after.hh create mode 100644 vm/vm/main/cached/NamedName-implem-decl.hh create mode 100644 vm/vm/main/cached/NamedName-implem.hh create mode 100644 vm/vm/main/cached/Numeric-interf.hh create mode 100644 vm/vm/main/cached/Object-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Object-implem-decl.hh create mode 100644 vm/vm/main/cached/Object-implem.hh create mode 100644 vm/vm/main/cached/ObjectLike-interf.hh create mode 100644 vm/vm/main/cached/OptName-implem-decl-after.hh create mode 100644 vm/vm/main/cached/OptName-implem-decl.hh create mode 100644 vm/vm/main/cached/OptName-implem.hh create mode 100644 vm/vm/main/cached/OptVar-implem-decl-after.hh create mode 100644 vm/vm/main/cached/OptVar-implem-decl.hh create mode 100644 vm/vm/main/cached/OptVar-implem.hh create mode 100644 vm/vm/main/cached/PatMatCapture-implem-decl-after.hh create mode 100644 vm/vm/main/cached/PatMatCapture-implem-decl.hh create mode 100644 vm/vm/main/cached/PatMatCapture-implem.hh create mode 100644 vm/vm/main/cached/PatMatConjunction-implem-decl-after.hh create mode 100644 vm/vm/main/cached/PatMatConjunction-implem-decl.hh create mode 100644 vm/vm/main/cached/PatMatConjunction-implem.hh create mode 100644 vm/vm/main/cached/PatMatOpenRecord-implem-decl-after.hh create mode 100644 vm/vm/main/cached/PatMatOpenRecord-implem-decl.hh create mode 100644 vm/vm/main/cached/PatMatOpenRecord-implem.hh create mode 100644 vm/vm/main/cached/Port-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Port-implem-decl.hh create mode 100644 vm/vm/main/cached/Port-implem.hh create mode 100644 vm/vm/main/cached/PortLike-interf.hh create mode 100644 vm/vm/main/cached/PotentialFeature-interf.hh create mode 100644 vm/vm/main/cached/ReadOnly-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReadOnly-implem-decl.hh create mode 100644 vm/vm/main/cached/ReadOnly-implem.hh create mode 100644 vm/vm/main/cached/ReadOnlyVariable-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReadOnlyVariable-implem-decl.hh create mode 100644 vm/vm/main/cached/ReadOnlyVariable-implem.hh create mode 100644 vm/vm/main/cached/Record-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Record-implem-decl.hh create mode 100644 vm/vm/main/cached/Record-implem.hh create mode 100644 vm/vm/main/cached/RecordLike-interf.hh create mode 100644 vm/vm/main/cached/Reference-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Reference-implem-decl.hh create mode 100644 vm/vm/main/cached/Reference-implem.hh create mode 100644 vm/vm/main/cached/ReflectiveEntity-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReflectiveEntity-implem-decl.hh create mode 100644 vm/vm/main/cached/ReflectiveEntity-implem.hh create mode 100644 vm/vm/main/cached/ReflectiveVariable-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReflectiveVariable-implem-decl.hh create mode 100644 vm/vm/main/cached/ReflectiveVariable-implem.hh create mode 100644 vm/vm/main/cached/ReifiedGNode-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReifiedGNode-implem-decl.hh create mode 100644 vm/vm/main/cached/ReifiedGNode-implem.hh create mode 100644 vm/vm/main/cached/ReifiedSpace-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReifiedSpace-implem-decl.hh create mode 100644 vm/vm/main/cached/ReifiedSpace-implem.hh create mode 100644 vm/vm/main/cached/ReifiedThread-implem-decl-after.hh create mode 100644 vm/vm/main/cached/ReifiedThread-implem-decl.hh create mode 100644 vm/vm/main/cached/ReifiedThread-implem.hh create mode 100644 vm/vm/main/cached/Serialized-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Serialized-implem-decl.hh create mode 100644 vm/vm/main/cached/Serialized-implem.hh create mode 100644 vm/vm/main/cached/Serializer-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Serializer-implem-decl.hh create mode 100644 vm/vm/main/cached/Serializer-implem.hh create mode 100644 vm/vm/main/cached/SmallInt-implem-decl-after.hh create mode 100644 vm/vm/main/cached/SmallInt-implem-decl.hh create mode 100644 vm/vm/main/cached/SmallInt-implem.hh create mode 100644 vm/vm/main/cached/SpaceLike-interf.hh create mode 100644 vm/vm/main/cached/String-implem-decl-after.hh create mode 100644 vm/vm/main/cached/String-implem-decl.hh create mode 100644 vm/vm/main/cached/String-implem.hh create mode 100644 vm/vm/main/cached/StringLike-interf.hh create mode 100644 vm/vm/main/cached/StructuralEquatable-interf.hh create mode 100644 vm/vm/main/cached/ThreadLike-interf.hh create mode 100644 vm/vm/main/cached/Tuple-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Tuple-implem-decl.hh create mode 100644 vm/vm/main/cached/Tuple-implem.hh create mode 100644 vm/vm/main/cached/UniqueName-implem-decl-after.hh create mode 100644 vm/vm/main/cached/UniqueName-implem-decl.hh create mode 100644 vm/vm/main/cached/UniqueName-implem.hh create mode 100644 vm/vm/main/cached/Unit-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Unit-implem-decl.hh create mode 100644 vm/vm/main/cached/Unit-implem.hh create mode 100644 vm/vm/main/cached/VMPort-implem-decl-after.hh create mode 100644 vm/vm/main/cached/VMPort-implem-decl.hh create mode 100644 vm/vm/main/cached/VMPort-implem.hh create mode 100644 vm/vm/main/cached/ValueEquatable-interf.hh create mode 100644 vm/vm/main/cached/Variable-implem-decl-after.hh create mode 100644 vm/vm/main/cached/Variable-implem-decl.hh create mode 100644 vm/vm/main/cached/Variable-implem.hh create mode 100644 vm/vm/main/cached/Wakeable-interf.hh create mode 100644 vm/vm/main/cached/WeakReference-implem-decl-after.hh create mode 100644 vm/vm/main/cached/WeakReference-implem-decl.hh create mode 100644 vm/vm/main/cached/WeakReference-implem.hh create mode 100644 vm/vm/main/cached/WithPrintName-interf.hh create mode 100644 vm/vm/main/cached/emulate-inline.cc create mode 100644 vm/vm/main/cached/mozart.gen create mode 100644 vm/vm/main/cached/mozartbuiltins.cc create mode 100644 vm/vm/main/cached/mozartbuiltins.hh diff --git a/vm/boostenv/main/cached/Abstraction-implem-decl-after.hh b/vm/boostenv/main/cached/Abstraction-implem-decl-after.hh new file mode 100644 index 000000000..f1e5c94d2 --- /dev/null +++ b/vm/boostenv/main/cached/Abstraction-implem-decl-after.hh @@ -0,0 +1,94 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Abstraction", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Abstraction::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + GlobalNode* globalize(VM vm, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::StableNode& getElements(size_t i); + + inline + class mozart::Space * home(); + + inline + size_t getArraySizeImpl(); + + inline + atom_t getPrintName(VM vm); + + inline + bool isCallable(VM vm); + + inline + bool isProcedure(VM vm); + + inline + size_t procedureArity(VM vm); + + inline + void getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks); + + inline + void getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); + + inline + class mozart::GlobalNode * globalize(VM vm); + + inline + void setUUID(VM vm, const struct mozart::UUID & uuid); +}; diff --git a/vm/boostenv/main/cached/Abstraction-implem-decl.hh b/vm/boostenv/main/cached/Abstraction-implem-decl.hh new file mode 100644 index 000000000..5253c6a09 --- /dev/null +++ b/vm/boostenv/main/cached/Abstraction-implem-decl.hh @@ -0,0 +1,7 @@ +class Abstraction; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/Abstraction-implem.hh b/vm/boostenv/main/cached/Abstraction-implem.hh new file mode 100644 index 000000000..737474ce8 --- /dev/null +++ b/vm/boostenv/main/cached/Abstraction-implem.hh @@ -0,0 +1,116 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +GlobalNode* TypeInfoOf::globalize(VM vm, RichNode from) const { + assert(from.is()); + return from.as().globalize(vm); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::StableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +atom_t TypedRichNode::getPrintName(VM vm) { + return _self.access().getPrintName(vm); +} + +inline +bool TypedRichNode::isCallable(VM vm) { + return _self.access().isCallable(vm); +} + +inline +bool TypedRichNode::isProcedure(VM vm) { + return _self.access().isProcedure(vm); +} + +inline +size_t TypedRichNode::procedureArity(VM vm) { + return _self.access().procedureArity(vm); +} + +inline +void TypedRichNode::getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks) { + _self.access().getCallInfo(vm, arity, start, Xcount, Gs, Ks); +} + +inline +void TypedRichNode::getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData) { + _self.access().getDebugInfo(vm, printName, debugData); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} + +inline +class mozart::GlobalNode * TypedRichNode::globalize(VM vm) { + return _self.access().globalize(_self, vm); +} + +inline +void TypedRichNode::setUUID(VM vm, const struct mozart::UUID & uuid) { + _self.access().setUUID(_self, vm, uuid); +} diff --git a/vm/boostenv/main/cached/Arity-implem-decl-after.hh b/vm/boostenv/main/cached/Arity-implem-decl-after.hh new file mode 100644 index 000000000..d7b8bc912 --- /dev/null +++ b/vm/boostenv/main/cached/Arity-implem-decl-after.hh @@ -0,0 +1,79 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Arity", uuid(), false, false, false, sbStructural, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Arity::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::StableNode& getElements(size_t i); + + inline + size_t getArraySizeImpl(); + + inline + class mozart::StableNode * getLabel(); + + inline + size_t getWidth(); + + inline + class mozart::StableNode * getElement(size_t index); + + inline + bool equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, size_t & offset); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/Arity-implem-decl.hh b/vm/boostenv/main/cached/Arity-implem-decl.hh new file mode 100644 index 000000000..593265840 --- /dev/null +++ b/vm/boostenv/main/cached/Arity-implem-decl.hh @@ -0,0 +1,7 @@ +class Arity; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/Arity-implem.hh b/vm/boostenv/main/cached/Arity-implem.hh new file mode 100644 index 000000000..72f71a9dc --- /dev/null +++ b/vm/boostenv/main/cached/Arity-implem.hh @@ -0,0 +1,83 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::StableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +class mozart::StableNode * TypedRichNode::getLabel() { + return _self.access().getLabel(); +} + +inline +size_t TypedRichNode::getWidth() { + return _self.access().getWidth(); +} + +inline +class mozart::StableNode * TypedRichNode::getElement(size_t index) { + return _self.access().getElement(index); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack) { + return _self.access().equals(vm, right, stack); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, size_t & offset) { + return _self.access().lookupFeature(vm, feature, offset); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/Array-implem-decl-after.hh b/vm/boostenv/main/cached/Array-implem-decl-after.hh new file mode 100644 index 000000000..087d435fb --- /dev/null +++ b/vm/boostenv/main/cached/Array-implem-decl-after.hh @@ -0,0 +1,100 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Array", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Array::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::UnstableNode& getElements(size_t i); + + inline + class mozart::Space * home(); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + size_t getArraySizeImpl(); + + inline + size_t getWidth(); + + inline + nativeint getLow(); + + inline + nativeint getHigh(); + + inline + void dotAssign(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue); + + inline + class mozart::UnstableNode dotExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue); + + inline + bool isArray(VM vm); + + inline + class mozart::UnstableNode arrayLow(VM vm); + + inline + class mozart::UnstableNode arrayHigh(VM vm); + + inline + class mozart::UnstableNode arrayGet(VM vm, class mozart::RichNode index); + + inline + void arrayPut(VM vm, class mozart::RichNode index, class mozart::RichNode value); + + inline + class mozart::UnstableNode arrayExchange(VM vm, class mozart::RichNode index, class mozart::RichNode newValue); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Array-implem-decl.hh b/vm/boostenv/main/cached/Array-implem-decl.hh new file mode 100644 index 000000000..8f404ef0c --- /dev/null +++ b/vm/boostenv/main/cached/Array-implem-decl.hh @@ -0,0 +1,7 @@ +class Array; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/Array-implem.hh b/vm/boostenv/main/cached/Array-implem.hh new file mode 100644 index 000000000..44aee40ce --- /dev/null +++ b/vm/boostenv/main/cached/Array-implem.hh @@ -0,0 +1,126 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::UnstableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +size_t TypedRichNode::getWidth() { + return _self.access().getWidth(); +} + +inline +nativeint TypedRichNode::getLow() { + return _self.access().getLow(); +} + +inline +nativeint TypedRichNode::getHigh() { + return _self.access().getHigh(); +} + +inline +void TypedRichNode::dotAssign(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + _self.access().dotAssign(_self, vm, feature, newValue); +} + +inline +class mozart::UnstableNode TypedRichNode::dotExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + return _self.access().dotExchange(_self, vm, feature, newValue); +} + +inline +bool TypedRichNode::isArray(VM vm) { + return _self.access().isArray(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arrayLow(VM vm) { + return _self.access().arrayLow(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arrayHigh(VM vm) { + return _self.access().arrayHigh(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arrayGet(VM vm, class mozart::RichNode index) { + return _self.access().arrayGet(_self, vm, index); +} + +inline +void TypedRichNode::arrayPut(VM vm, class mozart::RichNode index, class mozart::RichNode value) { + _self.access().arrayPut(_self, vm, index, value); +} + +inline +class mozart::UnstableNode TypedRichNode::arrayExchange(VM vm, class mozart::RichNode index, class mozart::RichNode newValue) { + return _self.access().arrayExchange(_self, vm, index, newValue); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/ArrayLike-interf.hh b/vm/boostenv/main/cached/ArrayLike-interf.hh new file mode 100644 index 000000000..8cb1a58c8 --- /dev/null +++ b/vm/boostenv/main/cached/ArrayLike-interf.hh @@ -0,0 +1,104 @@ +class ArrayLike { +public: + ArrayLike(RichNode self) : _self(self) {} + ArrayLike(UnstableNode& self) : _self(self) {} + ArrayLike(StableNode& self) : _self(self) {} + + bool isArray(VM vm) { + if (_self.is()) { + return _self.as().isArray(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ArrayLike::isArray", "isArray", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isArray(_self, vm); + } + } + + class mozart::UnstableNode arrayLow(VM vm) { + if (_self.is()) { + return _self.as().arrayLow(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ArrayLike::arrayLow", "arrayLow", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().arrayLow(_self, vm); + } + } + + class mozart::UnstableNode arrayHigh(VM vm) { + if (_self.is()) { + return _self.as().arrayHigh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ArrayLike::arrayHigh", "arrayHigh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().arrayHigh(_self, vm); + } + } + + class mozart::UnstableNode arrayGet(VM vm, class mozart::RichNode index) { + if (_self.is()) { + return _self.as().arrayGet(vm, index); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ArrayLike::arrayGet", "arrayGet", index, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().arrayGet(_self, vm, index); + } + } + + void arrayPut(VM vm, class mozart::RichNode index, class mozart::RichNode value) { + if (_self.is()) { + return _self.as().arrayPut(vm, index, value); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ArrayLike::arrayPut", "arrayPut", index, value)) + return; + } + return Interface().arrayPut(_self, vm, index, value); + } + } + + class mozart::UnstableNode arrayExchange(VM vm, class mozart::RichNode index, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().arrayExchange(vm, index, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ArrayLike::arrayExchange", "arrayExchange", index, newValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().arrayExchange(_self, vm, index, newValue); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Atom-implem-decl-after.hh b/vm/boostenv/main/cached/Atom-implem-decl-after.hh new file mode 100644 index 000000000..e23cdf9da --- /dev/null +++ b/vm/boostenv/main/cached/Atom-implem-decl-after.hh @@ -0,0 +1,106 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return Atom::uuid; + } +public: + TypeInfoOf() : TypeInfo("Atom", uuid(), (! ::mozart::MemWord::requiresExternalMemory()), false, true, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Atom::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; + + inline + int compareFeatures(VM vm, RichNode lhs, RichNode rhs) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + bool isLiteral(VM vm); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isRecord(VM vm); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + atom_t value(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + int compareFeatures(VM vm, class mozart::RichNode right); + + inline + atom_t getPrintName(VM vm); + + inline + bool isAtom(VM vm); + + inline + int compare(VM vm, class mozart::RichNode right); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Atom-implem-decl.hh b/vm/boostenv/main/cached/Atom-implem-decl.hh new file mode 100644 index 000000000..6d1f61198 --- /dev/null +++ b/vm/boostenv/main/cached/Atom-implem-decl.hh @@ -0,0 +1,7 @@ +class Atom; + +template <> +class Storage { +public: + typedef atom_t Type; +}; diff --git a/vm/boostenv/main/cached/Atom-implem.hh b/vm/boostenv/main/cached/Atom-implem.hh new file mode 100644 index 000000000..9a0fe772e --- /dev/null +++ b/vm/boostenv/main/cached/Atom-implem.hh @@ -0,0 +1,131 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +int TypeInfoOf::compareFeatures(VM vm, RichNode lhs, RichNode rhs) const { + return lhs.as().compareFeatures(vm, rhs); +} + + +inline +bool TypedRichNode::isLiteral(VM vm) { + return _self.access().isLiteral(vm); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(_self, vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(_self, vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(_self, vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(_self, vm, label); +} + +inline +atom_t TypedRichNode::value() { + return _self.access().value(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +int TypedRichNode::compareFeatures(VM vm, class mozart::RichNode right) { + return _self.access().compareFeatures(vm, right); +} + +inline +atom_t TypedRichNode::getPrintName(VM vm) { + return _self.access().getPrintName(vm); +} + +inline +bool TypedRichNode::isAtom(VM vm) { + return _self.access().isAtom(vm); +} + +inline +int TypedRichNode::compare(VM vm, class mozart::RichNode right) { + return _self.access().compare(vm, right); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/AtomLike-interf.hh b/vm/boostenv/main/cached/AtomLike-interf.hh new file mode 100644 index 000000000..9dc552154 --- /dev/null +++ b/vm/boostenv/main/cached/AtomLike-interf.hh @@ -0,0 +1,20 @@ +class AtomLike { +public: + AtomLike(RichNode self) : _self(self) {} + AtomLike(UnstableNode& self) : _self(self) {} + AtomLike(StableNode& self) : _self(self) {} + + bool isAtom(VM vm) { + if (_self.is()) { + return _self.as().isAtom(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isAtom(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/BaseDottable-interf.hh b/vm/boostenv/main/cached/BaseDottable-interf.hh new file mode 100644 index 000000000..1fa125a11 --- /dev/null +++ b/vm/boostenv/main/cached/BaseDottable-interf.hh @@ -0,0 +1,85 @@ +class BaseDottable { +public: + BaseDottable(RichNode self) : _self(self) {} + BaseDottable(UnstableNode& self) : _self(self) {} + BaseDottable(StableNode& self) : _self(self) {} + + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::BaseDottable::lookupFeature", "lookupFeature", feature, value, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().lookupFeature(_self, vm, feature, value); + } + } + + bool lookupFeature(VM vm, nativeint feature, nullable value) { + if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.is()) { + return _self.as().lookupFeature(vm, feature, value); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::BaseDottable::lookupFeature", "lookupFeature", feature, value, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().lookupFeature(_self, vm, feature, value); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/BigInt-implem-decl-after.hh b/vm/boostenv/main/cached/BigInt-implem-decl-after.hh new file mode 100644 index 000000000..88f966a71 --- /dev/null +++ b/vm/boostenv/main/cached/BigInt-implem-decl-after.hh @@ -0,0 +1,100 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return BigInt::uuid; + } +public: + TypeInfoOf() : TypeInfo("BigInt", uuid(), false, false, true, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return BigInt::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; + + inline + int compareFeatures(VM vm, RichNode lhs, RichNode rhs) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + std::shared_ptr value(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + int compareFeatures(VM vm, class mozart::RichNode right); + + inline + int compare(VM vm, class mozart::RichNode right); + + inline + bool isNumber(VM vm); + + inline + bool isInt(VM vm); + + inline + bool isFloat(VM vm); + + inline + class mozart::UnstableNode opposite(VM vm); + + inline + class mozart::UnstableNode add(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode add(VM vm, nativeint b); + + inline + class mozart::UnstableNode subtract(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode multiply(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode div(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode mod(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode abs(VM vm); + + inline + double doubleValue(); + + inline + std::string str(); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/BigInt-implem-decl.hh b/vm/boostenv/main/cached/BigInt-implem-decl.hh new file mode 100644 index 000000000..2ef3c76e9 --- /dev/null +++ b/vm/boostenv/main/cached/BigInt-implem-decl.hh @@ -0,0 +1 @@ +class BigInt; diff --git a/vm/boostenv/main/cached/BigInt-implem.hh b/vm/boostenv/main/cached/BigInt-implem.hh new file mode 100644 index 000000000..77be62db4 --- /dev/null +++ b/vm/boostenv/main/cached/BigInt-implem.hh @@ -0,0 +1,121 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +int TypeInfoOf::compareFeatures(VM vm, RichNode lhs, RichNode rhs) const { + return lhs.as().compareFeatures(vm, rhs); +} + + +inline +std::shared_ptr TypedRichNode::value() { + return _self.access().value(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +int TypedRichNode::compareFeatures(VM vm, class mozart::RichNode right) { + return _self.access().compareFeatures(vm, right); +} + +inline +int TypedRichNode::compare(VM vm, class mozart::RichNode right) { + return _self.access().compare(vm, right); +} + +inline +bool TypedRichNode::isNumber(VM vm) { + return _self.access().isNumber(vm); +} + +inline +bool TypedRichNode::isInt(VM vm) { + return _self.access().isInt(vm); +} + +inline +bool TypedRichNode::isFloat(VM vm) { + return _self.access().isFloat(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::opposite(VM vm) { + return _self.access().opposite(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::add(VM vm, class mozart::RichNode right) { + return _self.access().add(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::add(VM vm, nativeint b) { + return _self.access().add(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::subtract(VM vm, class mozart::RichNode right) { + return _self.access().subtract(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::multiply(VM vm, class mozart::RichNode right) { + return _self.access().multiply(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::div(VM vm, class mozart::RichNode right) { + return _self.access().div(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::mod(VM vm, class mozart::RichNode right) { + return _self.access().mod(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::abs(VM vm) { + return _self.access().abs(_self, vm); +} + +inline +double TypedRichNode::doubleValue() { + return _self.access().doubleValue(); +} + +inline +std::string TypedRichNode::str() { + return _self.access().str(); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/BindableReadOnly-interf.hh b/vm/boostenv/main/cached/BindableReadOnly-interf.hh new file mode 100644 index 000000000..7bfbff94b --- /dev/null +++ b/vm/boostenv/main/cached/BindableReadOnly-interf.hh @@ -0,0 +1,19 @@ +class BindableReadOnly { +public: + BindableReadOnly(RichNode self) : _self(self) {} + BindableReadOnly(UnstableNode& self) : _self(self) {} + BindableReadOnly(StableNode& self) : _self(self) {} + + void bindReadOnly(VM vm, class mozart::RichNode src) { + if (_self.is()) { + return _self.as().bindReadOnly(vm, src); + } else if (_self.is()) { + return _self.as().bindReadOnly(vm, src); + } else { + return Interface().bindReadOnly(_self, vm, src); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Boolean-implem-decl-after.hh b/vm/boostenv/main/cached/Boolean-implem-decl-after.hh new file mode 100644 index 000000000..da2839d89 --- /dev/null +++ b/vm/boostenv/main/cached/Boolean-implem-decl-after.hh @@ -0,0 +1,109 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return Boolean::uuid; + } +public: + TypeInfoOf() : TypeInfo("Boolean", uuid(), (! ::mozart::MemWord::requiresExternalMemory()), false, true, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Boolean::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; + + inline + int compareFeatures(VM vm, RichNode lhs, RichNode rhs) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + bool isLiteral(VM vm); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isRecord(VM vm); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + bool value(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + int compareFeatures(VM vm, class mozart::RichNode right); + + inline + atom_t getPrintName(VM vm); + + inline + bool isName(VM vm); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Boolean-implem-decl.hh b/vm/boostenv/main/cached/Boolean-implem-decl.hh new file mode 100644 index 000000000..e6d8a4581 --- /dev/null +++ b/vm/boostenv/main/cached/Boolean-implem-decl.hh @@ -0,0 +1,7 @@ +class Boolean; + +template <> +class Storage { +public: + typedef bool Type; +}; diff --git a/vm/boostenv/main/cached/Boolean-implem.hh b/vm/boostenv/main/cached/Boolean-implem.hh new file mode 100644 index 000000000..049da9504 --- /dev/null +++ b/vm/boostenv/main/cached/Boolean-implem.hh @@ -0,0 +1,136 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +int TypeInfoOf::compareFeatures(VM vm, RichNode lhs, RichNode rhs) const { + return lhs.as().compareFeatures(vm, rhs); +} + + +inline +bool TypedRichNode::isLiteral(VM vm) { + return _self.access().isLiteral(vm); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(_self, vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(_self, vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(_self, vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(_self, vm, label); +} + +inline +bool TypedRichNode::value() { + return _self.access().value(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +int TypedRichNode::compareFeatures(VM vm, class mozart::RichNode right) { + return _self.access().compareFeatures(vm, right); +} + +inline +atom_t TypedRichNode::getPrintName(VM vm) { + return _self.access().getPrintName(vm); +} + +inline +bool TypedRichNode::isName(VM vm) { + return _self.access().isName(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/BuiltinCallable-interf.hh b/vm/boostenv/main/cached/BuiltinCallable-interf.hh new file mode 100644 index 000000000..6de15bc8b --- /dev/null +++ b/vm/boostenv/main/cached/BuiltinCallable-interf.hh @@ -0,0 +1,54 @@ +class BuiltinCallable { +public: + BuiltinCallable(RichNode self) : _self(self) {} + BuiltinCallable(UnstableNode& self) : _self(self) {} + BuiltinCallable(StableNode& self) : _self(self) {} + + bool isBuiltin(VM vm) { + if (_self.is()) { + return _self.as().isBuiltin(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isBuiltin(_self, vm); + } + } + + void callBuiltin(VM vm, size_t argc, class mozart::UnstableNode ** args) { + if (_self.is()) { + return _self.as().callBuiltin(vm, argc, args); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().callBuiltin(_self, vm, argc, args); + } + } + + template + void callBuiltin(VM vm, Args &&... args) { + if (_self.is()) { + return _self.as().callBuiltin(vm, std::forward(args)...); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().callBuiltin(_self, vm, std::forward(args)...); + } + } + + builtins::BaseBuiltin * getBuiltin(VM vm) { + if (_self.is()) { + return _self.as().getBuiltin(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().getBuiltin(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/BuiltinProcedure-implem-decl-after.hh b/vm/boostenv/main/cached/BuiltinProcedure-implem-decl-after.hh new file mode 100644 index 000000000..b662bedfb --- /dev/null +++ b/vm/boostenv/main/cached/BuiltinProcedure-implem-decl-after.hh @@ -0,0 +1,92 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("BuiltinProcedure", uuid(), (! ::mozart::MemWord::requiresExternalMemory()), false, false, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return BuiltinProcedure::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + builtins::BaseBuiltin * value(); + + inline + size_t getArity(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + atom_t getPrintName(VM vm); + + inline + bool isBuiltin(VM vm); + + inline + void callBuiltin(VM vm, size_t argc, class mozart::UnstableNode ** args); + + template + inline + void callBuiltin(VM vm, Args &&... args); + + inline + builtins::BaseBuiltin * getBuiltin(VM vm); + + inline + bool isCallable(VM vm); + + inline + bool isProcedure(VM vm); + + inline + size_t procedureArity(VM vm); + + inline + void getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks); + + inline + void getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/BuiltinProcedure-implem-decl.hh b/vm/boostenv/main/cached/BuiltinProcedure-implem-decl.hh new file mode 100644 index 000000000..ea4aba4a0 --- /dev/null +++ b/vm/boostenv/main/cached/BuiltinProcedure-implem-decl.hh @@ -0,0 +1,7 @@ +class BuiltinProcedure; + +template <> +class Storage { +public: + typedef builtins::BaseBuiltin * Type; +}; diff --git a/vm/boostenv/main/cached/BuiltinProcedure-implem.hh b/vm/boostenv/main/cached/BuiltinProcedure-implem.hh new file mode 100644 index 000000000..83160da7c --- /dev/null +++ b/vm/boostenv/main/cached/BuiltinProcedure-implem.hh @@ -0,0 +1,107 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +inline +builtins::BaseBuiltin * TypedRichNode::value() { + return _self.access().value(); +} + +inline +size_t TypedRichNode::getArity() { + return _self.access().getArity(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +atom_t TypedRichNode::getPrintName(VM vm) { + return _self.access().getPrintName(vm); +} + +inline +bool TypedRichNode::isBuiltin(VM vm) { + return _self.access().isBuiltin(vm); +} + +inline +void TypedRichNode::callBuiltin(VM vm, size_t argc, class mozart::UnstableNode ** args) { + _self.access().callBuiltin(vm, argc, args); +} + +template +inline +void TypedRichNode::callBuiltin(VM vm, Args &&... args) { + _self.access().callBuiltin(vm, std::forward(args)...); +} + +inline +builtins::BaseBuiltin * TypedRichNode::getBuiltin(VM vm) { + return _self.access().getBuiltin(vm); +} + +inline +bool TypedRichNode::isCallable(VM vm) { + return _self.access().isCallable(vm); +} + +inline +bool TypedRichNode::isProcedure(VM vm) { + return _self.access().isProcedure(vm); +} + +inline +size_t TypedRichNode::procedureArity(VM vm) { + return _self.access().procedureArity(vm); +} + +inline +void TypedRichNode::getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks) { + _self.access().getCallInfo(_self, vm, arity, start, Xcount, Gs, Ks); +} + +inline +void TypedRichNode::getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData) { + _self.access().getDebugInfo(_self, vm, printName, debugData); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/ByteString-implem-decl-after.hh b/vm/boostenv/main/cached/ByteString-implem-decl-after.hh new file mode 100644 index 000000000..b757fefb6 --- /dev/null +++ b/vm/boostenv/main/cached/ByteString-implem-decl-after.hh @@ -0,0 +1,91 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return ByteString::uuid; + } +public: + TypeInfoOf() : TypeInfo("ByteString", uuid(), false, false, false, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return ByteString::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + const LString & value(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + int compare(VM vm, class mozart::RichNode right); + + inline + bool isString(VM vm); + + inline + bool isByteString(VM vm); + + inline + LString * stringGet(VM vm); + + inline + LString * byteStringGet(VM vm); + + inline + nativeint stringCharAt(VM vm, class mozart::RichNode offset); + + inline + class mozart::UnstableNode stringAppend(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode stringSlice(VM vm, class mozart::RichNode from, class mozart::RichNode to); + + inline + void stringSearch(VM vm, class mozart::RichNode from, class mozart::RichNode needle, class mozart::UnstableNode & begin, class mozart::UnstableNode & end); + + inline + bool stringHasPrefix(VM vm, class mozart::RichNode prefix); + + inline + bool stringHasSuffix(VM vm, class mozart::RichNode suffix); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/ByteString-implem-decl.hh b/vm/boostenv/main/cached/ByteString-implem-decl.hh new file mode 100644 index 000000000..933dd71a0 --- /dev/null +++ b/vm/boostenv/main/cached/ByteString-implem-decl.hh @@ -0,0 +1 @@ +class ByteString; diff --git a/vm/boostenv/main/cached/ByteString-implem.hh b/vm/boostenv/main/cached/ByteString-implem.hh new file mode 100644 index 000000000..167ec8b38 --- /dev/null +++ b/vm/boostenv/main/cached/ByteString-implem.hh @@ -0,0 +1,106 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +const LString & TypedRichNode::value() { + return _self.access().value(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +int TypedRichNode::compare(VM vm, class mozart::RichNode right) { + return _self.access().compare(vm, right); +} + +inline +bool TypedRichNode::isString(VM vm) { + return _self.access().isString(vm); +} + +inline +bool TypedRichNode::isByteString(VM vm) { + return _self.access().isByteString(vm); +} + +inline +LString * TypedRichNode::stringGet(VM vm) { + return _self.access().stringGet(_self, vm); +} + +inline +LString * TypedRichNode::byteStringGet(VM vm) { + return _self.access().byteStringGet(vm); +} + +inline +nativeint TypedRichNode::stringCharAt(VM vm, class mozart::RichNode offset) { + return _self.access().stringCharAt(_self, vm, offset); +} + +inline +class mozart::UnstableNode TypedRichNode::stringAppend(VM vm, class mozart::RichNode right) { + return _self.access().stringAppend(_self, vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::stringSlice(VM vm, class mozart::RichNode from, class mozart::RichNode to) { + return _self.access().stringSlice(_self, vm, from, to); +} + +inline +void TypedRichNode::stringSearch(VM vm, class mozart::RichNode from, class mozart::RichNode needle, class mozart::UnstableNode & begin, class mozart::UnstableNode & end) { + _self.access().stringSearch(_self, vm, from, needle, begin, end); +} + +inline +bool TypedRichNode::stringHasPrefix(VM vm, class mozart::RichNode prefix) { + return _self.access().stringHasPrefix(vm, prefix); +} + +inline +bool TypedRichNode::stringHasSuffix(VM vm, class mozart::RichNode suffix) { + return _self.access().stringHasSuffix(vm, suffix); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/Callable-interf.hh b/vm/boostenv/main/cached/Callable-interf.hh new file mode 100644 index 000000000..accdfc6fd --- /dev/null +++ b/vm/boostenv/main/cached/Callable-interf.hh @@ -0,0 +1,84 @@ +class Callable { +public: + Callable(RichNode self) : _self(self) {} + Callable(UnstableNode& self) : _self(self) {} + Callable(StableNode& self) : _self(self) {} + + bool isCallable(VM vm) { + if (_self.is()) { + return _self.as().isCallable(vm); + } else if (_self.is()) { + return _self.as().isCallable(vm); + } else if (_self.is()) { + return _self.as().isCallable(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isCallable(_self, vm); + } + } + + bool isProcedure(VM vm) { + if (_self.is()) { + return _self.as().isProcedure(vm); + } else if (_self.is()) { + return _self.as().isProcedure(vm); + } else if (_self.is()) { + return _self.as().isProcedure(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isProcedure(_self, vm); + } + } + + size_t procedureArity(VM vm) { + if (_self.is()) { + return _self.as().procedureArity(vm); + } else if (_self.is()) { + return _self.as().procedureArity(vm); + } else if (_self.is()) { + return _self.as().procedureArity(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().procedureArity(_self, vm); + } + } + + void getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks) { + if (_self.is()) { + return _self.as().getCallInfo(vm, arity, start, Xcount, Gs, Ks); + } else if (_self.is()) { + return _self.as().getCallInfo(vm, arity, start, Xcount, Gs, Ks); + } else if (_self.is()) { + return _self.as().getCallInfo(vm, arity, start, Xcount, Gs, Ks); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().getCallInfo(_self, vm, arity, start, Xcount, Gs, Ks); + } + } + + void getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData) { + if (_self.is()) { + return _self.as().getDebugInfo(vm, printName, debugData); + } else if (_self.is()) { + return _self.as().getDebugInfo(vm, printName, debugData); + } else if (_self.is()) { + return _self.as().getDebugInfo(vm, printName, debugData); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().getDebugInfo(_self, vm, printName, debugData); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Cell-implem-decl-after.hh b/vm/boostenv/main/cached/Cell-implem-decl-after.hh new file mode 100644 index 000000000..b808ef55c --- /dev/null +++ b/vm/boostenv/main/cached/Cell-implem-decl-after.hh @@ -0,0 +1,61 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Cell", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Cell::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + bool isCell(VM vm); + + inline + class mozart::UnstableNode exchange(VM vm, class mozart::RichNode newValue); + + inline + class mozart::UnstableNode access(VM vm); + + inline + void assign(VM vm, class mozart::RichNode newValue); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Cell-implem-decl.hh b/vm/boostenv/main/cached/Cell-implem-decl.hh new file mode 100644 index 000000000..4e69e1a80 --- /dev/null +++ b/vm/boostenv/main/cached/Cell-implem-decl.hh @@ -0,0 +1 @@ +class Cell; diff --git a/vm/boostenv/main/cached/Cell-implem.hh b/vm/boostenv/main/cached/Cell-implem.hh new file mode 100644 index 000000000..0ad5098ec --- /dev/null +++ b/vm/boostenv/main/cached/Cell-implem.hh @@ -0,0 +1,64 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::isCell(VM vm) { + return _self.access().isCell(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::exchange(VM vm, class mozart::RichNode newValue) { + return _self.access().exchange(vm, newValue); +} + +inline +class mozart::UnstableNode TypedRichNode::access(VM vm) { + return _self.access().access(vm); +} + +inline +void TypedRichNode::assign(VM vm, class mozart::RichNode newValue) { + _self.access().assign(vm, newValue); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/CellLike-interf.hh b/vm/boostenv/main/cached/CellLike-interf.hh new file mode 100644 index 000000000..f4d12ee8d --- /dev/null +++ b/vm/boostenv/main/cached/CellLike-interf.hh @@ -0,0 +1,72 @@ +class CellLike { +public: + CellLike(RichNode self) : _self(self) {} + CellLike(UnstableNode& self) : _self(self) {} + CellLike(StableNode& self) : _self(self) {} + + bool isCell(VM vm) { + if (_self.is()) { + return _self.as().isCell(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::CellLike::isCell", "isCell", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isCell(_self, vm); + } + } + + class mozart::UnstableNode exchange(VM vm, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().exchange(vm, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::CellLike::exchange", "exchange", newValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().exchange(_self, vm, newValue); + } + } + + class mozart::UnstableNode access(VM vm) { + if (_self.is()) { + return _self.as().access(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::CellLike::access", "access", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().access(_self, vm); + } + } + + void assign(VM vm, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().assign(vm, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::CellLike::assign", "assign", newValue)) + return; + } + return Interface().assign(_self, vm, newValue); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Chunk-implem-decl-after.hh b/vm/boostenv/main/cached/Chunk-implem-decl-after.hh new file mode 100644 index 000000000..c77427ea4 --- /dev/null +++ b/vm/boostenv/main/cached/Chunk-implem-decl-after.hh @@ -0,0 +1,64 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Chunk", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Chunk::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::StableNode * getUnderlying(); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isChunk(VM vm); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/Chunk-implem-decl.hh b/vm/boostenv/main/cached/Chunk-implem-decl.hh new file mode 100644 index 000000000..13f291889 --- /dev/null +++ b/vm/boostenv/main/cached/Chunk-implem-decl.hh @@ -0,0 +1,7 @@ +class Chunk; + +template <> +class Storage { +public: + typedef class mozart::StableNode * Type; +}; diff --git a/vm/boostenv/main/cached/Chunk-implem.hh b/vm/boostenv/main/cached/Chunk-implem.hh new file mode 100644 index 000000000..7e58f9250 --- /dev/null +++ b/vm/boostenv/main/cached/Chunk-implem.hh @@ -0,0 +1,63 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + StableNode* stable = new (gc->vm) StableNode; + to.make(gc->vm, stable); + stable->make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +inline +class mozart::StableNode * TypedRichNode::getUnderlying() { + return _self.access().getUnderlying(); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isChunk(VM vm) { + return _self.access().isChunk(vm); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/ChunkLike-interf.hh b/vm/boostenv/main/cached/ChunkLike-interf.hh new file mode 100644 index 000000000..4a35b6b74 --- /dev/null +++ b/vm/boostenv/main/cached/ChunkLike-interf.hh @@ -0,0 +1,27 @@ +class ChunkLike { +public: + ChunkLike(RichNode self) : _self(self) {} + ChunkLike(UnstableNode& self) : _self(self) {} + ChunkLike(StableNode& self) : _self(self) {} + + bool isChunk(VM vm) { + if (_self.is()) { + return _self.as().isChunk(vm); + } else if (_self.is()) { + return _self.as().isChunk(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ChunkLike::isChunk", "isChunk", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isChunk(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/CodeArea-implem-decl-after.hh b/vm/boostenv/main/cached/CodeArea-implem-decl-after.hh new file mode 100644 index 000000000..21003cb6c --- /dev/null +++ b/vm/boostenv/main/cached/CodeArea-implem-decl-after.hh @@ -0,0 +1,82 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("CodeArea", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return CodeArea::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + GlobalNode* globalize(VM vm, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::StableNode& getElements(size_t i); + + inline + size_t getArraySizeImpl(); + + inline + bool isCodeAreaProvider(VM vm); + + inline + void getCodeAreaInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Ks); + + inline + void getCodeAreaDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); + + inline + class mozart::GlobalNode * globalize(VM vm); + + inline + void setUUID(VM vm, const struct mozart::UUID & uuid); +}; diff --git a/vm/boostenv/main/cached/CodeArea-implem-decl.hh b/vm/boostenv/main/cached/CodeArea-implem-decl.hh new file mode 100644 index 000000000..a2ec4250d --- /dev/null +++ b/vm/boostenv/main/cached/CodeArea-implem-decl.hh @@ -0,0 +1,7 @@ +class CodeArea; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/CodeArea-implem.hh b/vm/boostenv/main/cached/CodeArea-implem.hh new file mode 100644 index 000000000..bbe5d81ed --- /dev/null +++ b/vm/boostenv/main/cached/CodeArea-implem.hh @@ -0,0 +1,88 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +GlobalNode* TypeInfoOf::globalize(VM vm, RichNode from) const { + assert(from.is()); + return from.as().globalize(vm); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::StableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +bool TypedRichNode::isCodeAreaProvider(VM vm) { + return _self.access().isCodeAreaProvider(vm); +} + +inline +void TypedRichNode::getCodeAreaInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Ks) { + _self.access().getCodeAreaInfo(vm, arity, start, Xcount, Ks); +} + +inline +void TypedRichNode::getCodeAreaDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData) { + _self.access().getCodeAreaDebugInfo(vm, printName, debugData); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} + +inline +class mozart::GlobalNode * TypedRichNode::globalize(VM vm) { + return _self.access().globalize(_self, vm); +} + +inline +void TypedRichNode::setUUID(VM vm, const struct mozart::UUID & uuid) { + _self.access().setUUID(_self, vm, uuid); +} diff --git a/vm/boostenv/main/cached/CodeAreaProvider-interf.hh b/vm/boostenv/main/cached/CodeAreaProvider-interf.hh new file mode 100644 index 000000000..b37b30ffc --- /dev/null +++ b/vm/boostenv/main/cached/CodeAreaProvider-interf.hh @@ -0,0 +1,42 @@ +class CodeAreaProvider { +public: + CodeAreaProvider(RichNode self) : _self(self) {} + CodeAreaProvider(UnstableNode& self) : _self(self) {} + CodeAreaProvider(StableNode& self) : _self(self) {} + + bool isCodeAreaProvider(VM vm) { + if (_self.is()) { + return _self.as().isCodeAreaProvider(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isCodeAreaProvider(_self, vm); + } + } + + void getCodeAreaInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Ks) { + if (_self.is()) { + return _self.as().getCodeAreaInfo(vm, arity, start, Xcount, Ks); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().getCodeAreaInfo(_self, vm, arity, start, Xcount, Ks); + } + } + + void getCodeAreaDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData) { + if (_self.is()) { + return _self.as().getCodeAreaDebugInfo(vm, printName, debugData); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().getCodeAreaDebugInfo(_self, vm, printName, debugData); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Comparable-interf.hh b/vm/boostenv/main/cached/Comparable-interf.hh new file mode 100644 index 000000000..ce9900b92 --- /dev/null +++ b/vm/boostenv/main/cached/Comparable-interf.hh @@ -0,0 +1,35 @@ +class Comparable { +public: + Comparable(RichNode self) : _self(self) {} + Comparable(UnstableNode& self) : _self(self) {} + Comparable(StableNode& self) : _self(self) {} + + int compare(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().compare(vm, right); + } else if (_self.is()) { + return _self.as().compare(vm, right); + } else if (_self.is()) { + return _self.as().compare(vm, right); + } else if (_self.is()) { + return _self.as().compare(vm, right); + } else if (_self.is()) { + return _self.as().compare(vm, right); + } else if (_self.is()) { + return _self.as().compare(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + int _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Comparable::compare", "compare", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().compare(_self, vm, right); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Cons-implem-decl-after.hh b/vm/boostenv/main/cached/Cons-implem-decl-after.hh new file mode 100644 index 000000000..a0509c35d --- /dev/null +++ b/vm/boostenv/main/cached/Cons-implem-decl-after.hh @@ -0,0 +1,103 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Cons", uuid(), false, false, false, sbStructural, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Cons::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + class mozart::StableNode * getHead(); + + inline + class mozart::StableNode * getTail(); + + inline + StaticArray getElementsArray(); + + inline + bool equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack); + + inline + bool isRecord(VM vm); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + bool hasListRepr(VM vm, int depth); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/Cons-implem-decl.hh b/vm/boostenv/main/cached/Cons-implem-decl.hh new file mode 100644 index 000000000..c41908b7c --- /dev/null +++ b/vm/boostenv/main/cached/Cons-implem-decl.hh @@ -0,0 +1 @@ +class Cons; diff --git a/vm/boostenv/main/cached/Cons-implem.hh b/vm/boostenv/main/cached/Cons-implem.hh new file mode 100644 index 000000000..6eaf7bf15 --- /dev/null +++ b/vm/boostenv/main/cached/Cons-implem.hh @@ -0,0 +1,126 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +class mozart::StableNode * TypedRichNode::getHead() { + return _self.access().getHead(); +} + +inline +class mozart::StableNode * TypedRichNode::getTail() { + return _self.access().getTail(); +} + +inline +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack) { + return _self.access().equals(vm, right, stack); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(vm, label); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +bool TypedRichNode::hasListRepr(VM vm, int depth) { + return _self.access().hasListRepr(vm, depth); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/DataflowVariable-interf.hh b/vm/boostenv/main/cached/DataflowVariable-interf.hh new file mode 100644 index 000000000..2f57cd7d1 --- /dev/null +++ b/vm/boostenv/main/cached/DataflowVariable-interf.hh @@ -0,0 +1,81 @@ +class DataflowVariable { +public: + DataflowVariable(RichNode self) : _self(self) {} + DataflowVariable(UnstableNode& self) : _self(self) {} + DataflowVariable(StableNode& self) : _self(self) {} + + void addToSuspendList(VM vm, class mozart::RichNode variable) { + if (_self.is()) { + return _self.as().addToSuspendList(vm, variable); + } else if (_self.is()) { + return _self.as().addToSuspendList(vm, variable); + } else if (_self.is()) { + return _self.as().addToSuspendList(vm, variable); + } else if (_self.is()) { + return _self.as().addToSuspendList(vm, variable); + } else if (_self.is()) { + return _self.as().addToSuspendList(vm, variable); + } else if (_self.is()) { + return _self.as().addToSuspendList(vm, variable); + } else { + return Interface().addToSuspendList(_self, vm, variable); + } + } + + bool isNeeded(VM vm) { + if (_self.is()) { + return _self.as().isNeeded(vm); + } else if (_self.is()) { + return _self.as().isNeeded(vm); + } else if (_self.is()) { + return _self.as().isNeeded(vm); + } else if (_self.is()) { + return _self.as().isNeeded(vm); + } else if (_self.is()) { + return _self.as().isNeeded(vm); + } else if (_self.is()) { + return _self.as().isNeeded(vm); + } else { + return Interface().isNeeded(_self, vm); + } + } + + void markNeeded(VM vm) { + if (_self.is()) { + return _self.as().markNeeded(vm); + } else if (_self.is()) { + return _self.as().markNeeded(vm); + } else if (_self.is()) { + return _self.as().markNeeded(vm); + } else if (_self.is()) { + return _self.as().markNeeded(vm); + } else if (_self.is()) { + return _self.as().markNeeded(vm); + } else if (_self.is()) { + return _self.as().markNeeded(vm); + } else { + return Interface().markNeeded(_self, vm); + } + } + + void bind(VM vm, class mozart::RichNode src) { + if (_self.is()) { + return _self.as().bind(vm, src); + } else if (_self.is()) { + return _self.as().bind(vm, src); + } else if (_self.is()) { + return _self.as().bind(vm, src); + } else if (_self.is()) { + return _self.as().bind(vm, src); + } else if (_self.is()) { + return _self.as().bind(vm, src); + } else if (_self.is()) { + return _self.as().bind(vm, src); + } else { + return Interface().bind(_self, vm, src); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Dictionary-implem-decl-after.hh b/vm/boostenv/main/cached/Dictionary-implem-decl-after.hh new file mode 100644 index 000000000..7755836e0 --- /dev/null +++ b/vm/boostenv/main/cached/Dictionary-implem-decl-after.hh @@ -0,0 +1,106 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Dictionary", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Dictionary::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + void dotAssign(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue); + + inline + class mozart::UnstableNode dotExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue); + + inline + bool isDictionary(VM vm); + + inline + bool dictIsEmpty(VM vm); + + inline + bool dictMember(VM vm, class mozart::RichNode feature); + + inline + class mozart::UnstableNode dictGet(VM vm, class mozart::RichNode feature); + + inline + class mozart::UnstableNode dictCondGet(VM vm, class mozart::RichNode feature, class mozart::RichNode defaultValue); + + inline + void dictPut(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue); + + inline + class mozart::UnstableNode dictExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue); + + inline + class mozart::UnstableNode dictCondExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode defaultValue, class mozart::RichNode newValue); + + inline + void dictRemove(VM vm, class mozart::RichNode feature); + + inline + void dictRemoveAll(VM vm); + + inline + class mozart::UnstableNode dictKeys(VM vm); + + inline + class mozart::UnstableNode dictEntries(VM vm); + + inline + class mozart::UnstableNode dictItems(VM vm); + + inline + class mozart::UnstableNode dictClone(VM vm); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::NodeDictionary & getDict(); +}; diff --git a/vm/boostenv/main/cached/Dictionary-implem-decl.hh b/vm/boostenv/main/cached/Dictionary-implem-decl.hh new file mode 100644 index 000000000..ed3c5cfac --- /dev/null +++ b/vm/boostenv/main/cached/Dictionary-implem-decl.hh @@ -0,0 +1 @@ +class Dictionary; diff --git a/vm/boostenv/main/cached/Dictionary-implem.hh b/vm/boostenv/main/cached/Dictionary-implem.hh new file mode 100644 index 000000000..05d4513b9 --- /dev/null +++ b/vm/boostenv/main/cached/Dictionary-implem.hh @@ -0,0 +1,139 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +void TypedRichNode::dotAssign(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + _self.access().dotAssign(vm, feature, newValue); +} + +inline +class mozart::UnstableNode TypedRichNode::dotExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + return _self.access().dotExchange(_self, vm, feature, newValue); +} + +inline +bool TypedRichNode::isDictionary(VM vm) { + return _self.access().isDictionary(vm); +} + +inline +bool TypedRichNode::dictIsEmpty(VM vm) { + return _self.access().dictIsEmpty(vm); +} + +inline +bool TypedRichNode::dictMember(VM vm, class mozart::RichNode feature) { + return _self.access().dictMember(vm, feature); +} + +inline +class mozart::UnstableNode TypedRichNode::dictGet(VM vm, class mozart::RichNode feature) { + return _self.access().dictGet(_self, vm, feature); +} + +inline +class mozart::UnstableNode TypedRichNode::dictCondGet(VM vm, class mozart::RichNode feature, class mozart::RichNode defaultValue) { + return _self.access().dictCondGet(vm, feature, defaultValue); +} + +inline +void TypedRichNode::dictPut(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + _self.access().dictPut(vm, feature, newValue); +} + +inline +class mozart::UnstableNode TypedRichNode::dictExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + return _self.access().dictExchange(_self, vm, feature, newValue); +} + +inline +class mozart::UnstableNode TypedRichNode::dictCondExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode defaultValue, class mozart::RichNode newValue) { + return _self.access().dictCondExchange(vm, feature, defaultValue, newValue); +} + +inline +void TypedRichNode::dictRemove(VM vm, class mozart::RichNode feature) { + _self.access().dictRemove(vm, feature); +} + +inline +void TypedRichNode::dictRemoveAll(VM vm) { + _self.access().dictRemoveAll(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::dictKeys(VM vm) { + return _self.access().dictKeys(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::dictEntries(VM vm) { + return _self.access().dictEntries(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::dictItems(VM vm) { + return _self.access().dictItems(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::dictClone(VM vm) { + return _self.access().dictClone(vm); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::NodeDictionary & TypedRichNode::getDict() { + return _self.access().getDict(); +} diff --git a/vm/boostenv/main/cached/DictionaryLike-interf.hh b/vm/boostenv/main/cached/DictionaryLike-interf.hh new file mode 100644 index 000000000..06fc94d0f --- /dev/null +++ b/vm/boostenv/main/cached/DictionaryLike-interf.hh @@ -0,0 +1,230 @@ +class DictionaryLike { +public: + DictionaryLike(RichNode self) : _self(self) {} + DictionaryLike(UnstableNode& self) : _self(self) {} + DictionaryLike(StableNode& self) : _self(self) {} + + bool isDictionary(VM vm) { + if (_self.is()) { + return _self.as().isDictionary(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::isDictionary", "isDictionary", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isDictionary(_self, vm); + } + } + + bool dictIsEmpty(VM vm) { + if (_self.is()) { + return _self.as().dictIsEmpty(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictIsEmpty", "dictIsEmpty", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictIsEmpty(_self, vm); + } + } + + bool dictMember(VM vm, class mozart::RichNode feature) { + if (_self.is()) { + return _self.as().dictMember(vm, feature); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictMember", "dictMember", feature, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictMember(_self, vm, feature); + } + } + + class mozart::UnstableNode dictGet(VM vm, class mozart::RichNode feature) { + if (_self.is()) { + return _self.as().dictGet(vm, feature); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictGet", "dictGet", feature, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictGet(_self, vm, feature); + } + } + + class mozart::UnstableNode dictCondGet(VM vm, class mozart::RichNode feature, class mozart::RichNode defaultValue) { + if (_self.is()) { + return _self.as().dictCondGet(vm, feature, defaultValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictCondGet", "dictCondGet", feature, defaultValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictCondGet(_self, vm, feature, defaultValue); + } + } + + void dictPut(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().dictPut(vm, feature, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictPut", "dictPut", feature, newValue)) + return; + } + return Interface().dictPut(_self, vm, feature, newValue); + } + } + + class mozart::UnstableNode dictExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().dictExchange(vm, feature, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictExchange", "dictExchange", feature, newValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictExchange(_self, vm, feature, newValue); + } + } + + class mozart::UnstableNode dictCondExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode defaultValue, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().dictCondExchange(vm, feature, defaultValue, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictCondExchange", "dictCondExchange", feature, defaultValue, newValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictCondExchange(_self, vm, feature, defaultValue, newValue); + } + } + + void dictRemove(VM vm, class mozart::RichNode feature) { + if (_self.is()) { + return _self.as().dictRemove(vm, feature); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictRemove", "dictRemove", feature)) + return; + } + return Interface().dictRemove(_self, vm, feature); + } + } + + void dictRemoveAll(VM vm) { + if (_self.is()) { + return _self.as().dictRemoveAll(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictRemoveAll", "dictRemoveAll")) + return; + } + return Interface().dictRemoveAll(_self, vm); + } + } + + class mozart::UnstableNode dictKeys(VM vm) { + if (_self.is()) { + return _self.as().dictKeys(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictKeys", "dictKeys", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictKeys(_self, vm); + } + } + + class mozart::UnstableNode dictEntries(VM vm) { + if (_self.is()) { + return _self.as().dictEntries(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictEntries", "dictEntries", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictEntries(_self, vm); + } + } + + class mozart::UnstableNode dictItems(VM vm) { + if (_self.is()) { + return _self.as().dictItems(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictItems", "dictItems", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictItems(_self, vm); + } + } + + class mozart::UnstableNode dictClone(VM vm) { + if (_self.is()) { + return _self.as().dictClone(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DictionaryLike::dictClone", "dictClone", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dictClone(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/DotAssignable-interf.hh b/vm/boostenv/main/cached/DotAssignable-interf.hh new file mode 100644 index 000000000..66ae750a6 --- /dev/null +++ b/vm/boostenv/main/cached/DotAssignable-interf.hh @@ -0,0 +1,44 @@ +class DotAssignable { +public: + DotAssignable(RichNode self) : _self(self) {} + DotAssignable(UnstableNode& self) : _self(self) {} + DotAssignable(StableNode& self) : _self(self) {} + + void dotAssign(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().dotAssign(vm, feature, newValue); + } else if (_self.is()) { + return _self.as().dotAssign(vm, feature, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DotAssignable::dotAssign", "dotAssign", feature, newValue)) + return; + } + return Interface().dotAssign(_self, vm, feature, newValue); + } + } + + class mozart::UnstableNode dotExchange(VM vm, class mozart::RichNode feature, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().dotExchange(vm, feature, newValue); + } else if (_self.is()) { + return _self.as().dotExchange(vm, feature, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::DotAssignable::dotExchange", "dotExchange", feature, newValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().dotExchange(_self, vm, feature, newValue); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/FailedSpace-implem-decl-after.hh b/vm/boostenv/main/cached/FailedSpace-implem-decl-after.hh new file mode 100644 index 000000000..135b1978f --- /dev/null +++ b/vm/boostenv/main/cached/FailedSpace-implem-decl-after.hh @@ -0,0 +1,60 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("FailedSpace", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return FailedSpace::getTypeAtom(vm); + } + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + bool isSpace(VM vm); + + inline + class mozart::UnstableNode askSpace(VM vm); + + inline + class mozart::UnstableNode askVerboseSpace(VM vm); + + inline + class mozart::UnstableNode mergeSpace(VM vm); + + inline + void commitSpace(VM vm, class mozart::RichNode value); + + inline + class mozart::UnstableNode cloneSpace(VM vm); + + inline + void killSpace(VM vm); +}; diff --git a/vm/boostenv/main/cached/FailedSpace-implem-decl.hh b/vm/boostenv/main/cached/FailedSpace-implem-decl.hh new file mode 100644 index 000000000..331ad0949 --- /dev/null +++ b/vm/boostenv/main/cached/FailedSpace-implem-decl.hh @@ -0,0 +1,7 @@ +class FailedSpace; + +template <> +class Storage { +public: + typedef struct mozart::unit_t Type; +}; diff --git a/vm/boostenv/main/cached/FailedSpace-implem.hh b/vm/boostenv/main/cached/FailedSpace-implem.hh new file mode 100644 index 000000000..0c00900b9 --- /dev/null +++ b/vm/boostenv/main/cached/FailedSpace-implem.hh @@ -0,0 +1,55 @@ + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +inline +bool TypedRichNode::isSpace(VM vm) { + return _self.access().isSpace(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::askSpace(VM vm) { + return _self.access().askSpace(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::askVerboseSpace(VM vm) { + return _self.access().askVerboseSpace(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::mergeSpace(VM vm) { + return _self.access().mergeSpace(vm); +} + +inline +void TypedRichNode::commitSpace(VM vm, class mozart::RichNode value) { + _self.access().commitSpace(vm, value); +} + +inline +class mozart::UnstableNode TypedRichNode::cloneSpace(VM vm) { + return _self.access().cloneSpace(vm); +} + +inline +void TypedRichNode::killSpace(VM vm) { + _self.access().killSpace(vm); +} diff --git a/vm/boostenv/main/cached/FailedValue-implem-decl-after.hh b/vm/boostenv/main/cached/FailedValue-implem-decl-after.hh new file mode 100644 index 000000000..0653a8f01 --- /dev/null +++ b/vm/boostenv/main/cached/FailedValue-implem-decl-after.hh @@ -0,0 +1,60 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("FailedValue", uuid(), false, true, false, sbVariable, 10) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::StableNode * getUnderlying(); + + inline + void raiseUnderlying(VM vm); + + inline + void addToSuspendList(VM vm, class mozart::RichNode variable); + + inline + bool isNeeded(VM vm); + + inline + void markNeeded(VM vm); + + inline + void bind(VM vm, class mozart::RichNode src); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/FailedValue-implem-decl.hh b/vm/boostenv/main/cached/FailedValue-implem-decl.hh new file mode 100644 index 000000000..0b8df9f7a --- /dev/null +++ b/vm/boostenv/main/cached/FailedValue-implem-decl.hh @@ -0,0 +1,7 @@ +class FailedValue; + +template <> +class Storage { +public: + typedef class mozart::StableNode * Type; +}; diff --git a/vm/boostenv/main/cached/FailedValue-implem.hh b/vm/boostenv/main/cached/FailedValue-implem.hh new file mode 100644 index 000000000..f23db8fd5 --- /dev/null +++ b/vm/boostenv/main/cached/FailedValue-implem.hh @@ -0,0 +1,63 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + StableNode* stable = new (gc->vm) StableNode; + to.make(gc->vm, stable); + stable->make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +inline +class mozart::StableNode * TypedRichNode::getUnderlying() { + return _self.access().getUnderlying(); +} + +inline +void TypedRichNode::raiseUnderlying(VM vm) { + _self.access().raiseUnderlying(vm); +} + +inline +void TypedRichNode::addToSuspendList(VM vm, class mozart::RichNode variable) { + _self.access().addToSuspendList(vm, variable); +} + +inline +bool TypedRichNode::isNeeded(VM vm) { + return _self.access().isNeeded(vm); +} + +inline +void TypedRichNode::markNeeded(VM vm) { + _self.access().markNeeded(vm); +} + +inline +void TypedRichNode::bind(VM vm, class mozart::RichNode src) { + _self.access().bind(vm, src); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/Float-implem-decl-after.hh b/vm/boostenv/main/cached/Float-implem-decl-after.hh new file mode 100644 index 000000000..9a618418b --- /dev/null +++ b/vm/boostenv/main/cached/Float-implem-decl-after.hh @@ -0,0 +1,175 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Float", uuid(), (! ::mozart::MemWord::requiresExternalMemory()), false, false, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Float::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + double value(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + int compare(VM vm, class mozart::RichNode right); + + inline + bool isNumber(VM vm); + + inline + bool isInt(VM vm); + + inline + bool isFloat(VM vm); + + inline + class mozart::UnstableNode opposite(VM vm); + + inline + class mozart::UnstableNode add(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode add(VM vm, nativeint right); + + inline + class mozart::UnstableNode addValue(VM vm, double b); + + inline + class mozart::UnstableNode subtract(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode subtractValue(VM vm, double b); + + inline + class mozart::UnstableNode multiply(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode multiplyValue(VM vm, double b); + + inline + class mozart::UnstableNode divide(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode divideValue(VM vm, double b); + + inline + class mozart::UnstableNode fmod(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode fmodValue(VM vm, double b); + + inline + class mozart::UnstableNode div(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode mod(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode pow(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode powValue(VM vm, double b); + + inline + class mozart::UnstableNode abs(VM vm); + + inline + class mozart::UnstableNode acos(VM vm); + + inline + class mozart::UnstableNode acosh(VM vm); + + inline + class mozart::UnstableNode asin(VM vm); + + inline + class mozart::UnstableNode asinh(VM vm); + + inline + class mozart::UnstableNode atan(VM vm); + + inline + class mozart::UnstableNode atanh(VM vm); + + inline + class mozart::UnstableNode atan2(VM vm, class mozart::RichNode right); + + inline + class mozart::UnstableNode atan2Value(VM vm, double b); + + inline + class mozart::UnstableNode ceil(VM vm); + + inline + class mozart::UnstableNode cos(VM vm); + + inline + class mozart::UnstableNode cosh(VM vm); + + inline + class mozart::UnstableNode exp(VM vm); + + inline + class mozart::UnstableNode floor(VM vm); + + inline + class mozart::UnstableNode log(VM vm); + + inline + class mozart::UnstableNode round(VM vm); + + inline + class mozart::UnstableNode sin(VM vm); + + inline + class mozart::UnstableNode sinh(VM vm); + + inline + class mozart::UnstableNode sqrt(VM vm); + + inline + class mozart::UnstableNode tan(VM vm); + + inline + class mozart::UnstableNode tanh(VM vm); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Float-implem-decl.hh b/vm/boostenv/main/cached/Float-implem-decl.hh new file mode 100644 index 000000000..1003bd74c --- /dev/null +++ b/vm/boostenv/main/cached/Float-implem-decl.hh @@ -0,0 +1,7 @@ +class Float; + +template <> +class Storage { +public: + typedef double Type; +}; diff --git a/vm/boostenv/main/cached/Float-implem.hh b/vm/boostenv/main/cached/Float-implem.hh new file mode 100644 index 000000000..80b8de832 --- /dev/null +++ b/vm/boostenv/main/cached/Float-implem.hh @@ -0,0 +1,246 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +inline +double TypedRichNode::value() { + return _self.access().value(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +int TypedRichNode::compare(VM vm, class mozart::RichNode right) { + return _self.access().compare(vm, right); +} + +inline +bool TypedRichNode::isNumber(VM vm) { + return _self.access().isNumber(vm); +} + +inline +bool TypedRichNode::isInt(VM vm) { + return _self.access().isInt(vm); +} + +inline +bool TypedRichNode::isFloat(VM vm) { + return _self.access().isFloat(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::opposite(VM vm) { + return _self.access().opposite(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::add(VM vm, class mozart::RichNode right) { + return _self.access().add(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::add(VM vm, nativeint right) { + return _self.access().add(_self, vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::addValue(VM vm, double b) { + return _self.access().addValue(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::subtract(VM vm, class mozart::RichNode right) { + return _self.access().subtract(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::subtractValue(VM vm, double b) { + return _self.access().subtractValue(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::multiply(VM vm, class mozart::RichNode right) { + return _self.access().multiply(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::multiplyValue(VM vm, double b) { + return _self.access().multiplyValue(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::divide(VM vm, class mozart::RichNode right) { + return _self.access().divide(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::divideValue(VM vm, double b) { + return _self.access().divideValue(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::fmod(VM vm, class mozart::RichNode right) { + return _self.access().fmod(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::fmodValue(VM vm, double b) { + return _self.access().fmodValue(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::div(VM vm, class mozart::RichNode right) { + return _self.access().div(_self, vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::mod(VM vm, class mozart::RichNode right) { + return _self.access().mod(_self, vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::pow(VM vm, class mozart::RichNode right) { + return _self.access().pow(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::powValue(VM vm, double b) { + return _self.access().powValue(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::abs(VM vm) { + return _self.access().abs(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::acos(VM vm) { + return _self.access().acos(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::acosh(VM vm) { + return _self.access().acosh(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::asin(VM vm) { + return _self.access().asin(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::asinh(VM vm) { + return _self.access().asinh(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::atan(VM vm) { + return _self.access().atan(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::atanh(VM vm) { + return _self.access().atanh(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::atan2(VM vm, class mozart::RichNode right) { + return _self.access().atan2(vm, right); +} + +inline +class mozart::UnstableNode TypedRichNode::atan2Value(VM vm, double b) { + return _self.access().atan2Value(vm, b); +} + +inline +class mozart::UnstableNode TypedRichNode::ceil(VM vm) { + return _self.access().ceil(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::cos(VM vm) { + return _self.access().cos(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::cosh(VM vm) { + return _self.access().cosh(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::exp(VM vm) { + return _self.access().exp(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::floor(VM vm) { + return _self.access().floor(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::log(VM vm) { + return _self.access().log(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::round(VM vm) { + return _self.access().round(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::sin(VM vm) { + return _self.access().sin(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::sinh(VM vm) { + return _self.access().sinh(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::sqrt(VM vm) { + return _self.access().sqrt(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::tan(VM vm) { + return _self.access().tan(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::tanh(VM vm) { + return _self.access().tanh(vm); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/FloatLike-interf.hh b/vm/boostenv/main/cached/FloatLike-interf.hh new file mode 100644 index 000000000..5ed019bcb --- /dev/null +++ b/vm/boostenv/main/cached/FloatLike-interf.hh @@ -0,0 +1,361 @@ +class FloatLike { +public: + FloatLike(RichNode self) : _self(self) {} + FloatLike(UnstableNode& self) : _self(self) {} + FloatLike(StableNode& self) : _self(self) {} + + class mozart::UnstableNode divide(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().divide(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::divide", "divide", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().divide(_self, vm, right); + } + } + + class mozart::UnstableNode pow(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().pow(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::pow", "pow", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().pow(_self, vm, right); + } + } + + class mozart::UnstableNode fmod(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().fmod(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::fmod", "fmod", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().fmod(_self, vm, right); + } + } + + class mozart::UnstableNode acos(VM vm) { + if (_self.is()) { + return _self.as().acos(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::acos", "acos", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().acos(_self, vm); + } + } + + class mozart::UnstableNode acosh(VM vm) { + if (_self.is()) { + return _self.as().acosh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::acosh", "acosh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().acosh(_self, vm); + } + } + + class mozart::UnstableNode asin(VM vm) { + if (_self.is()) { + return _self.as().asin(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::asin", "asin", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().asin(_self, vm); + } + } + + class mozart::UnstableNode asinh(VM vm) { + if (_self.is()) { + return _self.as().asinh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::asinh", "asinh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().asinh(_self, vm); + } + } + + class mozart::UnstableNode atan(VM vm) { + if (_self.is()) { + return _self.as().atan(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::atan", "atan", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().atan(_self, vm); + } + } + + class mozart::UnstableNode atanh(VM vm) { + if (_self.is()) { + return _self.as().atanh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::atanh", "atanh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().atanh(_self, vm); + } + } + + class mozart::UnstableNode atan2(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().atan2(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::atan2", "atan2", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().atan2(_self, vm, right); + } + } + + class mozart::UnstableNode ceil(VM vm) { + if (_self.is()) { + return _self.as().ceil(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::ceil", "ceil", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().ceil(_self, vm); + } + } + + class mozart::UnstableNode cos(VM vm) { + if (_self.is()) { + return _self.as().cos(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::cos", "cos", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().cos(_self, vm); + } + } + + class mozart::UnstableNode cosh(VM vm) { + if (_self.is()) { + return _self.as().cosh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::cosh", "cosh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().cosh(_self, vm); + } + } + + class mozart::UnstableNode exp(VM vm) { + if (_self.is()) { + return _self.as().exp(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::exp", "exp", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().exp(_self, vm); + } + } + + class mozart::UnstableNode floor(VM vm) { + if (_self.is()) { + return _self.as().floor(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::floor", "floor", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().floor(_self, vm); + } + } + + class mozart::UnstableNode log(VM vm) { + if (_self.is()) { + return _self.as().log(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::log", "log", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().log(_self, vm); + } + } + + class mozart::UnstableNode round(VM vm) { + if (_self.is()) { + return _self.as().round(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::round", "round", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().round(_self, vm); + } + } + + class mozart::UnstableNode sin(VM vm) { + if (_self.is()) { + return _self.as().sin(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::sin", "sin", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().sin(_self, vm); + } + } + + class mozart::UnstableNode sinh(VM vm) { + if (_self.is()) { + return _self.as().sinh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::sinh", "sinh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().sinh(_self, vm); + } + } + + class mozart::UnstableNode sqrt(VM vm) { + if (_self.is()) { + return _self.as().sqrt(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::sqrt", "sqrt", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().sqrt(_self, vm); + } + } + + class mozart::UnstableNode tan(VM vm) { + if (_self.is()) { + return _self.as().tan(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::tan", "tan", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().tan(_self, vm); + } + } + + class mozart::UnstableNode tanh(VM vm) { + if (_self.is()) { + return _self.as().tanh(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::FloatLike::tanh", "tanh", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().tanh(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/ForeignPointer-implem-decl-after.hh b/vm/boostenv/main/cached/ForeignPointer-implem-decl-after.hh new file mode 100644 index 000000000..51f9a50e1 --- /dev/null +++ b/vm/boostenv/main/cached/ForeignPointer-implem-decl-after.hh @@ -0,0 +1,49 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("ForeignPointer", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + template + inline + std::shared_ptr value(); + + inline + std::shared_ptr getVoidPointer(); + + inline + const std::type_info & pointerType(); + + template + inline + bool isPointer(); +}; diff --git a/vm/boostenv/main/cached/ForeignPointer-implem-decl.hh b/vm/boostenv/main/cached/ForeignPointer-implem-decl.hh new file mode 100644 index 000000000..d2b690345 --- /dev/null +++ b/vm/boostenv/main/cached/ForeignPointer-implem-decl.hh @@ -0,0 +1 @@ +class ForeignPointer; diff --git a/vm/boostenv/main/cached/ForeignPointer-implem.hh b/vm/boostenv/main/cached/ForeignPointer-implem.hh new file mode 100644 index 000000000..bb83be615 --- /dev/null +++ b/vm/boostenv/main/cached/ForeignPointer-implem.hh @@ -0,0 +1,42 @@ + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +template +inline +std::shared_ptr TypedRichNode::value() { + return _self.access().value(); +} + +inline +std::shared_ptr TypedRichNode::getVoidPointer() { + return _self.access().getVoidPointer(); +} + +inline +const std::type_info & TypedRichNode::pointerType() { + return _self.access().pointerType(); +} + +template +inline +bool TypedRichNode::isPointer() { + return _self.access().isPointer(); +} diff --git a/vm/boostenv/main/cached/GRedToStable-implem-decl-after.hh b/vm/boostenv/main/cached/GRedToStable-implem-decl-after.hh new file mode 100644 index 000000000..1e6f61480 --- /dev/null +++ b/vm/boostenv/main/cached/GRedToStable-implem-decl-after.hh @@ -0,0 +1,26 @@ +template <> +class TypeInfoOf: public GRedToStableBase { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : GRedToStableBase("GRedToStable", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::StableNode * dest(); +}; diff --git a/vm/boostenv/main/cached/GRedToStable-implem-decl.hh b/vm/boostenv/main/cached/GRedToStable-implem-decl.hh new file mode 100644 index 000000000..daad688fd --- /dev/null +++ b/vm/boostenv/main/cached/GRedToStable-implem-decl.hh @@ -0,0 +1,7 @@ +class GRedToStable; + +template <> +class Storage { +public: + typedef class mozart::StableNode * Type; +}; diff --git a/vm/boostenv/main/cached/GRedToStable-implem.hh b/vm/boostenv/main/cached/GRedToStable-implem.hh new file mode 100644 index 000000000..1f13544ad --- /dev/null +++ b/vm/boostenv/main/cached/GRedToStable-implem.hh @@ -0,0 +1,5 @@ + +inline +class mozart::StableNode * TypedRichNode::dest() { + return _self.access().dest(); +} diff --git a/vm/boostenv/main/cached/GRedToUnstable-implem-decl-after.hh b/vm/boostenv/main/cached/GRedToUnstable-implem-decl-after.hh new file mode 100644 index 000000000..f3b6b92f0 --- /dev/null +++ b/vm/boostenv/main/cached/GRedToUnstable-implem-decl-after.hh @@ -0,0 +1,26 @@ +template <> +class TypeInfoOf: public GRedToUnstableBase { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : GRedToUnstableBase("GRedToUnstable", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::UnstableNode * dest(); +}; diff --git a/vm/boostenv/main/cached/GRedToUnstable-implem-decl.hh b/vm/boostenv/main/cached/GRedToUnstable-implem-decl.hh new file mode 100644 index 000000000..853fbcf76 --- /dev/null +++ b/vm/boostenv/main/cached/GRedToUnstable-implem-decl.hh @@ -0,0 +1,7 @@ +class GRedToUnstable; + +template <> +class Storage { +public: + typedef class mozart::UnstableNode * Type; +}; diff --git a/vm/boostenv/main/cached/GRedToUnstable-implem.hh b/vm/boostenv/main/cached/GRedToUnstable-implem.hh new file mode 100644 index 000000000..25623d55d --- /dev/null +++ b/vm/boostenv/main/cached/GRedToUnstable-implem.hh @@ -0,0 +1,5 @@ + +inline +class mozart::UnstableNode * TypedRichNode::dest() { + return _self.access().dest(); +} diff --git a/vm/boostenv/main/cached/GlobalName-implem-decl-after.hh b/vm/boostenv/main/cached/GlobalName-implem-decl-after.hh new file mode 100644 index 000000000..e1af26e47 --- /dev/null +++ b/vm/boostenv/main/cached/GlobalName-implem-decl-after.hh @@ -0,0 +1,106 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return GlobalName::uuid; + } +public: + TypeInfoOf() : TypeInfo("GlobalName", uuid(), false, false, true, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return GlobalName::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + GlobalNode* globalize(VM vm, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; + + inline + int compareFeatures(VM vm, RichNode lhs, RichNode rhs) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + bool isLiteral(VM vm); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isRecord(VM vm); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + const struct mozart::UUID & getUUID(); + + inline + int compareFeatures(VM vm, class mozart::RichNode right); + + inline + bool isName(VM vm); + + inline + class mozart::GlobalNode * globalize(VM vm); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/GlobalName-implem-decl.hh b/vm/boostenv/main/cached/GlobalName-implem-decl.hh new file mode 100644 index 000000000..0c3df8d0e --- /dev/null +++ b/vm/boostenv/main/cached/GlobalName-implem-decl.hh @@ -0,0 +1 @@ +class GlobalName; diff --git a/vm/boostenv/main/cached/GlobalName-implem.hh b/vm/boostenv/main/cached/GlobalName-implem.hh new file mode 100644 index 000000000..e4e1a44bc --- /dev/null +++ b/vm/boostenv/main/cached/GlobalName-implem.hh @@ -0,0 +1,139 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +GlobalNode* TypeInfoOf::globalize(VM vm, RichNode from) const { + assert(from.is()); + return from.as().globalize(vm); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +int TypeInfoOf::compareFeatures(VM vm, RichNode lhs, RichNode rhs) const { + return lhs.as().compareFeatures(vm, rhs); +} + + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::isLiteral(VM vm) { + return _self.access().isLiteral(vm); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(_self, vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(_self, vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(_self, vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(_self, vm, label); +} + +inline +const struct mozart::UUID & TypedRichNode::getUUID() { + return _self.access().getUUID(); +} + +inline +int TypedRichNode::compareFeatures(VM vm, class mozart::RichNode right) { + return _self.access().compareFeatures(vm, right); +} + +inline +bool TypedRichNode::isName(VM vm) { + return _self.access().isName(vm); +} + +inline +class mozart::GlobalNode * TypedRichNode::globalize(VM vm) { + return _self.access().globalize(_self, vm); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/Literal-interf.hh b/vm/boostenv/main/cached/Literal-interf.hh new file mode 100644 index 000000000..f0a885d9d --- /dev/null +++ b/vm/boostenv/main/cached/Literal-interf.hh @@ -0,0 +1,32 @@ +class Literal { +public: + Literal(RichNode self) : _self(self) {} + Literal(UnstableNode& self) : _self(self) {} + Literal(StableNode& self) : _self(self) {} + + bool isLiteral(VM vm) { + if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.is()) { + return _self.as().isLiteral(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isLiteral(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/MergedSpace-implem-decl-after.hh b/vm/boostenv/main/cached/MergedSpace-implem-decl-after.hh new file mode 100644 index 000000000..3bde0a933 --- /dev/null +++ b/vm/boostenv/main/cached/MergedSpace-implem-decl-after.hh @@ -0,0 +1,60 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("MergedSpace", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return MergedSpace::getTypeAtom(vm); + } + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + bool isSpace(VM vm); + + inline + class mozart::UnstableNode askSpace(VM vm); + + inline + class mozart::UnstableNode askVerboseSpace(VM vm); + + inline + class mozart::UnstableNode mergeSpace(VM vm); + + inline + void commitSpace(VM vm, class mozart::RichNode value); + + inline + class mozart::UnstableNode cloneSpace(VM vm); + + inline + void killSpace(VM vm); +}; diff --git a/vm/boostenv/main/cached/MergedSpace-implem-decl.hh b/vm/boostenv/main/cached/MergedSpace-implem-decl.hh new file mode 100644 index 000000000..aff5c8efb --- /dev/null +++ b/vm/boostenv/main/cached/MergedSpace-implem-decl.hh @@ -0,0 +1,7 @@ +class MergedSpace; + +template <> +class Storage { +public: + typedef struct mozart::unit_t Type; +}; diff --git a/vm/boostenv/main/cached/MergedSpace-implem.hh b/vm/boostenv/main/cached/MergedSpace-implem.hh new file mode 100644 index 000000000..bb4e3744d --- /dev/null +++ b/vm/boostenv/main/cached/MergedSpace-implem.hh @@ -0,0 +1,55 @@ + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +inline +bool TypedRichNode::isSpace(VM vm) { + return _self.access().isSpace(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::askSpace(VM vm) { + return _self.access().askSpace(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::askVerboseSpace(VM vm) { + return _self.access().askVerboseSpace(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::mergeSpace(VM vm) { + return _self.access().mergeSpace(vm); +} + +inline +void TypedRichNode::commitSpace(VM vm, class mozart::RichNode value) { + _self.access().commitSpace(vm, value); +} + +inline +class mozart::UnstableNode TypedRichNode::cloneSpace(VM vm) { + return _self.access().cloneSpace(vm); +} + +inline +void TypedRichNode::killSpace(VM vm) { + _self.access().killSpace(vm); +} diff --git a/vm/boostenv/main/cached/ModOS-builtin.json b/vm/boostenv/main/cached/ModOS-builtin.json new file mode 100644 index 000000000..516719847 --- /dev/null +++ b/vm/boostenv/main/cached/ModOS-builtin.json @@ -0,0 +1,614 @@ +{ + "fullCppName": "mozart::boostenv::builtins::ModOS", + "name": "OS", + "builtins": [ + { + "fullCppName": "mozart::boostenv::builtins::ModOS::BootURLLoad", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::BootURLLoad::get", + "name": "bootURLLoad", + "inlineable": false, + "params": [ + { + "name": "url", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Rand", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Rand::get", + "name": "rand", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Srand", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Srand::get", + "name": "srand", + "inlineable": false, + "params": [ + { + "name": "seed", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::RandLimits", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::RandLimits::get", + "name": "randLimits", + "inlineable": false, + "params": [ + { + "name": "min", + "kind": "Out" + }, + { + "name": "max", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::GetEnv", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::GetEnv::get", + "name": "getEnv", + "inlineable": false, + "params": [ + { + "name": "var", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::PutEnv", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::PutEnv::get", + "name": "putEnv", + "inlineable": false, + "params": [ + { + "name": "var", + "kind": "In" + }, + { + "name": "value", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::GetDir", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::GetDir::get", + "name": "getDir", + "inlineable": false, + "params": [ + { + "name": "directory", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::GetCWD", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::GetCWD::get", + "name": "getCWD", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::ChDir", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::ChDir::get", + "name": "chDir", + "inlineable": false, + "params": [ + { + "name": "dir", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Tmpnam", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Tmpnam::get", + "name": "tmpnam", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Fopen", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Fopen::get", + "name": "fopen", + "inlineable": false, + "params": [ + { + "name": "fileName", + "kind": "In" + }, + { + "name": "mode", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Fread", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Fread::get", + "name": "fread", + "inlineable": false, + "params": [ + { + "name": "fileNode", + "kind": "In" + }, + { + "name": "count", + "kind": "In" + }, + { + "name": "end", + "kind": "In" + }, + { + "name": "actualCount", + "kind": "Out" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Fwrite", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Fwrite::get", + "name": "fwrite", + "inlineable": false, + "params": [ + { + "name": "fileNode", + "kind": "In" + }, + { + "name": "data", + "kind": "In" + }, + { + "name": "writtenCount", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Fseek", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Fseek::get", + "name": "fseek", + "inlineable": false, + "params": [ + { + "name": "fileNode", + "kind": "In" + }, + { + "name": "offset", + "kind": "In" + }, + { + "name": "whence", + "kind": "In" + }, + { + "name": "where", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Fclose", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Fclose::get", + "name": "fclose", + "inlineable": false, + "params": [ + { + "name": "fileNode", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Stdin", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Stdin::get", + "name": "stdin", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Stdout", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Stdout::get", + "name": "stdout", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Stderr", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Stderr::get", + "name": "stderr", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::System", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::System::get", + "name": "system", + "inlineable": false, + "params": [ + { + "name": "cmd", + "kind": "In" + }, + { + "name": "status", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPAcceptorCreate", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPAcceptorCreate::get", + "name": "tcpAcceptorCreate", + "inlineable": false, + "params": [ + { + "name": "ipVersion", + "kind": "In" + }, + { + "name": "port", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPAccept", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPAccept::get", + "name": "tcpAccept", + "inlineable": false, + "params": [ + { + "name": "acceptor", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPCancelAccept", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPCancelAccept::get", + "name": "tcpCancelAccept", + "inlineable": false, + "params": [ + { + "name": "acceptor", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPAcceptorClose", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPAcceptorClose::get", + "name": "tcpAcceptorClose", + "inlineable": false, + "params": [ + { + "name": "acceptor", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPConnect", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPConnect::get", + "name": "tcpConnect", + "inlineable": false, + "params": [ + { + "name": "host", + "kind": "In" + }, + { + "name": "service", + "kind": "In" + }, + { + "name": "status", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPConnectionRead", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPConnectionRead::get", + "name": "tcpConnectionRead", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + }, + { + "name": "count", + "kind": "In" + }, + { + "name": "tail", + "kind": "In" + }, + { + "name": "status", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPConnectionWrite", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPConnectionWrite::get", + "name": "tcpConnectionWrite", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + }, + { + "name": "data", + "kind": "In" + }, + { + "name": "status", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPConnectionShutdown", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPConnectionShutdown::get", + "name": "tcpConnectionShutdown", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + }, + { + "name": "what", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::TCPConnectionClose", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::TCPConnectionClose::get", + "name": "tcpConnectionClose", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Exec", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Exec::get", + "name": "exec", + "inlineable": false, + "params": [ + { + "name": "inExecutable", + "kind": "In" + }, + { + "name": "inArgv", + "kind": "In" + }, + { + "name": "inDoKill", + "kind": "In" + }, + { + "name": "outPid", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::Pipe", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::Pipe::get", + "name": "pipe", + "inlineable": false, + "params": [ + { + "name": "inExecutable", + "kind": "In" + }, + { + "name": "inArgv", + "kind": "In" + }, + { + "name": "outPid", + "kind": "Out" + }, + { + "name": "outStatus", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::PipeConnectionRead", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::PipeConnectionRead::get", + "name": "pipeConnectionRead", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + }, + { + "name": "count", + "kind": "In" + }, + { + "name": "tail", + "kind": "In" + }, + { + "name": "status", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::PipeConnectionWrite", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::PipeConnectionWrite::get", + "name": "pipeConnectionWrite", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + }, + { + "name": "data", + "kind": "In" + }, + { + "name": "status", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::PipeConnectionShutdown", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::PipeConnectionShutdown::get", + "name": "pipeConnectionShutdown", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + }, + { + "name": "what", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::PipeConnectionClose", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::PipeConnectionClose::get", + "name": "pipeConnectionClose", + "inlineable": false, + "params": [ + { + "name": "connection", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::GetPID", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::GetPID::get", + "name": "getPID", + "inlineable": false, + "params": [ + { + "name": "pid", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::GetHostByName", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::GetHostByName::get", + "name": "getHostByName", + "inlineable": false, + "params": [ + { + "name": "name", + "kind": "In" + }, + { + "name": "res", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModOS::UName", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModOS::UName::get", + "name": "uName", + "inlineable": false, + "params": [ + { + "name": "res", + "kind": "Out" + } + ] + } + ] +} diff --git a/vm/boostenv/main/cached/ModVM-builtin.json b/vm/boostenv/main/cached/ModVM-builtin.json new file mode 100644 index 000000000..58269c626 --- /dev/null +++ b/vm/boostenv/main/cached/ModVM-builtin.json @@ -0,0 +1,135 @@ +{ + "fullCppName": "mozart::boostenv::builtins::ModVM", + "name": "VM", + "builtins": [ + { + "fullCppName": "mozart::boostenv::builtins::ModVM::Ncores", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::Ncores::get", + "name": "ncores", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::Current", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::Current::get", + "name": "current", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::New", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::New::get", + "name": "new", + "inlineable": false, + "params": [ + { + "name": "app", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::GetPort", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::GetPort::get", + "name": "getPort", + "inlineable": false, + "params": [ + { + "name": "vmIdentifier", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::IdentForPort", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::IdentForPort::get", + "name": "identForPort", + "inlineable": false, + "params": [ + { + "name": "vmPort", + "kind": "In" + }, + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::GetStream", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::GetStream::get", + "name": "getStream", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::CloseStream", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::CloseStream::get", + "name": "closeStream", + "inlineable": false, + "params": [ + + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::List", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::List::get", + "name": "list", + "inlineable": false, + "params": [ + { + "name": "result", + "kind": "Out" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::Kill", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::Kill::get", + "name": "kill", + "inlineable": false, + "params": [ + { + "name": "vmIdentifier", + "kind": "In" + } + ] + }, + { + "fullCppName": "mozart::boostenv::builtins::ModVM::Monitor", + "fullCppGetter": "mozart::boostenv::builtins::biref::ModVM::Monitor::get", + "name": "monitor", + "inlineable": false, + "params": [ + { + "name": "vmIdentifier", + "kind": "In" + } + ] + } + ] +} diff --git a/vm/boostenv/main/cached/NameLike-interf.hh b/vm/boostenv/main/cached/NameLike-interf.hh new file mode 100644 index 000000000..e5c82d4e6 --- /dev/null +++ b/vm/boostenv/main/cached/NameLike-interf.hh @@ -0,0 +1,30 @@ +class NameLike { +public: + NameLike(RichNode self) : _self(self) {} + NameLike(UnstableNode& self) : _self(self) {} + NameLike(StableNode& self) : _self(self) {} + + bool isName(VM vm) { + if (_self.is()) { + return _self.as().isName(vm); + } else if (_self.is()) { + return _self.as().isName(vm); + } else if (_self.is()) { + return _self.as().isName(vm); + } else if (_self.is()) { + return _self.as().isName(vm); + } else if (_self.is()) { + return _self.as().isName(vm); + } else if (_self.is()) { + return _self.as().isName(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isName(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/NamedName-implem-decl-after.hh b/vm/boostenv/main/cached/NamedName-implem-decl-after.hh new file mode 100644 index 000000000..bd92add5e --- /dev/null +++ b/vm/boostenv/main/cached/NamedName-implem-decl-after.hh @@ -0,0 +1,115 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return NamedName::uuid; + } +public: + TypeInfoOf() : TypeInfo("NamedName", uuid(), false, false, true, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return NamedName::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + GlobalNode* globalize(VM vm, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; + + inline + int compareFeatures(VM vm, RichNode lhs, RichNode rhs) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + bool isLiteral(VM vm); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isRecord(VM vm); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + const struct mozart::UUID & getUUID(); + + inline + int compareFeatures(VM vm, class mozart::RichNode right); + + inline + atom_t getPrintName(VM vm); + + inline + bool isName(VM vm); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); + + inline + class mozart::GlobalNode * globalize(VM vm); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/NamedName-implem-decl.hh b/vm/boostenv/main/cached/NamedName-implem-decl.hh new file mode 100644 index 000000000..406138729 --- /dev/null +++ b/vm/boostenv/main/cached/NamedName-implem-decl.hh @@ -0,0 +1 @@ +class NamedName; diff --git a/vm/boostenv/main/cached/NamedName-implem.hh b/vm/boostenv/main/cached/NamedName-implem.hh new file mode 100644 index 000000000..322a89afa --- /dev/null +++ b/vm/boostenv/main/cached/NamedName-implem.hh @@ -0,0 +1,154 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +GlobalNode* TypeInfoOf::globalize(VM vm, RichNode from) const { + assert(from.is()); + return from.as().globalize(vm); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +int TypeInfoOf::compareFeatures(VM vm, RichNode lhs, RichNode rhs) const { + return lhs.as().compareFeatures(vm, rhs); +} + + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::isLiteral(VM vm) { + return _self.access().isLiteral(vm); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(_self, vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(_self, vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(_self, vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(_self, vm, label); +} + +inline +const struct mozart::UUID & TypedRichNode::getUUID() { + return _self.access().getUUID(); +} + +inline +int TypedRichNode::compareFeatures(VM vm, class mozart::RichNode right) { + return _self.access().compareFeatures(vm, right); +} + +inline +atom_t TypedRichNode::getPrintName(VM vm) { + return _self.access().getPrintName(vm); +} + +inline +bool TypedRichNode::isName(VM vm) { + return _self.access().isName(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} + +inline +class mozart::GlobalNode * TypedRichNode::globalize(VM vm) { + return _self.access().globalize(_self, vm); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/Numeric-interf.hh b/vm/boostenv/main/cached/Numeric-interf.hh new file mode 100644 index 000000000..bc54a5970 --- /dev/null +++ b/vm/boostenv/main/cached/Numeric-interf.hh @@ -0,0 +1,229 @@ +class Numeric { +public: + Numeric(RichNode self) : _self(self) {} + Numeric(UnstableNode& self) : _self(self) {} + Numeric(StableNode& self) : _self(self) {} + + bool isNumber(VM vm) { + if (_self.is()) { + return _self.as().isNumber(vm); + } else if (_self.is()) { + return _self.as().isNumber(vm); + } else if (_self.is()) { + return _self.as().isNumber(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::isNumber", "isNumber", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isNumber(_self, vm); + } + } + + bool isInt(VM vm) { + if (_self.is()) { + return _self.as().isInt(vm); + } else if (_self.is()) { + return _self.as().isInt(vm); + } else if (_self.is()) { + return _self.as().isInt(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::isInt", "isInt", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isInt(_self, vm); + } + } + + bool isFloat(VM vm) { + if (_self.is()) { + return _self.as().isFloat(vm); + } else if (_self.is()) { + return _self.as().isFloat(vm); + } else if (_self.is()) { + return _self.as().isFloat(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::isFloat", "isFloat", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isFloat(_self, vm); + } + } + + class mozart::UnstableNode opposite(VM vm) { + if (_self.is()) { + return _self.as().opposite(vm); + } else if (_self.is()) { + return _self.as().opposite(vm); + } else if (_self.is()) { + return _self.as().opposite(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::opposite", "opposite", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().opposite(_self, vm); + } + } + + class mozart::UnstableNode add(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().add(vm, right); + } else if (_self.is()) { + return _self.as().add(vm, right); + } else if (_self.is()) { + return _self.as().add(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::add", "add", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().add(_self, vm, right); + } + } + + class mozart::UnstableNode add(VM vm, nativeint right) { + if (_self.is()) { + return _self.as().add(vm, right); + } else if (_self.is()) { + return _self.as().add(vm, right); + } else if (_self.is()) { + return _self.as().add(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::add", "add", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().add(_self, vm, right); + } + } + + class mozart::UnstableNode subtract(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().subtract(vm, right); + } else if (_self.is()) { + return _self.as().subtract(vm, right); + } else if (_self.is()) { + return _self.as().subtract(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::subtract", "subtract", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().subtract(_self, vm, right); + } + } + + class mozart::UnstableNode multiply(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().multiply(vm, right); + } else if (_self.is()) { + return _self.as().multiply(vm, right); + } else if (_self.is()) { + return _self.as().multiply(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::multiply", "multiply", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().multiply(_self, vm, right); + } + } + + class mozart::UnstableNode div(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().div(vm, right); + } else if (_self.is()) { + return _self.as().div(vm, right); + } else if (_self.is()) { + return _self.as().div(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::div", "div", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().div(_self, vm, right); + } + } + + class mozart::UnstableNode mod(VM vm, class mozart::RichNode right) { + if (_self.is()) { + return _self.as().mod(vm, right); + } else if (_self.is()) { + return _self.as().mod(vm, right); + } else if (_self.is()) { + return _self.as().mod(vm, right); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::mod", "mod", right, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().mod(_self, vm, right); + } + } + + class mozart::UnstableNode abs(VM vm) { + if (_self.is()) { + return _self.as().abs(vm); + } else if (_self.is()) { + return _self.as().abs(vm); + } else if (_self.is()) { + return _self.as().abs(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::Numeric::abs", "abs", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().abs(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Object-implem-decl-after.hh b/vm/boostenv/main/cached/Object-implem-decl-after.hh new file mode 100644 index 000000000..7fa0a65e0 --- /dev/null +++ b/vm/boostenv/main/cached/Object-implem-decl-after.hh @@ -0,0 +1,103 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Object", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Object::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::UnstableNode& getElements(size_t i); + + inline + class mozart::Space * home(); + + inline + size_t getArraySizeImpl(); + + inline + class mozart::StableNode * getFeaturesRecord(); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isChunk(VM vm); + + inline + bool isObject(VM vm); + + inline + class mozart::UnstableNode getClass(VM vm); + + inline + class mozart::UnstableNode attrGet(VM vm, class mozart::RichNode attribute); + + inline + void attrPut(VM vm, class mozart::RichNode attribute, class mozart::RichNode value); + + inline + class mozart::UnstableNode attrExchange(VM vm, class mozart::RichNode attribute, class mozart::RichNode newValue); + + inline + bool isCallable(VM vm); + + inline + bool isProcedure(VM vm); + + inline + size_t procedureArity(VM vm); + + inline + void getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks); + + inline + void getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Object-implem-decl.hh b/vm/boostenv/main/cached/Object-implem-decl.hh new file mode 100644 index 000000000..fb6aa23b2 --- /dev/null +++ b/vm/boostenv/main/cached/Object-implem-decl.hh @@ -0,0 +1,7 @@ +class Object; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/Object-implem.hh b/vm/boostenv/main/cached/Object-implem.hh new file mode 100644 index 000000000..9ea9fd70a --- /dev/null +++ b/vm/boostenv/main/cached/Object-implem.hh @@ -0,0 +1,131 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::UnstableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +class mozart::StableNode * TypedRichNode::getFeaturesRecord() { + return _self.access().getFeaturesRecord(); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isChunk(VM vm) { + return _self.access().isChunk(vm); +} + +inline +bool TypedRichNode::isObject(VM vm) { + return _self.access().isObject(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::getClass(VM vm) { + return _self.access().getClass(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::attrGet(VM vm, class mozart::RichNode attribute) { + return _self.access().attrGet(_self, vm, attribute); +} + +inline +void TypedRichNode::attrPut(VM vm, class mozart::RichNode attribute, class mozart::RichNode value) { + _self.access().attrPut(_self, vm, attribute, value); +} + +inline +class mozart::UnstableNode TypedRichNode::attrExchange(VM vm, class mozart::RichNode attribute, class mozart::RichNode newValue) { + return _self.access().attrExchange(_self, vm, attribute, newValue); +} + +inline +bool TypedRichNode::isCallable(VM vm) { + return _self.access().isCallable(vm); +} + +inline +bool TypedRichNode::isProcedure(VM vm) { + return _self.access().isProcedure(vm); +} + +inline +size_t TypedRichNode::procedureArity(VM vm) { + return _self.access().procedureArity(_self, vm); +} + +inline +void TypedRichNode::getCallInfo(VM vm, size_t & arity, ProgramCounter & start, size_t & Xcount, StaticArray & Gs, StaticArray & Ks) { + _self.access().getCallInfo(_self, vm, arity, start, Xcount, Gs, Ks); +} + +inline +void TypedRichNode::getDebugInfo(VM vm, atom_t & printName, class mozart::UnstableNode & debugData) { + _self.access().getDebugInfo(vm, printName, debugData); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/ObjectLike-interf.hh b/vm/boostenv/main/cached/ObjectLike-interf.hh new file mode 100644 index 000000000..c51e26493 --- /dev/null +++ b/vm/boostenv/main/cached/ObjectLike-interf.hh @@ -0,0 +1,88 @@ +class ObjectLike { +public: + ObjectLike(RichNode self) : _self(self) {} + ObjectLike(UnstableNode& self) : _self(self) {} + ObjectLike(StableNode& self) : _self(self) {} + + bool isObject(VM vm) { + if (_self.is()) { + return _self.as().isObject(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ObjectLike::isObject", "isObject", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isObject(_self, vm); + } + } + + class mozart::UnstableNode getClass(VM vm) { + if (_self.is()) { + return _self.as().getClass(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ObjectLike::getClass", "getClass", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().getClass(_self, vm); + } + } + + class mozart::UnstableNode attrGet(VM vm, class mozart::RichNode attribute) { + if (_self.is()) { + return _self.as().attrGet(vm, attribute); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ObjectLike::attrGet", "attrGet", attribute, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().attrGet(_self, vm, attribute); + } + } + + void attrPut(VM vm, class mozart::RichNode attribute, class mozart::RichNode value) { + if (_self.is()) { + return _self.as().attrPut(vm, attribute, value); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ObjectLike::attrPut", "attrPut", attribute, value)) + return; + } + return Interface().attrPut(_self, vm, attribute, value); + } + } + + class mozart::UnstableNode attrExchange(VM vm, class mozart::RichNode attribute, class mozart::RichNode newValue) { + if (_self.is()) { + return _self.as().attrExchange(vm, attribute, newValue); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::ObjectLike::attrExchange", "attrExchange", attribute, newValue, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().attrExchange(_self, vm, attribute, newValue); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/OptName-implem-decl-after.hh b/vm/boostenv/main/cached/OptName-implem-decl-after.hh new file mode 100644 index 000000000..8cf97a211 --- /dev/null +++ b/vm/boostenv/main/cached/OptName-implem-decl-after.hh @@ -0,0 +1,100 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("OptName", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return OptName::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + GlobalNode* globalize(VM vm, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + bool isLiteral(VM vm); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isRecord(VM vm); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + void makeFeature(VM vm); + + inline + bool isName(VM vm); + + inline + class mozart::GlobalNode * globalize(VM vm); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/OptName-implem-decl.hh b/vm/boostenv/main/cached/OptName-implem-decl.hh new file mode 100644 index 000000000..0ed0d4ab0 --- /dev/null +++ b/vm/boostenv/main/cached/OptName-implem-decl.hh @@ -0,0 +1,7 @@ +class OptName; + +template <> +class Storage { +public: + typedef struct mozart::SpaceRef Type; +}; diff --git a/vm/boostenv/main/cached/OptName-implem.hh b/vm/boostenv/main/cached/OptName-implem.hh new file mode 100644 index 000000000..f13f5537c --- /dev/null +++ b/vm/boostenv/main/cached/OptName-implem.hh @@ -0,0 +1,129 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +GlobalNode* TypeInfoOf::globalize(VM vm, RichNode from) const { + assert(from.is()); + return from.as().globalize(vm); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::isLiteral(VM vm) { + return _self.access().isLiteral(vm); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(_self, vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(_self, vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(_self, vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(_self, vm, label); +} + +inline +void TypedRichNode::makeFeature(VM vm) { + _self.access().makeFeature(_self, vm); +} + +inline +bool TypedRichNode::isName(VM vm) { + return _self.access().isName(vm); +} + +inline +class mozart::GlobalNode * TypedRichNode::globalize(VM vm) { + return _self.access().globalize(_self, vm); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/OptVar-implem-decl-after.hh b/vm/boostenv/main/cached/OptVar-implem-decl-after.hh new file mode 100644 index 000000000..008159bef --- /dev/null +++ b/vm/boostenv/main/cached/OptVar-implem-decl-after.hh @@ -0,0 +1,60 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("OptVar", uuid(), false, true, false, sbVariable, 100) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + void addToSuspendList(VM vm, class mozart::RichNode variable); + + inline + bool isNeeded(VM vm); + + inline + void markNeeded(VM vm); + + inline + void bind(VM vm, class mozart::UnstableNode && src); + + inline + void bind(VM vm, class mozart::RichNode src); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/OptVar-implem-decl.hh b/vm/boostenv/main/cached/OptVar-implem-decl.hh new file mode 100644 index 000000000..8c2b657fd --- /dev/null +++ b/vm/boostenv/main/cached/OptVar-implem-decl.hh @@ -0,0 +1,7 @@ +class OptVar; + +template <> +class Storage { +public: + typedef struct mozart::SpaceRef Type; +}; diff --git a/vm/boostenv/main/cached/OptVar-implem.hh b/vm/boostenv/main/cached/OptVar-implem.hh new file mode 100644 index 000000000..50226a95e --- /dev/null +++ b/vm/boostenv/main/cached/OptVar-implem.hh @@ -0,0 +1,69 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +void TypedRichNode::addToSuspendList(VM vm, class mozart::RichNode variable) { + _self.access().addToSuspendList(_self, vm, variable); +} + +inline +bool TypedRichNode::isNeeded(VM vm) { + return _self.access().isNeeded(vm); +} + +inline +void TypedRichNode::markNeeded(VM vm) { + _self.access().markNeeded(_self, vm); +} + +inline +void TypedRichNode::bind(VM vm, class mozart::UnstableNode && src) { + _self.access().bind(_self, vm, src); +} + +inline +void TypedRichNode::bind(VM vm, class mozart::RichNode src) { + _self.access().bind(_self, vm, src); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/PatMatCapture-implem-decl-after.hh b/vm/boostenv/main/cached/PatMatCapture-implem-decl-after.hh new file mode 100644 index 000000000..321e88774 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatCapture-implem-decl-after.hh @@ -0,0 +1,54 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("PatMatCapture", uuid(), (! ::mozart::MemWord::requiresExternalMemory()), false, false, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + nativeint index(); + + inline + bool equals(VM vm, class mozart::RichNode right); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/PatMatCapture-implem-decl.hh b/vm/boostenv/main/cached/PatMatCapture-implem-decl.hh new file mode 100644 index 000000000..f3090965b --- /dev/null +++ b/vm/boostenv/main/cached/PatMatCapture-implem-decl.hh @@ -0,0 +1,7 @@ +class PatMatCapture; + +template <> +class Storage { +public: + typedef nativeint Type; +}; diff --git a/vm/boostenv/main/cached/PatMatCapture-implem.hh b/vm/boostenv/main/cached/PatMatCapture-implem.hh new file mode 100644 index 000000000..d42c86d86 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatCapture-implem.hh @@ -0,0 +1,51 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +inline +nativeint TypedRichNode::index() { + return _self.access().index(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right) { + return _self.access().equals(vm, right); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/PatMatConjunction-implem-decl-after.hh b/vm/boostenv/main/cached/PatMatConjunction-implem-decl-after.hh new file mode 100644 index 000000000..e89baac01 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatConjunction-implem-decl-after.hh @@ -0,0 +1,69 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("PatMatConjunction", uuid(), false, false, false, sbStructural, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::StableNode& getElements(size_t i); + + inline + size_t getArraySizeImpl(); + + inline + size_t getCount(); + + inline + class mozart::StableNode * getElement(size_t index); + + inline + bool equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/PatMatConjunction-implem-decl.hh b/vm/boostenv/main/cached/PatMatConjunction-implem-decl.hh new file mode 100644 index 000000000..8fa48dec6 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatConjunction-implem-decl.hh @@ -0,0 +1,7 @@ +class PatMatConjunction; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/PatMatConjunction-implem.hh b/vm/boostenv/main/cached/PatMatConjunction-implem.hh new file mode 100644 index 000000000..598418b75 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatConjunction-implem.hh @@ -0,0 +1,73 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::StableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +size_t TypedRichNode::getCount() { + return _self.access().getCount(); +} + +inline +class mozart::StableNode * TypedRichNode::getElement(size_t index) { + return _self.access().getElement(index); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack) { + return _self.access().equals(vm, right, stack); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/PatMatOpenRecord-implem-decl-after.hh b/vm/boostenv/main/cached/PatMatOpenRecord-implem-decl-after.hh new file mode 100644 index 000000000..5337cd28b --- /dev/null +++ b/vm/boostenv/main/cached/PatMatOpenRecord-implem-decl-after.hh @@ -0,0 +1,66 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("PatMatOpenRecord", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::StableNode& getElements(size_t i); + + inline + size_t getArraySizeImpl(); + + inline + class mozart::StableNode * getElement(size_t index); + + inline + class mozart::StableNode * getArity(); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/PatMatOpenRecord-implem-decl.hh b/vm/boostenv/main/cached/PatMatOpenRecord-implem-decl.hh new file mode 100644 index 000000000..c16fdab30 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatOpenRecord-implem-decl.hh @@ -0,0 +1,7 @@ +class PatMatOpenRecord; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/PatMatOpenRecord-implem.hh b/vm/boostenv/main/cached/PatMatOpenRecord-implem.hh new file mode 100644 index 000000000..cd155e426 --- /dev/null +++ b/vm/boostenv/main/cached/PatMatOpenRecord-implem.hh @@ -0,0 +1,68 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::StableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +class mozart::StableNode * TypedRichNode::getElement(size_t index) { + return _self.access().getElement(index); +} + +inline +class mozart::StableNode * TypedRichNode::getArity() { + return _self.access().getArity(); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/Port-implem-decl-after.hh b/vm/boostenv/main/cached/Port-implem-decl-after.hh new file mode 100644 index 000000000..d277a737f --- /dev/null +++ b/vm/boostenv/main/cached/Port-implem-decl-after.hh @@ -0,0 +1,58 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Port", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Port::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + bool isPort(VM vm); + + inline + void send(VM vm, class mozart::RichNode value); + + inline + class mozart::UnstableNode sendReceive(VM vm, class mozart::RichNode value); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/Port-implem-decl.hh b/vm/boostenv/main/cached/Port-implem-decl.hh new file mode 100644 index 000000000..37f17081f --- /dev/null +++ b/vm/boostenv/main/cached/Port-implem-decl.hh @@ -0,0 +1 @@ +class Port; diff --git a/vm/boostenv/main/cached/Port-implem.hh b/vm/boostenv/main/cached/Port-implem.hh new file mode 100644 index 000000000..66fededf2 --- /dev/null +++ b/vm/boostenv/main/cached/Port-implem.hh @@ -0,0 +1,59 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + if (from.as().home()->shouldBeCloned()) { + to.make(sc->vm, sc, from.access()); + } else { + to.init(sc->vm, from); + } +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +bool TypedRichNode::isPort(VM vm) { + return _self.access().isPort(vm); +} + +inline +void TypedRichNode::send(VM vm, class mozart::RichNode value) { + _self.access().send(vm, value); +} + +inline +class mozart::UnstableNode TypedRichNode::sendReceive(VM vm, class mozart::RichNode value) { + return _self.access().sendReceive(vm, value); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/PortLike-interf.hh b/vm/boostenv/main/cached/PortLike-interf.hh new file mode 100644 index 000000000..b001e3d26 --- /dev/null +++ b/vm/boostenv/main/cached/PortLike-interf.hh @@ -0,0 +1,62 @@ +class PortLike { +public: + PortLike(RichNode self) : _self(self) {} + PortLike(UnstableNode& self) : _self(self) {} + PortLike(StableNode& self) : _self(self) {} + + bool isPort(VM vm) { + if (_self.is()) { + return _self.as().isPort(vm); + } else if (_self.is()) { + return _self.as().isPort(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + bool _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::PortLike::isPort", "isPort", ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().isPort(_self, vm); + } + } + + void send(VM vm, class mozart::RichNode value) { + if (_self.is()) { + return _self.as().send(vm, value); + } else if (_self.is()) { + return _self.as().send(vm, value); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::PortLike::send", "send", value)) + return; + } + return Interface().send(_self, vm, value); + } + } + + class mozart::UnstableNode sendReceive(VM vm, class mozart::RichNode value) { + if (_self.is()) { + return _self.as().sendReceive(vm, value); + } else if (_self.is()) { + return _self.as().sendReceive(vm, value); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + if (_self.is< ::mozart::ReflectiveEntity>()) { + class mozart::UnstableNode _result; + if (_self.as< ::mozart::ReflectiveEntity>().reflectiveCall(vm, "$intf$::PortLike::sendReceive", "sendReceive", value, ::mozart::ozcalls::out(_result))) + return _result; + } + return Interface().sendReceive(_self, vm, value); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/PotentialFeature-interf.hh b/vm/boostenv/main/cached/PotentialFeature-interf.hh new file mode 100644 index 000000000..206771623 --- /dev/null +++ b/vm/boostenv/main/cached/PotentialFeature-interf.hh @@ -0,0 +1,20 @@ +class PotentialFeature { +public: + PotentialFeature(RichNode self) : _self(self) {} + PotentialFeature(UnstableNode& self) : _self(self) {} + PotentialFeature(StableNode& self) : _self(self) {} + + void makeFeature(VM vm) { + if (_self.is()) { + return _self.as().makeFeature(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().makeFeature(_self, vm); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/ReadOnly-implem-decl-after.hh b/vm/boostenv/main/cached/ReadOnly-implem-decl-after.hh new file mode 100644 index 000000000..8f23c5529 --- /dev/null +++ b/vm/boostenv/main/cached/ReadOnly-implem-decl-after.hh @@ -0,0 +1,63 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("ReadOnly", uuid(), false, true, false, sbVariable, 80) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::StableNode * getUnderlying(); + + inline + void wakeUp(VM vm); + + inline + bool shouldWakeUpUnderSpace(VM vm, class mozart::Space * space); + + inline + void addToSuspendList(VM vm, class mozart::RichNode variable); + + inline + bool isNeeded(VM vm); + + inline + void markNeeded(VM vm); + + inline + void bind(VM vm, class mozart::RichNode src); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/ReadOnly-implem-decl.hh b/vm/boostenv/main/cached/ReadOnly-implem-decl.hh new file mode 100644 index 000000000..b654dcbb4 --- /dev/null +++ b/vm/boostenv/main/cached/ReadOnly-implem-decl.hh @@ -0,0 +1,7 @@ +class ReadOnly; + +template <> +class Storage { +public: + typedef class mozart::StableNode * Type; +}; diff --git a/vm/boostenv/main/cached/ReadOnly-implem.hh b/vm/boostenv/main/cached/ReadOnly-implem.hh new file mode 100644 index 000000000..ab24fdc54 --- /dev/null +++ b/vm/boostenv/main/cached/ReadOnly-implem.hh @@ -0,0 +1,68 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + StableNode* stable = new (gc->vm) StableNode; + to.make(gc->vm, stable); + stable->make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +inline +class mozart::StableNode * TypedRichNode::getUnderlying() { + return _self.access().getUnderlying(); +} + +inline +void TypedRichNode::wakeUp(VM vm) { + _self.access().wakeUp(_self, vm); +} + +inline +bool TypedRichNode::shouldWakeUpUnderSpace(VM vm, class mozart::Space * space) { + return _self.access().shouldWakeUpUnderSpace(vm, space); +} + +inline +void TypedRichNode::addToSuspendList(VM vm, class mozart::RichNode variable) { + _self.access().addToSuspendList(vm, variable); +} + +inline +bool TypedRichNode::isNeeded(VM vm) { + return _self.access().isNeeded(vm); +} + +inline +void TypedRichNode::markNeeded(VM vm) { + _self.access().markNeeded(vm); +} + +inline +void TypedRichNode::bind(VM vm, class mozart::RichNode src) { + _self.access().bind(vm, src); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/ReadOnlyVariable-implem-decl-after.hh b/vm/boostenv/main/cached/ReadOnlyVariable-implem-decl-after.hh new file mode 100644 index 000000000..3dba028a5 --- /dev/null +++ b/vm/boostenv/main/cached/ReadOnlyVariable-implem-decl-after.hh @@ -0,0 +1,60 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("ReadOnlyVariable", uuid(), false, true, false, sbVariable, 80) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::Space * home(); + + inline + void addToSuspendList(VM vm, class mozart::RichNode variable); + + inline + bool isNeeded(VM vm); + + inline + void markNeeded(VM vm); + + inline + void bind(VM vm, class mozart::RichNode src); + + inline + void bindReadOnly(VM vm, class mozart::RichNode src); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/ReadOnlyVariable-implem-decl.hh b/vm/boostenv/main/cached/ReadOnlyVariable-implem-decl.hh new file mode 100644 index 000000000..a940c069f --- /dev/null +++ b/vm/boostenv/main/cached/ReadOnlyVariable-implem-decl.hh @@ -0,0 +1 @@ +class ReadOnlyVariable; diff --git a/vm/boostenv/main/cached/ReadOnlyVariable-implem.hh b/vm/boostenv/main/cached/ReadOnlyVariable-implem.hh new file mode 100644 index 000000000..72f5c8661 --- /dev/null +++ b/vm/boostenv/main/cached/ReadOnlyVariable-implem.hh @@ -0,0 +1,61 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +inline +class mozart::Space * TypedRichNode::home() { + return _self.access().home(); +} + +inline +void TypedRichNode::addToSuspendList(VM vm, class mozart::RichNode variable) { + _self.access().addToSuspendList(vm, variable); +} + +inline +bool TypedRichNode::isNeeded(VM vm) { + return _self.access().isNeeded(vm); +} + +inline +void TypedRichNode::markNeeded(VM vm) { + _self.access().markNeeded(vm); +} + +inline +void TypedRichNode::bind(VM vm, class mozart::RichNode src) { + _self.access().bind(_self, vm, src); +} + +inline +void TypedRichNode::bindReadOnly(VM vm, class mozart::RichNode src) { + _self.access().bindReadOnly(_self, vm, src); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} diff --git a/vm/boostenv/main/cached/Record-implem-decl-after.hh b/vm/boostenv/main/cached/Record-implem-decl-after.hh new file mode 100644 index 000000000..ed2dcb8d3 --- /dev/null +++ b/vm/boostenv/main/cached/Record-implem-decl-after.hh @@ -0,0 +1,112 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Record", uuid(), false, false, false, sbStructural, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return Record::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + UnstableNode serialize(VM vm, SE s, RichNode from) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + size_t getArraySize(); + + inline + StaticArray getElementsArray(); + + inline + class mozart::StableNode& getElements(size_t i); + + inline + size_t getArraySizeImpl(); + + inline + size_t getWidth(); + + inline + class mozart::StableNode * getElement(size_t index); + + inline + bool isRecord(VM vm); + + inline + size_t width(VM vm); + + inline + class mozart::UnstableNode arityList(VM vm); + + inline + class mozart::UnstableNode waitOr(VM vm); + + inline + class mozart::StableNode * getArity(); + + inline + bool equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack); + + inline + bool lookupFeature(VM vm, class mozart::RichNode feature, nullable value); + + inline + bool lookupFeature(VM vm, nativeint feature, nullable value); + + inline + bool isTuple(VM vm); + + inline + class mozart::UnstableNode label(VM vm); + + inline + class mozart::UnstableNode clone(VM vm); + + inline + bool testRecord(VM vm, class mozart::RichNode arity); + + inline + bool testTuple(VM vm, class mozart::RichNode label, size_t width); + + inline + bool testLabel(VM vm, class mozart::RichNode label); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); + + inline + class mozart::UnstableNode serialize(VM vm, SE se); +}; diff --git a/vm/boostenv/main/cached/Record-implem-decl.hh b/vm/boostenv/main/cached/Record-implem-decl.hh new file mode 100644 index 000000000..65117e3ae --- /dev/null +++ b/vm/boostenv/main/cached/Record-implem-decl.hh @@ -0,0 +1,7 @@ +class Record; + +template <> +class Storage { +public: + typedef ImplWithArray Type; +}; diff --git a/vm/boostenv/main/cached/Record-implem.hh b/vm/boostenv/main/cached/Record-implem.hh new file mode 100644 index 000000000..0c9ea6f2c --- /dev/null +++ b/vm/boostenv/main/cached/Record-implem.hh @@ -0,0 +1,138 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +UnstableNode TypeInfoOf::serialize(VM vm, SE s, RichNode from) const { + assert(from.is()); + return from.as().serialize(vm, s); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, from.as().getArraySize(), gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, from.as().getArraySize(), sc, from.access()); +} + +size_t TypedRichNode::getArraySize() { + return _self.access().getArraySize(); +} + +StaticArray TypedRichNode::getElementsArray() { + return _self.access().getElementsArray(); +} + +class mozart::StableNode& TypedRichNode::getElements(size_t i) { + return _self.access().getElements(i); +} + +inline +size_t TypedRichNode::getArraySizeImpl() { + return _self.access().getArraySizeImpl(); +} + +inline +size_t TypedRichNode::getWidth() { + return _self.access().getWidth(); +} + +inline +class mozart::StableNode * TypedRichNode::getElement(size_t index) { + return _self.access().getElement(index); +} + +inline +bool TypedRichNode::isRecord(VM vm) { + return _self.access().isRecord(vm); +} + +inline +size_t TypedRichNode::width(VM vm) { + return _self.access().width(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::arityList(VM vm) { + return _self.access().arityList(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::waitOr(VM vm) { + return _self.access().waitOr(vm); +} + +inline +class mozart::StableNode * TypedRichNode::getArity() { + return _self.access().getArity(); +} + +inline +bool TypedRichNode::equals(VM vm, class mozart::RichNode right, class mozart::WalkStack & stack) { + return _self.access().equals(vm, right, stack); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, class mozart::RichNode feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::lookupFeature(VM vm, nativeint feature, nullable value) { + return _self.access().lookupFeature(vm, feature, value); +} + +inline +bool TypedRichNode::isTuple(VM vm) { + return _self.access().isTuple(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::label(VM vm) { + return _self.access().label(vm); +} + +inline +class mozart::UnstableNode TypedRichNode::clone(VM vm) { + return _self.access().clone(vm); +} + +inline +bool TypedRichNode::testRecord(VM vm, class mozart::RichNode arity) { + return _self.access().testRecord(vm, arity); +} + +inline +bool TypedRichNode::testTuple(VM vm, class mozart::RichNode label, size_t width) { + return _self.access().testTuple(vm, label, width); +} + +inline +bool TypedRichNode::testLabel(VM vm, class mozart::RichNode label) { + return _self.access().testLabel(vm, label); +} + +inline +void TypedRichNode::printReprToStream(VM vm, std::ostream & out, int depth, int width) { + _self.access().printReprToStream(vm, out, depth, width); +} + +inline +class mozart::UnstableNode TypedRichNode::serialize(VM vm, SE se) { + return _self.access().serialize(vm, se); +} diff --git a/vm/boostenv/main/cached/RecordLike-interf.hh b/vm/boostenv/main/cached/RecordLike-interf.hh new file mode 100644 index 000000000..68d4313a9 --- /dev/null +++ b/vm/boostenv/main/cached/RecordLike-interf.hh @@ -0,0 +1,259 @@ +class RecordLike { +public: + RecordLike(RichNode self) : _self(self) {} + RecordLike(UnstableNode& self) : _self(self) {} + RecordLike(StableNode& self) : _self(self) {} + + bool isRecord(VM vm) { + if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.is()) { + return _self.as().isRecord(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isRecord(_self, vm); + } + } + + bool isTuple(VM vm) { + if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.is()) { + return _self.as().isTuple(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().isTuple(_self, vm); + } + } + + class mozart::UnstableNode label(VM vm) { + if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.is()) { + return _self.as().label(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().label(_self, vm); + } + } + + size_t width(VM vm) { + if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.is()) { + return _self.as().width(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().width(_self, vm); + } + } + + class mozart::UnstableNode arityList(VM vm) { + if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.is()) { + return _self.as().arityList(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().arityList(_self, vm); + } + } + + class mozart::UnstableNode clone(VM vm) { + if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.is()) { + return _self.as().clone(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().clone(_self, vm); + } + } + + class mozart::UnstableNode waitOr(VM vm) { + if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.is()) { + return _self.as().waitOr(vm); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().waitOr(_self, vm); + } + } + + bool testRecord(VM vm, class mozart::RichNode arity) { + if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.is()) { + return _self.as().testRecord(vm, arity); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().testRecord(_self, vm, arity); + } + } + + bool testTuple(VM vm, class mozart::RichNode label, size_t width) { + if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.is()) { + return _self.as().testTuple(vm, label, width); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().testTuple(_self, vm, label, width); + } + } + + bool testLabel(VM vm, class mozart::RichNode label) { + if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.is()) { + return _self.as().testLabel(vm, label); + } else if (_self.isTransient()) { + waitFor(vm, _self); + throw std::exception(); // not reachable + } else { + return Interface().testLabel(_self, vm, label); + } + } +protected: + RichNode _self; +}; + diff --git a/vm/boostenv/main/cached/Reference-implem-decl-after.hh b/vm/boostenv/main/cached/Reference-implem-decl-after.hh new file mode 100644 index 000000000..4afce2e5f --- /dev/null +++ b/vm/boostenv/main/cached/Reference-implem-decl-after.hh @@ -0,0 +1,38 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("Reference", uuid(), (! ::mozart::MemWord::requiresExternalMemory()), false, false, sbValue, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + inline + class mozart::StableNode * dest(); +}; diff --git a/vm/boostenv/main/cached/Reference-implem-decl.hh b/vm/boostenv/main/cached/Reference-implem-decl.hh new file mode 100644 index 000000000..65450d9e6 --- /dev/null +++ b/vm/boostenv/main/cached/Reference-implem-decl.hh @@ -0,0 +1,7 @@ +class Reference; + +template <> +class Storage { +public: + typedef class mozart::StableNode * Type; +}; diff --git a/vm/boostenv/main/cached/Reference-implem.hh b/vm/boostenv/main/cached/Reference-implem.hh new file mode 100644 index 000000000..aee78981d --- /dev/null +++ b/vm/boostenv/main/cached/Reference-implem.hh @@ -0,0 +1,29 @@ + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + StableNode* stable = new (gc->vm) StableNode; + to.make(gc->vm, stable); + stable->make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(sc->vm, sc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + StableNode* stable = new (sc->vm) StableNode; +to.make(sc->vm, stable); +stable->make(sc->vm, sc, from.access()); +} + +inline +class mozart::StableNode * TypedRichNode::dest() { + return _self.access().dest(); +} diff --git a/vm/boostenv/main/cached/ReflectiveEntity-implem-decl-after.hh b/vm/boostenv/main/cached/ReflectiveEntity-implem-decl-after.hh new file mode 100644 index 000000000..6277b9d03 --- /dev/null +++ b/vm/boostenv/main/cached/ReflectiveEntity-implem-decl-after.hh @@ -0,0 +1,50 @@ +template <> +class TypeInfoOf: public TypeInfo { + + static constexpr UUID uuid() { + return UUID(); + } +public: + TypeInfoOf() : TypeInfo("ReflectiveEntity", uuid(), false, false, false, sbTokenEq, 0) {} + + static const TypeInfoOf* const instance() { + return &RawType::rawType; + } + + static Type type() { + return Type(instance()); + } + + atom_t getTypeAtom(VM vm) const { + return ReflectiveEntity::getTypeAtom(vm); + } + + inline + void printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const; + + inline + void gCollect(GC gc, RichNode from, StableNode& to) const; + + inline + void gCollect(GC gc, RichNode from, UnstableNode& to) const; + + inline + void sClone(SC sc, RichNode from, StableNode& to) const; + + inline + void sClone(SC sc, RichNode from, UnstableNode& to) const; +}; + +template <> +class TypedRichNode: public BaseTypedRichNode { +public: + explicit TypedRichNode(RichNode self) : BaseTypedRichNode(self) {} + + template + inline + bool reflectiveCall(VM vm, const char * identity, Label && label, Args &&... args); + + inline + void printReprToStream(VM vm, std::ostream & out, int depth, int width); +}; diff --git a/vm/boostenv/main/cached/ReflectiveEntity-implem-decl.hh b/vm/boostenv/main/cached/ReflectiveEntity-implem-decl.hh new file mode 100644 index 000000000..b7526d8f1 --- /dev/null +++ b/vm/boostenv/main/cached/ReflectiveEntity-implem-decl.hh @@ -0,0 +1 @@ +class ReflectiveEntity; diff --git a/vm/boostenv/main/cached/ReflectiveEntity-implem.hh b/vm/boostenv/main/cached/ReflectiveEntity-implem.hh new file mode 100644 index 000000000..a83b2dc04 --- /dev/null +++ b/vm/boostenv/main/cached/ReflectiveEntity-implem.hh @@ -0,0 +1,37 @@ + +void TypeInfoOf::printReprToStream(VM vm, RichNode self, std::ostream& out, + int depth, int width) const { + assert(self.is()); + self.as().printReprToStream(vm, out, depth, width); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::gCollect(GC gc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.make(gc->vm, gc, from.access()); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, StableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +void TypeInfoOf::sClone(SC sc, RichNode from, UnstableNode& to) const { + assert(from.type() == type()); + to.init(sc->vm, from); +} + +template +inline +bool TypedRichNode::reflectiveCall(VM vm, const char * identity, Label && label, Args &&... args) { + return _self.access().reflectiveCall(vm, identity, std::forward