File: BuiltIn.h

package info (click to toggle)
storm-lang 0.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 52,004 kB
  • sloc: ansic: 261,462; cpp: 140,405; sh: 14,891; perl: 9,846; python: 2,525; lisp: 2,504; asm: 860; makefile: 678; pascal: 70; java: 52; xml: 37; awk: 12
file content (87 lines) | stat: -rw-r--r-- 2,500 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#include "Core/EnginePtr.h"
#include "Code/Reference.h"

namespace storm {
	STORM_PKG(core.asm);

	namespace builtin {
		/**
		 * Global references to built-in functions in the compiler. These are needed from generated code,
		 * but are not intended to be visible as functions in the name tree. Either as they have semantics
		 * that do not match the expected semantics in the rest of the system, or because their signatures
		 * are not easily expressible in the type system, or for other reasons.
		 *
		 * Use ref() to get a reference to these things.
		 */
		enum BuiltIn {
			// Reference to the engine itself.
			engine,
			// Reference to the entry-point for lazy code updates.
			lazyCodeUpdate,
			// Reference to the throw function for a rule.
			ruleThrow,
			// Allocate an object of the type given.
			alloc,
			// Allocate an array of the given type and size.
			allocArray,
			// Execute as<T>.
			as,
			// # of bytes inside a vtable the object's vtable ptr is pointing.
			VTableAllocOffset,
			// # of bytes inside TObject the thread is stored
			TObjectOffset,
			// Access the 'atRaw' member of Map.
			mapAtValue,
			mapAtClass,
			// Acces to the 'getUnsafeRaw' member of Map.
			mapGetUnsafe,
			// Acces to the 'getUnsafeRaw' member of Set.
			setGetUnsafe,
			// Acces the generic 'EnumType::toString'.
			enumToS,
			// Access to 'postRaw' and 'resultRaw' in Future.
			futurePost,
			futureResult,
			// Set a future into "no-clone"-mode.
			futureNoClone,
			// Low-level helpers for spawning threads.
			spawnResult,
			spawnFuture,
			spawnFutureId,
			spawnVoid,
			spawnVoidId,
			// Access to things inside FnBase.
			fnNeedsCopy,
			fnCall,
			fnCreate,
			// A null function (does nothing).
			fnNull,
			// ToS helper for Maybe<T>.
			maybeToS,
			// Get the address of a global variable.
			globalAddr,
			// Throw an "Abstract function called"-exception.
			throwAbstractError,
			// Throw a generic exception (an instance of storm::Exception).
			throwException,
			// Create a Variant instance from a value (a constructor).
			createValVariant,
			// Create a Variant instance from a class (a constructor).
			createClassVariant,
			// Create a Join instance.
			createJoin,
			// Get the address of a RefSource.
			refSourceAddr,
			// Call 'cloned' of a CloneEnv
			cloneEnvGet,
			cloneEnvPut,

			// Should be the last one.
			count,
		};

		// Get a reference to a built-in thing.
		code::Ref STORM_FN ref(EnginePtr e, BuiltIn which);
	}
}