@@ -305,6 +305,8 @@ export class Compiler extends DiagnosticEmitter {
305305 runtimeFeatures : RuntimeFeatures = RuntimeFeatures . NONE ;
306306 /** Expressions known to have skipped an autorelease. Usually function returns. */
307307 skippedAutoreleases : Set < ExpressionRef > = new Set ( ) ;
308+ /** A table of signatures. */
309+ signatures : Signature [ ] = new Array < Signature > ( 0 ) ;
308310
309311 /** Compiles a {@link Program} to a {@link Module} using the specified options. */
310312 static compile ( program : Program , options : Options | null = null ) : Module {
@@ -344,7 +346,7 @@ export class Compiler extends DiagnosticEmitter {
344346 program . initialize ( options ) ;
345347
346348 // set up the main start function
347- var startFunctionInstance = program . makeNativeFunction ( "start" , new Signature ( [ ] , Type . void ) ) ;
349+ var startFunctionInstance = program . makeNativeFunction ( "start" , new Signature ( program , [ ] , Type . void , null ) ) ;
348350 startFunctionInstance . internalName = "start" ;
349351 var startFunctionBody = new Array < ExpressionRef > ( ) ;
350352 this . currentFlow = startFunctionInstance . flow ;
@@ -6367,7 +6369,7 @@ export class Compiler extends DiagnosticEmitter {
63676369 assert ( operandIndex == minOperands ) ;
63686370
63696371 // create the trampoline element
6370- var trampolineSignature = new Signature ( originalParameterTypes , returnType , thisType ) ;
6372+ var trampolineSignature = new Signature ( this . program , originalParameterTypes , returnType , thisType ) ;
63716373 trampolineSignature . requiredParameters = maxArguments ;
63726374 trampolineSignature . parameterNames = originalSignature . parameterNames ;
63736375 trampoline = new Function (
@@ -7082,7 +7084,7 @@ export class Compiler extends DiagnosticEmitter {
70827084 }
70837085 }
70847086
7085- let signature = new Signature ( parameterTypes , returnType , thisType ) ;
7087+ let signature = new Signature ( this . program , parameterTypes , returnType , thisType ) ;
70867088 signature . requiredParameters = numParameters ; // !
70877089 signature . parameterNames = parameterNames ;
70887090 instance = new Function (
@@ -7845,7 +7847,7 @@ export class Compiler extends DiagnosticEmitter {
78457847 CommonFlags . INSTANCE | CommonFlags . CONSTRUCTOR
78467848 )
78477849 ) ,
7848- new Signature ( null , classInstance . type , classInstance . type ) ,
7850+ new Signature ( this . program , null , classInstance . type , classInstance . type ) ,
78497851 null
78507852 ) ;
78517853 }
@@ -9009,6 +9011,7 @@ export class Compiler extends DiagnosticEmitter {
90099011 flow . popBreakLabel ( ) ;
90109012 return module . block ( label , conditions , NativeType . I32 ) ;
90119013 }
9014+
90129015}
90139016
90149017// helpers
0 commit comments