-
Notifications
You must be signed in to change notification settings - Fork 28
/
lpinterpreter_types.pas
87 lines (70 loc) · 3.01 KB
/
lpinterpreter_types.pas
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
{
Author: Niels A.D
Project: Lape (https://github.com/nielsAD/lape)
License: GNU Lesser GPL (http://www.gnu.org/licenses/lgpl.html)
Interpreter types and opcodes.
}
unit lpinterpreter_types;
{$I lape.inc}
interface
uses
Classes, SysUtils,
lptypes;
{$IFNDEF Lape_SmallCode}
{$MINENUMSIZE 4} //Better alignment
{$ENDIF}
type
opCodeP = ^opCode;
opCode = (
ocNone,
ocIsScriptMethod, //IsScriptMethod
ocGetExceptionMessage, //GetExceptionMessage
ocGetExceptionLocation,
ocGetCallerLocation,
ocGetCallerAddress,
ocGetScriptMethodName,
ocDumpCallStack,
ocInitStackLen, //InitStackLen TStackOffset
ocInitStack, //InitStack TStackOffset
ocGrowStack, //GrowStack TStackOffset
ocExpandVar, //ExpandVar TStackOffset
ocExpandVarAndInit, //ExpandVarAndInit TStackOffset
ocGrowVar, //GrowVar TStackOffset
ocGrowVarAndInit, //GrowVarAndInit TStackOffset
ocPopStackToVar, //PopStackToVar TStackOffset TVarStackOffset
ocPopVarToStack, //PopVarToStack TStackOffset TVarStackOffset
ocPopVar, //PopVar
ocJmpVar, //JmpVar
ocJmpSafe, //JmpSafe TCodePos
ocJmpSafeR, //JmpSafeR TCodeOffset
ocIncTry, //IncTry TCodeOffset UInt32
ocDecTry, //DecTry
ocEndTry, //EndTry
ocCatchException, //CatchException
ocReRaiseException, //ReRaiseException
ocDecCall, //DecCall
ocDecCall_EndTry, //DecCall_EndTry
{$I lpinterpreter_invokeopcodes.inc}
{$I lpinterpreter_jumpopcodes.inc}
{$I lpinterpreter_evalopcodes.inc}
);
POC_PopStackToVar = ^TOC_PopStackToVar;
TOC_PopStackToVar = record
Size: TStackOffset;
VOffset: TVarStackOffset;
end;
POC_IncTry = ^TOC_IncTry;
TOC_IncTry = record
Jmp: TCodeOffset;
JmpFinally: UInt32;
end;
{$I lpinterpreter_invokerecords.inc}
{$I lpinterpreter_jumprecords.inc}
{$I lpinterpreter_evalrecords.inc}
const
ocSize = SizeOf(opCode) {$IFDEF Lape_EmitPos}+SizeOf(Pointer){$ENDIF};
Try_NoFinally: UInt32 = UInt32(-1);
Try_NoExcept: UInt32 = UInt32(-2);
EndJump: TCodePos = TCodePos(-1);
implementation
end.