@quenk/potoo 4.0.12 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actor/address.d.ts +5 -1
- package/lib/actor/address.js +7 -2
- package/lib/actor/address.js.map +1 -1
- package/lib/actor/system/vm/allocator/index.d.ts +9 -2
- package/lib/actor/system/vm/allocator/map.d.ts +2 -1
- package/lib/actor/system/vm/allocator/map.js +30 -23
- package/lib/actor/system/vm/allocator/map.js.map +1 -1
- package/lib/actor/system/vm/event/dispatcher.d.ts +4 -4
- package/lib/actor/system/vm/event/dispatcher.js +9 -9
- package/lib/actor/system/vm/event/dispatcher.js.map +1 -1
- package/lib/actor/system/vm/event/index.d.ts +1 -1
- package/lib/actor/system/vm/event/index.js +1 -1
- package/lib/actor/system/vm/index.d.ts +16 -9
- package/lib/actor/system/vm/index.js +17 -9
- package/lib/actor/system/vm/index.js.map +1 -1
- package/lib/actor/system/vm/runtime/error.d.ts +0 -42
- package/lib/actor/system/vm/runtime/error.js +1 -61
- package/lib/actor/system/vm/runtime/error.js.map +1 -1
- package/lib/actor/system/vm/thread/collector.d.ts +35 -0
- package/lib/actor/system/vm/thread/collector.js +52 -0
- package/lib/actor/system/vm/thread/collector.js.map +1 -0
- package/lib/actor/system/vm/thread/factory.js +2 -2
- package/lib/actor/system/vm/thread/factory.js.map +1 -1
- package/lib/actor/system/vm/thread/index.d.ts +5 -0
- package/lib/actor/system/vm/thread/index.js.map +1 -1
- package/lib/actor/system/vm/thread/process.d.ts +4 -2
- package/lib/actor/system/vm/thread/process.js +4 -3
- package/lib/actor/system/vm/thread/process.js.map +1 -1
- package/lib/actor/system/vm/thread/runner.d.ts +31 -0
- package/lib/actor/system/vm/thread/runner.js +60 -0
- package/lib/actor/system/vm/thread/runner.js.map +1 -0
- package/lib/actor/system/vm/thread/shared/js.d.ts +4 -3
- package/lib/actor/system/vm/thread/shared/js.js +18 -6
- package/lib/actor/system/vm/thread/shared/js.js.map +1 -1
- package/lib/actor/template.d.ts +0 -5
- package/lib/actor/template.js +1 -13
- package/lib/actor/template.js.map +1 -1
- package/package.json +1 -1
- package/lib/actor/system/vm/frame.d.ts +0 -228
- package/lib/actor/system/vm/frame.js +0 -233
- package/lib/actor/system/vm/frame.js.map +0 -1
- package/lib/actor/system/vm/object/foreign.d.ts +0 -9
- package/lib/actor/system/vm/object/foreign.js +0 -13
- package/lib/actor/system/vm/object/foreign.js.map +0 -1
- package/lib/actor/system/vm/object/index.d.ts +0 -5
- package/lib/actor/system/vm/object/index.js +0 -3
- package/lib/actor/system/vm/object/index.js.map +0 -1
- package/lib/actor/system/vm/object/list.d.ts +0 -8
- package/lib/actor/system/vm/object/list.js +0 -12
- package/lib/actor/system/vm/object/list.js.map +0 -1
- package/lib/actor/system/vm/op/actor.d.ts +0 -69
- package/lib/actor/system/vm/op/actor.js +0 -118
- package/lib/actor/system/vm/op/actor.js.map +0 -1
- package/lib/actor/system/vm/op/base.d.ts +0 -142
- package/lib/actor/system/vm/op/base.js +0 -242
- package/lib/actor/system/vm/op/base.js.map +0 -1
- package/lib/actor/system/vm/op/index.d.ts +0 -106
- package/lib/actor/system/vm/op/index.js +0 -232
- package/lib/actor/system/vm/op/index.js.map +0 -1
- package/lib/actor/system/vm/op/object.d.ts +0 -31
- package/lib/actor/system/vm/op/object.js +0 -78
- package/lib/actor/system/vm/op/object.js.map +0 -1
- package/lib/actor/system/vm/registry.d.ts +0 -126
- package/lib/actor/system/vm/registry.js +0 -191
- package/lib/actor/system/vm/registry.js.map +0 -1
- package/lib/actor/system/vm/script/index.d.ts +0 -49
- package/lib/actor/system/vm/script/index.js +0 -29
- package/lib/actor/system/vm/script/index.js.map +0 -1
- package/lib/actor/system/vm/script/info.d.ts +0 -279
- package/lib/actor/system/vm/script/info.js +0 -256
- package/lib/actor/system/vm/script/info.js.map +0 -1
- package/lib/actor/system/vm/type.d.ts +0 -90
- package/lib/actor/system/vm/type.js +0 -29
- package/lib/actor/system/vm/type.js.map +0 -1
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { Either } from '@quenk/noni/lib/data/either';
|
|
2
|
-
import { Err } from '@quenk/noni/lib/control/error';
|
|
3
|
-
import { Type } from '@quenk/noni/lib/data/type';
|
|
4
|
-
import { Maybe } from '@quenk/noni/lib/data/maybe';
|
|
5
|
-
import { FunInfo, Info } from './script/info';
|
|
6
|
-
import { JSThread } from './thread/shared/js';
|
|
7
|
-
import { Script } from './script';
|
|
8
|
-
import { PTObject } from './object';
|
|
9
|
-
import { Instruction, Operand } from './op';
|
|
10
|
-
import { PTValue } from './type';
|
|
11
|
-
export declare const DATA_RANGE_TYPE_HIGH = 4026531840;
|
|
12
|
-
export declare const DATA_RANGE_TYPE_LOW = 16777216;
|
|
13
|
-
export declare const DATA_RANGE_TYPE_STEP = 16777216;
|
|
14
|
-
export declare const DATA_MASK_TYPE = 4278190080;
|
|
15
|
-
export declare const DATA_MASK_VALUE8 = 255;
|
|
16
|
-
export declare const DATA_MASK_VALUE16 = 65535;
|
|
17
|
-
export declare const DATA_MASK_VALUE24 = 16777215;
|
|
18
|
-
export declare const DATA_MASK_VALUE32 = 4294967295;
|
|
19
|
-
export declare const DATA_MAX_SIZE = 4294967295;
|
|
20
|
-
export declare const DATA_MAX_SAFE_UINT32 = 2147483647;
|
|
21
|
-
export declare const DATA_TYPE_STRING: number;
|
|
22
|
-
export declare const DATA_TYPE_INFO: number;
|
|
23
|
-
export declare const DATA_TYPE_HEAP_STRING: number;
|
|
24
|
-
export declare const DATA_TYPE_HEAP_OBJECT: number;
|
|
25
|
-
export declare const DATA_TYPE_HEAP_FOREIGN: number;
|
|
26
|
-
export declare const DATA_TYPE_HEAP_FUN: number;
|
|
27
|
-
export declare const DATA_TYPE_LOCAL: number;
|
|
28
|
-
export declare const DATA_TYPE_MAILBOX: number;
|
|
29
|
-
export declare const DATA_TYPE_SELF: number;
|
|
30
|
-
export declare const DATA_TYPE_VOID: number;
|
|
31
|
-
export declare const BYTE_CONSTANT_NUM = 65536;
|
|
32
|
-
export declare const BYTE_CONSTANT_STR = 131072;
|
|
33
|
-
export declare const BYTE_CONSTANT_INFO = 196608;
|
|
34
|
-
/**
|
|
35
|
-
* Data is the type of values that can appear on a Frame's data stack.
|
|
36
|
-
*
|
|
37
|
-
* It is a 32bit unsigned integer in the range 0x00000000-0x7FFFFFFF
|
|
38
|
-
*
|
|
39
|
-
* Typically, the highest byte is used to indicate the type of the data
|
|
40
|
-
* in realtion to storage location and the remaining 3 bytes, value.
|
|
41
|
-
*
|
|
42
|
-
* 11111111 11111111 11111111 11111111
|
|
43
|
-
* <type/location> < value >
|
|
44
|
-
*
|
|
45
|
-
* The actual interpretation of the location and value part are dependant on
|
|
46
|
-
* the type.
|
|
47
|
-
*/
|
|
48
|
-
export type Data = number;
|
|
49
|
-
/**
|
|
50
|
-
* Used to identity frames via a specific format:
|
|
51
|
-
* <templateid>@<actorid>#<callstack>
|
|
52
|
-
*
|
|
53
|
-
* Where <callstack> is a list of function names in the callstack up to the
|
|
54
|
-
* Frame's own function separated by '/'.
|
|
55
|
-
*/
|
|
56
|
-
export type FrameName = string;
|
|
57
|
-
/**
|
|
58
|
-
* Frame is the context for currently executing op codes.
|
|
59
|
-
*
|
|
60
|
-
* It provides methods for manipulating the stack common to each op code as
|
|
61
|
-
* well as access to other components of the system.
|
|
62
|
-
*/
|
|
63
|
-
export interface Frame {
|
|
64
|
-
/**
|
|
65
|
-
* name of the Frame used to identity it.
|
|
66
|
-
*/
|
|
67
|
-
name: FrameName;
|
|
68
|
-
/**
|
|
69
|
-
* script the routine is defined in.
|
|
70
|
-
*/
|
|
71
|
-
script: Script;
|
|
72
|
-
/**
|
|
73
|
-
* thread for the actor.
|
|
74
|
-
*/
|
|
75
|
-
thread: JSThread;
|
|
76
|
-
/**
|
|
77
|
-
* parent Frame that created this Frame (if any).
|
|
78
|
-
*/
|
|
79
|
-
parent: Maybe<Frame>;
|
|
80
|
-
/**
|
|
81
|
-
* code the frame executes as part of the routine.
|
|
82
|
-
*/
|
|
83
|
-
code: Instruction[];
|
|
84
|
-
/**
|
|
85
|
-
* data stack or operand stack.
|
|
86
|
-
*/
|
|
87
|
-
data: Data[];
|
|
88
|
-
/**
|
|
89
|
-
* locals contains variables local to the routine.
|
|
90
|
-
*/
|
|
91
|
-
locals: Data[];
|
|
92
|
-
/**
|
|
93
|
-
* getPosition of the internal instruction pointer.
|
|
94
|
-
*/
|
|
95
|
-
getPosition(): number;
|
|
96
|
-
/**
|
|
97
|
-
* push an operand onto the data stack.
|
|
98
|
-
*
|
|
99
|
-
* Values not in the range 0 - 2^32 (integer only) may yield unexpected
|
|
100
|
-
* results during computation. Care should be taken when using this method
|
|
101
|
-
* directly to ensure the desired value is actual on the stack.
|
|
102
|
-
*/
|
|
103
|
-
push(d: Data): Frame;
|
|
104
|
-
/**
|
|
105
|
-
* pushUInt8 pushes an unsigned 8bit integer onto the data stack.
|
|
106
|
-
*/
|
|
107
|
-
pushUInt8(value: Operand): Frame;
|
|
108
|
-
/**
|
|
109
|
-
* pushUInt16 pushes an unsigned 16bit integer onto the data stack.
|
|
110
|
-
*/
|
|
111
|
-
pushUInt16(value: Operand): Frame;
|
|
112
|
-
/**
|
|
113
|
-
* pushUInt32 pushes an unsigned 32bit integer onto the data stack.
|
|
114
|
-
*/
|
|
115
|
-
pushUInt32(value: Operand): Frame;
|
|
116
|
-
/**
|
|
117
|
-
* pushString from the constant pool onto the data stack.
|
|
118
|
-
*/
|
|
119
|
-
pushString(idx: Operand): Frame;
|
|
120
|
-
/**
|
|
121
|
-
* pushName pushes a named constant from the info section onto the stack.
|
|
122
|
-
*/
|
|
123
|
-
pushName(idx: Operand): Frame;
|
|
124
|
-
/**
|
|
125
|
-
* pushMessage from the mailbox onto the stack.
|
|
126
|
-
*/
|
|
127
|
-
pushMessage(): Frame;
|
|
128
|
-
/**
|
|
129
|
-
* pushSelf pushes the address of the executing actor on to the stack.
|
|
130
|
-
*/
|
|
131
|
-
pushSelf(): Frame;
|
|
132
|
-
/**
|
|
133
|
-
* peek at the top of the data stack.
|
|
134
|
-
*
|
|
135
|
-
* An offset can be specified to peek further down the stack.
|
|
136
|
-
*/
|
|
137
|
-
peek(n?: number): Maybe<Data>;
|
|
138
|
-
/**
|
|
139
|
-
* resolve a value from its reference.
|
|
140
|
-
*
|
|
141
|
-
* An error will be produced if the value cannot be resolved.
|
|
142
|
-
* Do not use this method to retreive uint8,uint16 or uint32.
|
|
143
|
-
*/
|
|
144
|
-
resolve(data: Data): Either<Err, PTValue>;
|
|
145
|
-
/**
|
|
146
|
-
* pop the top most value from the data stack.
|
|
147
|
-
*
|
|
148
|
-
* If the stack is empty the value 0 is returned.
|
|
149
|
-
*/
|
|
150
|
-
pop(): Data;
|
|
151
|
-
/**
|
|
152
|
-
* popValue pops and attempts to resolve the top most value of the data stack.
|
|
153
|
-
*/
|
|
154
|
-
popValue(): Either<Err, Type>;
|
|
155
|
-
/**
|
|
156
|
-
* popString from the top of the data stack.
|
|
157
|
-
*/
|
|
158
|
-
popString(): Either<Err, string>;
|
|
159
|
-
/**
|
|
160
|
-
* popName pops a named object from the top of the data stack.
|
|
161
|
-
*/
|
|
162
|
-
popName(): Either<Err, Info>;
|
|
163
|
-
/**
|
|
164
|
-
* popFunction from the top of the data stack.
|
|
165
|
-
*/
|
|
166
|
-
popFunction(): Either<Err, FunInfo>;
|
|
167
|
-
/**
|
|
168
|
-
* popObject provides the entry for an object in the heap.
|
|
169
|
-
*/
|
|
170
|
-
popObject(): Either<Err, PTObject>;
|
|
171
|
-
/**
|
|
172
|
-
* popForeign provides the entry for a foreign object in the heap.
|
|
173
|
-
*/
|
|
174
|
-
popForeign(): Either<Err, Type>;
|
|
175
|
-
/**
|
|
176
|
-
* duplicate the top of the stack.
|
|
177
|
-
*/
|
|
178
|
-
duplicate(): Frame;
|
|
179
|
-
/**
|
|
180
|
-
* advance the internal instruction pointer by 1 place.
|
|
181
|
-
*/
|
|
182
|
-
advance(): Frame;
|
|
183
|
-
/**
|
|
184
|
-
* seek advances the instruction pointer to the specified location.
|
|
185
|
-
*/
|
|
186
|
-
seek(loc: number): Frame;
|
|
187
|
-
/**
|
|
188
|
-
* isFinished returns true if the instruction pointer for the frame has
|
|
189
|
-
* reached the end of the code section.
|
|
190
|
-
*/
|
|
191
|
-
isFinished(): boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* StackFrame (Frame implementation).
|
|
195
|
-
*/
|
|
196
|
-
export declare class StackFrame implements Frame {
|
|
197
|
-
name: string;
|
|
198
|
-
script: Script;
|
|
199
|
-
thread: JSThread;
|
|
200
|
-
parent: Maybe<Frame>;
|
|
201
|
-
code: Instruction[];
|
|
202
|
-
data: Data[];
|
|
203
|
-
locals: Data[];
|
|
204
|
-
ip: number;
|
|
205
|
-
constructor(name: string, script: Script, thread: JSThread, parent?: Maybe<Frame>, code?: Instruction[], data?: Data[], locals?: Data[], ip?: number);
|
|
206
|
-
getPosition(): number;
|
|
207
|
-
push(d: Data): Frame;
|
|
208
|
-
pushUInt8(value: Operand): Frame;
|
|
209
|
-
pushUInt16(value: Operand): Frame;
|
|
210
|
-
pushUInt32(value: Operand): Frame;
|
|
211
|
-
pushString(idx: Operand): Frame;
|
|
212
|
-
pushName(idx: Operand): Frame;
|
|
213
|
-
pushMessage(): Frame;
|
|
214
|
-
pushSelf(): Frame;
|
|
215
|
-
peek(n?: number): Maybe<Data>;
|
|
216
|
-
resolve(data: Data): Either<Err, Type>;
|
|
217
|
-
pop(): Data;
|
|
218
|
-
popValue(): Either<Err, PTValue>;
|
|
219
|
-
popString(): Either<Err, string>;
|
|
220
|
-
popName(): Either<Err, Info>;
|
|
221
|
-
popFunction(): Either<Err, FunInfo>;
|
|
222
|
-
popObject(): Either<Err, PTObject>;
|
|
223
|
-
popForeign(): Either<Err, Type>;
|
|
224
|
-
duplicate(): Frame;
|
|
225
|
-
advance(): Frame;
|
|
226
|
-
seek(loc: number): Frame;
|
|
227
|
-
isFinished(): boolean;
|
|
228
|
-
}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StackFrame = exports.BYTE_CONSTANT_INFO = exports.BYTE_CONSTANT_STR = exports.BYTE_CONSTANT_NUM = exports.DATA_TYPE_VOID = exports.DATA_TYPE_SELF = exports.DATA_TYPE_MAILBOX = exports.DATA_TYPE_LOCAL = exports.DATA_TYPE_HEAP_FUN = exports.DATA_TYPE_HEAP_FOREIGN = exports.DATA_TYPE_HEAP_OBJECT = exports.DATA_TYPE_HEAP_STRING = exports.DATA_TYPE_INFO = exports.DATA_TYPE_STRING = exports.DATA_MAX_SAFE_UINT32 = exports.DATA_MAX_SIZE = exports.DATA_MASK_VALUE32 = exports.DATA_MASK_VALUE24 = exports.DATA_MASK_VALUE16 = exports.DATA_MASK_VALUE8 = exports.DATA_MASK_TYPE = exports.DATA_RANGE_TYPE_STEP = exports.DATA_RANGE_TYPE_LOW = exports.DATA_RANGE_TYPE_HIGH = void 0;
|
|
4
|
-
const indexes = require("./script");
|
|
5
|
-
const error = require("./runtime/error");
|
|
6
|
-
const either_1 = require("@quenk/noni/lib/data/either");
|
|
7
|
-
const maybe_1 = require("@quenk/noni/lib/data/maybe");
|
|
8
|
-
const type_1 = require("./type");
|
|
9
|
-
exports.DATA_RANGE_TYPE_HIGH = 0xf0000000;
|
|
10
|
-
exports.DATA_RANGE_TYPE_LOW = 0x1000000;
|
|
11
|
-
exports.DATA_RANGE_TYPE_STEP = 0x1000000;
|
|
12
|
-
// Used to extract the desired part via &
|
|
13
|
-
exports.DATA_MASK_TYPE = 0xff000000;
|
|
14
|
-
exports.DATA_MASK_VALUE8 = 0xff;
|
|
15
|
-
exports.DATA_MASK_VALUE16 = 0xffff;
|
|
16
|
-
exports.DATA_MASK_VALUE24 = 0xffffff;
|
|
17
|
-
exports.DATA_MASK_VALUE32 = 0xffffffff;
|
|
18
|
-
exports.DATA_MAX_SIZE = 0xffffffff;
|
|
19
|
-
exports.DATA_MAX_SAFE_UINT32 = 0x7fffffff;
|
|
20
|
-
//These really indicate where the actual value of an operand is stored.
|
|
21
|
-
//They are not meant to be used to check the actual type of the underlying value.
|
|
22
|
-
exports.DATA_TYPE_STRING = exports.DATA_RANGE_TYPE_STEP * 3;
|
|
23
|
-
exports.DATA_TYPE_INFO = exports.DATA_RANGE_TYPE_STEP * 4;
|
|
24
|
-
exports.DATA_TYPE_HEAP_STRING = exports.DATA_RANGE_TYPE_STEP * 6;
|
|
25
|
-
exports.DATA_TYPE_HEAP_OBJECT = exports.DATA_RANGE_TYPE_STEP * 7;
|
|
26
|
-
exports.DATA_TYPE_HEAP_FOREIGN = exports.DATA_RANGE_TYPE_STEP * 8;
|
|
27
|
-
exports.DATA_TYPE_HEAP_FUN = exports.DATA_RANGE_TYPE_STEP * 9;
|
|
28
|
-
exports.DATA_TYPE_LOCAL = exports.DATA_RANGE_TYPE_STEP * 10;
|
|
29
|
-
exports.DATA_TYPE_MAILBOX = exports.DATA_RANGE_TYPE_STEP * 11;
|
|
30
|
-
exports.DATA_TYPE_SELF = exports.DATA_RANGE_TYPE_STEP * 12;
|
|
31
|
-
exports.DATA_TYPE_VOID = exports.DATA_RANGE_TYPE_STEP * 13;
|
|
32
|
-
exports.BYTE_CONSTANT_NUM = 0x10000;
|
|
33
|
-
exports.BYTE_CONSTANT_STR = 0x20000;
|
|
34
|
-
exports.BYTE_CONSTANT_INFO = 0x30000;
|
|
35
|
-
/**
|
|
36
|
-
* StackFrame (Frame implementation).
|
|
37
|
-
*/
|
|
38
|
-
class StackFrame {
|
|
39
|
-
constructor(name, script, thread, parent = (0, maybe_1.nothing)(), code = [], data = [], locals = [], ip = 0) {
|
|
40
|
-
this.name = name;
|
|
41
|
-
this.script = script;
|
|
42
|
-
this.thread = thread;
|
|
43
|
-
this.parent = parent;
|
|
44
|
-
this.code = code;
|
|
45
|
-
this.data = data;
|
|
46
|
-
this.locals = locals;
|
|
47
|
-
this.ip = ip;
|
|
48
|
-
}
|
|
49
|
-
getPosition() {
|
|
50
|
-
return this.ip;
|
|
51
|
-
}
|
|
52
|
-
push(d) {
|
|
53
|
-
this.data.push(d);
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
pushUInt8(value) {
|
|
57
|
-
return this.push((value >>> 0) & exports.DATA_MASK_VALUE8);
|
|
58
|
-
}
|
|
59
|
-
pushUInt16(value) {
|
|
60
|
-
return this.push((value >>> 0) & exports.DATA_MASK_VALUE16);
|
|
61
|
-
}
|
|
62
|
-
pushUInt32(value) {
|
|
63
|
-
return this.push(value >>> 0);
|
|
64
|
-
}
|
|
65
|
-
pushString(idx) {
|
|
66
|
-
return this.push(idx | exports.DATA_TYPE_STRING);
|
|
67
|
-
}
|
|
68
|
-
pushName(idx) {
|
|
69
|
-
return this.push(idx | exports.DATA_TYPE_INFO);
|
|
70
|
-
}
|
|
71
|
-
pushMessage() {
|
|
72
|
-
return this.push(0 | exports.DATA_TYPE_MAILBOX);
|
|
73
|
-
}
|
|
74
|
-
pushSelf() {
|
|
75
|
-
return this.push(exports.DATA_TYPE_SELF);
|
|
76
|
-
}
|
|
77
|
-
peek(n = 0) {
|
|
78
|
-
return (0, maybe_1.fromNullable)(this.data.length - (n + 1));
|
|
79
|
-
}
|
|
80
|
-
resolve(data) {
|
|
81
|
-
let typ = data & exports.DATA_MASK_TYPE;
|
|
82
|
-
let value = data & exports.DATA_MASK_VALUE24;
|
|
83
|
-
switch (typ) {
|
|
84
|
-
case exports.DATA_TYPE_STRING:
|
|
85
|
-
case exports.DATA_TYPE_HEAP_STRING:
|
|
86
|
-
this.push(data);
|
|
87
|
-
return this.popString();
|
|
88
|
-
case exports.DATA_TYPE_HEAP_FUN:
|
|
89
|
-
this.push(data);
|
|
90
|
-
return this.popFunction();
|
|
91
|
-
case exports.DATA_TYPE_HEAP_OBJECT:
|
|
92
|
-
this.push(data);
|
|
93
|
-
return this.popObject();
|
|
94
|
-
case exports.DATA_TYPE_HEAP_FOREIGN:
|
|
95
|
-
this.push(data);
|
|
96
|
-
return this.popForeign();
|
|
97
|
-
case exports.DATA_TYPE_INFO:
|
|
98
|
-
this.push(data);
|
|
99
|
-
return this.popName();
|
|
100
|
-
//TODO: This is probably not needed.
|
|
101
|
-
case exports.DATA_TYPE_LOCAL:
|
|
102
|
-
let mRef = (0, maybe_1.fromNullable)(this.locals[value]);
|
|
103
|
-
if (mRef.isNothing())
|
|
104
|
-
return nullErr(data);
|
|
105
|
-
//TODO: review call stack safety of this recursive call.
|
|
106
|
-
return this.resolve(mRef.get());
|
|
107
|
-
case exports.DATA_TYPE_MAILBOX:
|
|
108
|
-
if (this.thread.mailbox.length === 0)
|
|
109
|
-
return nullErr(data);
|
|
110
|
-
//messages are always accessed sequentially FIFO
|
|
111
|
-
return (0, either_1.right)(this.thread.mailbox.shift());
|
|
112
|
-
case exports.DATA_TYPE_SELF:
|
|
113
|
-
return (0, either_1.right)(this.thread.address);
|
|
114
|
-
//TODO: This sometimes results in us treating 0 as a legitimate
|
|
115
|
-
//value whereas it should be an error. However, 0 is a valid value
|
|
116
|
-
//for numbers, and booleans. Needs review, solution may be in ops
|
|
117
|
-
//rather than here.
|
|
118
|
-
default:
|
|
119
|
-
return (0, either_1.right)(value);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
pop() {
|
|
123
|
-
return this.data.pop() | 0;
|
|
124
|
-
}
|
|
125
|
-
popValue() {
|
|
126
|
-
return this.data.length === 0
|
|
127
|
-
? (0, either_1.left)(new error.StackEmptyErr())
|
|
128
|
-
: this.resolve(this.pop());
|
|
129
|
-
}
|
|
130
|
-
popString() {
|
|
131
|
-
let data = this.pop();
|
|
132
|
-
let typ = data & exports.DATA_MASK_TYPE;
|
|
133
|
-
let idx = data & exports.DATA_MASK_VALUE24;
|
|
134
|
-
if (typ === exports.DATA_TYPE_STRING) {
|
|
135
|
-
let s = this.script.constants[indexes.CONSTANTS_INDEX_STRING][idx];
|
|
136
|
-
if (s == null)
|
|
137
|
-
return missingSymbol(data);
|
|
138
|
-
return (0, either_1.right)(s);
|
|
139
|
-
}
|
|
140
|
-
else if (typ === exports.DATA_TYPE_HEAP_STRING) {
|
|
141
|
-
return (0, either_1.right)(this.thread.vm.registry.getString(data).get());
|
|
142
|
-
}
|
|
143
|
-
else if (typ === exports.DATA_TYPE_SELF) {
|
|
144
|
-
return (0, either_1.right)(this.thread.address);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
return wrongType(exports.DATA_TYPE_STRING, typ);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
popName() {
|
|
151
|
-
let data = this.pop();
|
|
152
|
-
let typ = data & exports.DATA_MASK_TYPE;
|
|
153
|
-
let idx = data & exports.DATA_MASK_VALUE24;
|
|
154
|
-
if (typ === exports.DATA_TYPE_INFO) {
|
|
155
|
-
let info = this.script.info[idx];
|
|
156
|
-
if (info == null)
|
|
157
|
-
return nullErr(data);
|
|
158
|
-
return (0, either_1.right)(info);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
return wrongType(exports.DATA_TYPE_INFO, data);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
popFunction() {
|
|
165
|
-
let data = this.pop();
|
|
166
|
-
/* TODO: Heap functions are no longer supported right now.
|
|
167
|
-
let typ = data & DATA_MASK_TYPE;
|
|
168
|
-
if (typ === DATA_TYPE_HEAP_FUN) {
|
|
169
|
-
let mFun = this.thread.vm.heap.getObject(data);
|
|
170
|
-
|
|
171
|
-
return mFun.isJust() ? right(mFun.get()) : nullFunPtr(data);
|
|
172
|
-
} else {
|
|
173
|
-
*/
|
|
174
|
-
this.push(data);
|
|
175
|
-
return this.popName().chain(nfo => {
|
|
176
|
-
if ((nfo.descriptor & type_1.BYTE_TYPE) !== type_1.TYPE_FUN)
|
|
177
|
-
return notAFunction(nfo.name);
|
|
178
|
-
return (0, either_1.right)(nfo);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
popObject() {
|
|
182
|
-
let data = this.pop();
|
|
183
|
-
let typ = data & exports.DATA_MASK_TYPE;
|
|
184
|
-
if (typ === exports.DATA_TYPE_HEAP_OBJECT) {
|
|
185
|
-
let mho = this.thread.vm.registry.getObject(data);
|
|
186
|
-
if (mho.isNothing())
|
|
187
|
-
return nullErr(data);
|
|
188
|
-
// TODO: review how this works.
|
|
189
|
-
return (0, either_1.right)(mho.get());
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
return wrongType(exports.DATA_TYPE_HEAP_OBJECT, typ);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
popForeign() {
|
|
196
|
-
let data = this.pop();
|
|
197
|
-
let typ = data & exports.DATA_MASK_TYPE;
|
|
198
|
-
if (typ === exports.DATA_TYPE_HEAP_FOREIGN) {
|
|
199
|
-
let mho = this.thread.vm.registry.getObject(data);
|
|
200
|
-
if (mho.isNothing())
|
|
201
|
-
return nullErr(data);
|
|
202
|
-
return (0, either_1.right)(mho.get());
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return wrongType(exports.DATA_TYPE_HEAP_FOREIGN, typ);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
duplicate() {
|
|
209
|
-
let top = this.data.pop();
|
|
210
|
-
this.data.push(top);
|
|
211
|
-
this.data.push(top);
|
|
212
|
-
return this;
|
|
213
|
-
}
|
|
214
|
-
advance() {
|
|
215
|
-
this.ip = this.ip + 1;
|
|
216
|
-
return this;
|
|
217
|
-
}
|
|
218
|
-
seek(loc) {
|
|
219
|
-
this.ip = loc;
|
|
220
|
-
return this;
|
|
221
|
-
}
|
|
222
|
-
isFinished() {
|
|
223
|
-
return this.ip >= this.code.length;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
exports.StackFrame = StackFrame;
|
|
227
|
-
const nullErr = (data) => (0, either_1.left)(new error.NullPointerErr(data));
|
|
228
|
-
const wrongType = (expect, got) => (0, either_1.left)(new error.UnexpectedDataType(expect, got));
|
|
229
|
-
const notAFunction = (name) => (0, either_1.left)(new error.InvalidFunctionErr(name));
|
|
230
|
-
//const nullFunPtr = <T>(addr: Data): Either<Err, T> =>
|
|
231
|
-
// left(new error.NullFunctionPointerErr(addr));
|
|
232
|
-
const missingSymbol = (data) => (0, either_1.left)(new error.MissingSymbolErr(data));
|
|
233
|
-
//# sourceMappingURL=frame.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../../../src/actor/system/vm/frame.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,yCAAyC;AAEzC,wDAAkE;AAGlE,sDAA0E;AAO1E,iCAAsD;AAEzC,QAAA,oBAAoB,GAAG,UAAU,CAAC;AAClC,QAAA,mBAAmB,GAAG,SAAS,CAAC;AAChC,QAAA,oBAAoB,GAAG,SAAS,CAAC;AAE9C,yCAAyC;AAC5B,QAAA,cAAc,GAAG,UAAU,CAAC;AAC5B,QAAA,gBAAgB,GAAG,IAAI,CAAC;AACxB,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAC7B,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAE/B,QAAA,aAAa,GAAG,UAAU,CAAC;AAC3B,QAAA,oBAAoB,GAAG,UAAU,CAAC;AAE/C,uEAAuE;AACvE,iFAAiF;AACpE,QAAA,gBAAgB,GAAG,4BAAoB,GAAG,CAAC,CAAC;AAC5C,QAAA,cAAc,GAAG,4BAAoB,GAAG,CAAC,CAAC;AAC1C,QAAA,qBAAqB,GAAG,4BAAoB,GAAG,CAAC,CAAC;AACjD,QAAA,qBAAqB,GAAG,4BAAoB,GAAG,CAAC,CAAC;AACjD,QAAA,sBAAsB,GAAG,4BAAoB,GAAG,CAAC,CAAC;AAClD,QAAA,kBAAkB,GAAG,4BAAoB,GAAG,CAAC,CAAC;AAC9C,QAAA,eAAe,GAAG,4BAAoB,GAAG,EAAE,CAAC;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kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;AAE7C,uDAAuD;AACvD,mDAAmD;AAEnD,MAAM,aAAa,GAAG,CAAI,IAAU,EAAkB,EAAE,CACpD,IAAA,aAAI,EAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Type } from '@quenk/noni/lib/data/type';
|
|
2
|
-
import { PTObject } from '.';
|
|
3
|
-
/**
|
|
4
|
-
* PTForeign contains an opaque value whose type is external to the VM.
|
|
5
|
-
*/
|
|
6
|
-
export declare class PTForeign implements PTObject {
|
|
7
|
-
value: Type;
|
|
8
|
-
constructor(value: Type);
|
|
9
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PTForeign = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* PTForeign contains an opaque value whose type is external to the VM.
|
|
6
|
-
*/
|
|
7
|
-
class PTForeign {
|
|
8
|
-
constructor(value) {
|
|
9
|
-
this.value = value;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.PTForeign = PTForeign;
|
|
13
|
-
//# sourceMappingURL=foreign.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"foreign.js","sourceRoot":"","sources":["../../../../../src/actor/system/vm/object/foreign.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,SAAS;IAClB,YAAmB,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;IAAG,CAAC;CACrC;AAFD,8BAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/actor/system/vm/object/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PTList = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* PTList is the interface of objects stored in the object pool.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Make useable by the VM.
|
|
8
|
-
*/
|
|
9
|
-
class PTList {
|
|
10
|
-
}
|
|
11
|
-
exports.PTList = PTList;
|
|
12
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/actor/system/vm/object/list.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,MAAM;CAAuB;AAA1C,wBAA0C"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Frame } from '../frame';
|
|
2
|
-
import { Operand } from '.';
|
|
3
|
-
import { JSThread } from '../thread/shared/js';
|
|
4
|
-
/**
|
|
5
|
-
* alloc allocates resources for a new child actor.
|
|
6
|
-
*
|
|
7
|
-
* TOS must be an instance of PTTemplate or an error will be raised.
|
|
8
|
-
* The address of the new actor is pushed onto the stack.
|
|
9
|
-
*
|
|
10
|
-
* Stack:
|
|
11
|
-
* <template> -> <address>
|
|
12
|
-
*/
|
|
13
|
-
export declare const alloc: (thread: JSThread, frame: Frame, _: Operand) => Promise<void> | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* self puts the address of the current actor on to the stack.
|
|
16
|
-
* TODO: make self an automatic variable
|
|
17
|
-
*/
|
|
18
|
-
export declare const self: (_: JSThread, f: Frame, __: Operand) => void;
|
|
19
|
-
/**
|
|
20
|
-
* send a message to another actor.
|
|
21
|
-
*
|
|
22
|
-
* Stack:
|
|
23
|
-
* <message>,<address> -> <uint8>
|
|
24
|
-
*/
|
|
25
|
-
export declare const send: (r: JSThread, f: Frame, _: Operand) => Promise<void> | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* recv schedules a receiver function for the next available message.
|
|
28
|
-
*
|
|
29
|
-
* Currently only supports foreign functions.
|
|
30
|
-
* Will invoke the actor's notify() method if there are pending
|
|
31
|
-
* messages.
|
|
32
|
-
*
|
|
33
|
-
* Stack:
|
|
34
|
-
* <function> ->
|
|
35
|
-
*/
|
|
36
|
-
export declare const recv: (r: JSThread, f: Frame, _: Operand) => Promise<void> | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* recvcount pushes the total count of pending receives to the top of the stack.
|
|
39
|
-
*
|
|
40
|
-
* Stack:
|
|
41
|
-
* -> <uint32>
|
|
42
|
-
*/
|
|
43
|
-
export declare const recvcount: (_r: JSThread, _f: Frame, _: Operand) => void;
|
|
44
|
-
/**
|
|
45
|
-
* mailcount pushes the number of messages in the actor's mailbox onto the top
|
|
46
|
-
* of the stack.
|
|
47
|
-
*
|
|
48
|
-
* Stack:
|
|
49
|
-
* -> <uint32>
|
|
50
|
-
*/
|
|
51
|
-
export declare const mailcount: (r: JSThread, f: Frame, _: Operand) => void;
|
|
52
|
-
/**
|
|
53
|
-
* maildq pushes the earliest message in the mailbox (if any).
|
|
54
|
-
*
|
|
55
|
-
* Stack:
|
|
56
|
-
*
|
|
57
|
-
* -> <message>?
|
|
58
|
-
*/
|
|
59
|
-
export declare const maildq: (_: JSThread, f: Frame, __: Operand) => void;
|
|
60
|
-
/**
|
|
61
|
-
* stop an actor in the system.
|
|
62
|
-
*
|
|
63
|
-
* The actor will be removed.
|
|
64
|
-
*
|
|
65
|
-
* Stack:
|
|
66
|
-
*
|
|
67
|
-
* <address> ->
|
|
68
|
-
*/
|
|
69
|
-
export declare const stop: (r: JSThread, f: Frame, _: Operand) => Promise<void> | undefined;
|