@@ -1048,6 +1048,7 @@ declare module "assemblyscript/src/ast" {
1048
1048
name : TypeName ;
1049
1049
/** Type argument references. */
1050
1050
typeArguments : TypeNode [ ] | null ;
1051
+ get hasTypeArguments ( ) : boolean ;
1051
1052
}
1052
1053
/** Represents a function type. */
1053
1054
export class FunctionTypeNode extends TypeNode {
@@ -2247,6 +2248,12 @@ declare module "assemblyscript/src/module" {
2247
2248
getPassArgument ( key : string ) : string | null ;
2248
2249
setPassArgument ( key : string , value : string | null ) : void ;
2249
2250
clearPassArguments ( ) : void ;
2251
+ getAlwaysInlineMaxSize ( ) : Index ;
2252
+ setAlwaysInlineMaxSize ( size : Index ) : void ;
2253
+ getFlexibleInlineMaxSize ( ) : Index ;
2254
+ setFlexibleInlineMaxSize ( size : Index ) : void ;
2255
+ getOneCallerInlineMaxSize ( ) : Index ;
2256
+ setOneCallerInlineMaxSize ( size : Index ) : void ;
2250
2257
getFeatures ( ) : FeatureFlags ;
2251
2258
setFeatures ( featureFlags : FeatureFlags ) : void ;
2252
2259
optimize ( func ?: FunctionRef ) : void ;
@@ -4062,7 +4069,7 @@ declare module "assemblyscript/src/compiler" {
4062
4069
import { DiagnosticEmitter } from "assemblyscript/src/diagnostics" ;
4063
4070
import { Module , MemorySegment , ExpressionRef , NativeType , GlobalRef } from "assemblyscript/src/module" ;
4064
4071
import { Feature , Target } from "assemblyscript/src/common" ;
4065
- import { Program , Class , Element , Enum , Field , Function , Global , Property , VariableLikeElement , File } from "assemblyscript/src/program" ;
4072
+ import { Program , ClassPrototype , Class , Element , Enum , Field , Function , Global , Property , VariableLikeElement , File } from "assemblyscript/src/program" ;
4066
4073
import { Flow } from "assemblyscript/src/flow" ;
4067
4074
import { Resolver } from "assemblyscript/src/resolver" ;
4068
4075
import { Node , Range , Statement , Expression } from "assemblyscript/src/ast" ;
@@ -4191,6 +4198,8 @@ declare module "assemblyscript/src/compiler" {
4191
4198
inlineStack : Function [ ] ;
4192
4199
/** Lazily compiled library functions. */
4193
4200
lazyLibraryFunctions : Set < Function > ;
4201
+ /** Pending class-specific instanceof helpers. */
4202
+ pendingClassInstanceOf : Set < ClassPrototype > ;
4194
4203
/** Compiles a {@link Program} to a {@link Module} using the specified options. */
4195
4204
static compile ( program : Program ) : Module ;
4196
4205
/** Constructs a new compiler for a {@link Program} using the specified options. */
@@ -4349,10 +4358,10 @@ declare module "assemblyscript/src/compiler" {
4349
4358
makeRelease ( expr : ExpressionRef ) : ExpressionRef ;
4350
4359
/** Makes a replace, retaining the new expression's value and releasing the old expression's value, in this order. */
4351
4360
makeReplace (
4352
- /** Old value being replaced. */
4353
- oldExpr : ExpressionRef ,
4354
4361
/** New value being assigned. */
4355
4362
newExpr : ExpressionRef ,
4363
+ /** Old value being replaced. */
4364
+ oldExpr : ExpressionRef ,
4356
4365
/** Whether the new value is already retained. */
4357
4366
alreadyRetained ?: boolean ) : ExpressionRef ;
4358
4367
/** Makes an autorelease call at the end of the specified `flow`. */
@@ -4429,6 +4438,8 @@ declare module "assemblyscript/src/compiler" {
4429
4438
private maybeCompileEnclosingSource ;
4430
4439
private compileIdentifierExpression ;
4431
4440
private compileInstanceOfExpression ;
4441
+ private makeInstanceofType ;
4442
+ private makeInstanceofClass ;
4432
4443
private compileLiteralExpression ;
4433
4444
private compileStringLiteral ;
4434
4445
private compileArrayLiteral ;
@@ -4505,7 +4516,7 @@ declare module "assemblyscript/src/builtins" {
4505
4516
import { Expression , CallExpression } from "assemblyscript/src/ast" ;
4506
4517
import { Type } from "assemblyscript/src/types" ;
4507
4518
import { ExpressionRef } from "assemblyscript/src/module" ;
4508
- import { FunctionPrototype } from "assemblyscript/src/program" ;
4519
+ import { FunctionPrototype , ClassPrototype } from "assemblyscript/src/program" ;
4509
4520
/** Internal names of various compiler built-ins. */
4510
4521
export namespace BuiltinNames {
4511
4522
const start = "~start" ;
@@ -4971,6 +4982,8 @@ declare module "assemblyscript/src/builtins" {
4971
4982
export function compileVisitMembers ( compiler : Compiler ) : void ;
4972
4983
/** Compiles runtime type information for use by stdlib. */
4973
4984
export function compileRTTI ( compiler : Compiler ) : void ;
4985
+ /** Compiles a class-specific instanceof helper, checking a ref against all concrete instances. */
4986
+ export function compileClassInstanceOf ( compiler : Compiler , prototype : ClassPrototype ) : void ;
4974
4987
}
4975
4988
declare module "assemblyscript/src/definitions" {
4976
4989
/**
0 commit comments