some cleanup

This commit is contained in:
dcode
2019-04-01 22:23:11 +02:00
parent 7b99e44343
commit 1ada854830
74 changed files with 6072 additions and 3909 deletions

View File

@ -479,11 +479,11 @@ export namespace BuiltinSymbols {
// std/runtime.ts
export const classId = "~lib/runtime/classId";
export const iterateRoots = "~lib/runtime/iterateRoots";
export const allocate = "~lib/runtime/allocate";
export const reallocate = "~lib/runtime/reallocate";
export const register = "~lib/runtime/register";
export const discard = "~lib/runtime/discard";
export const makeArray = "~lib/runtime/makeArray";
export const runtime_allocate = "~lib/runtime/runtime.allocate";
export const runtime_reallocate = "~lib/runtime/runtime.reallocate";
export const runtime_register = "~lib/runtime/runtime.register";
export const runtime_discard = "~lib/runtime/runtime.discard";
export const runtime_makeArray = "~lib/runtime/runtime.makeArray";
// std/typedarray.ts
export const Int8Array = "~lib/typedarray/Int8Array";

View File

@ -820,7 +820,7 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.abortInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.allocate)) {
if (element = this.lookupGlobal(BuiltinSymbols.runtime_allocate)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.allocateInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
@ -828,19 +828,19 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.memoryAllocateInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.reallocate)) {
if (element = this.lookupGlobal(BuiltinSymbols.runtime_reallocate)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.reallocateInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.discard)) {
if (element = this.lookupGlobal(BuiltinSymbols.runtime_discard)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.discardInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.register)) {
if (element = this.lookupGlobal(BuiltinSymbols.runtime_register)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.registerInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(BuiltinSymbols.makeArray)) {
if (element = this.lookupGlobal(BuiltinSymbols.runtime_makeArray)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.makeArrayInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}