forked from dolphinsmalltalk/DolphinVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTMethodHeader.h
More file actions
42 lines (32 loc) · 1.08 KB
/
STMethodHeader.h
File metadata and controls
42 lines (32 loc) · 1.08 KB
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
/******************************************************************************
File: STMethodHeader.h
Description:
VM representation of Smalltalk method header word.
N.B. This structure is well known to the VM, and must not
be modified in the image. Note also that their may also be
a representation in the assembler modules (so see istasm.inc)
******************************************************************************/
#ifndef _STMETHODHEADER_H_
#define _STMETHODHEADER_H_
typedef enum {
PRIMITIVE_ACTIVATE_METHOD = 0,
PRIMITIVE_RETURN_SELF = 1,
PRIMITIVE_RETURN_TRUE = 2,
PRIMITIVE_RETURN_FALSE = 3,
PRIMITIVE_RETURN_NIL = 4,
PRIMITIVE_RETURN_LITERAL_ZERO = 5,
PRIMITIVE_RETURN_INSTVAR = 6,
PRIMITIVE_SET_INSTVAR = 7,
PRIMITIVE_RETURN_STATIC_ZERO=8,
PRIMITIVE_MAX = 192 // Theoretical maximum is 255, but table is smaller
} STPrimitives;
typedef struct STMethodHeader
{
BYTE isInt : 1; // MUST be 1 (to avoid treatment as object)
BYTE isPrivate : 1;
BYTE envTempCount : 6;
BYTE stackTempCount;
BYTE argumentCount;
BYTE primitiveIndex;
} STMethodHeader;
#endif