FixedArray experimentation

This commit is contained in:
dcode
2019-03-19 15:43:05 +01:00
parent 74789c9c1e
commit 81039c4167
31 changed files with 762 additions and 855 deletions

View File

@ -348,6 +348,8 @@ export class Program extends DiagnosticEmitter {
arrayBufferInstance: Class | null = null;
/** Array prototype reference. */
arrayPrototype: ClassPrototype | null = null;
/** Fixed array prototype reference. */
fixedArrayPrototype: ClassPrototype | null = null;
/** String instance reference. */
stringInstance: Class | null = null;
/** Abort function reference, if present. */
@ -798,6 +800,10 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.CLASS_PROTOTYPE);
this.arrayPrototype = <ClassPrototype>element;
}
if (element = this.lookupGlobal(LibrarySymbols.FixedArray)) {
assert(element.kind == ElementKind.CLASS_PROTOTYPE);
this.fixedArrayPrototype = <ClassPrototype>element;
}
if (element = this.lookupGlobal(LibrarySymbols.abort)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.abortInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);