aliased makeCallInline, unmanaged rt alloc

This commit is contained in:
dcode
2019-03-19 14:40:37 +01:00
parent d42ef51cf0
commit 74789c9c1e
51 changed files with 1992 additions and 1655 deletions

View File

@ -354,6 +354,8 @@ export class Program extends DiagnosticEmitter {
abortInstance: Function | null = null;
/** Runtime allocation function. */
allocateInstance: Function | null = null;
/** Unmanaged allocation function. */
allocateUnmanagedInstance: Function | null = null;
/** Runtime reallocation function. */
reallocateInstance: Function | null = null;
/** Runtime discard function. */
@ -804,6 +806,10 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.allocateInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(LibrarySymbols.ALLOCATE_UNMANAGED)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.allocateUnmanagedInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
if (element = this.lookupGlobal(LibrarySymbols.REALLOCATE)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.reallocateInstance = this.resolver.resolveFunction(<FunctionPrototype>element, null);