diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-11-16 12:38:37 -0600 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-11-16 12:38:37 -0600 |
commit | 57331ba9756df043b5c665aa4952a0a7b38799e5 (patch) | |
tree | 0feb2ca5cbe38744088845b8bb105673016c1fac /src/value.h |
Initial commit
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h new file mode 100644 index 0000000..a932514 --- /dev/null +++ b/src/value.h @@ -0,0 +1,38 @@ +#ifndef IMB3_VALUE_H +#define IMB3_VALUE_H + +#include <stdint.h> + +struct value { + uintptr_t bits; +}; + +enum value_tag { + /** + * A big integer or the nil constant. + */ + TAG_BIGINT_OR_NIL = 0b000, + + /** + * Fixnums, i.e. integers that are stored directly in the value rather than + * being pointed to. This is a two-bit tag rather than a three-bit tag... + */ + VALUE_FIXNUM = 0b01, + + /** + * A builtin-object. + */ + TAG_BUILTIN_OBJECT = 0b010, + + /** + * A simple-array, i.e. an array of values without a fill-pointer. + */ + TAG_SIMPLE_ARRAY = 0b100, + + /** + * A standard-object, effectively a pair of a class and a slot array. + */ + TAG_STANDARD_OBJECT = 0b110, +}; + +#endif // IMB3_VALUE_H |