-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathSTMethodHeader.h
37 lines (30 loc) · 1.07 KB
/
STMethodHeader.h
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
/******************************************************************************
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)
******************************************************************************/
#pragma once
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 = 224 // 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; // Note that this is actually count+1
BYTE stackTempCount;
BYTE argumentCount;
BYTE primitiveIndex;
} STMethodHeader;