@@ -164,7 +164,7 @@ declare module "assemblyscript/src/common" {
164
164
const Anyref = "Anyref" ;
165
165
const String = "String" ;
166
166
const Array = "Array" ;
167
- const FixedArray = "FixedArray " ;
167
+ const StaticArray = "StaticArray " ;
168
168
const Set = "Set" ;
169
169
const Map = "Map" ;
170
170
const ArrayBufferView = "ArrayBufferView" ;
@@ -195,6 +195,7 @@ declare module "assemblyscript/src/common" {
195
195
const typeinfo = "__typeinfo" ;
196
196
const instanceof_ = "__instanceof" ;
197
197
const visit = "__visit" ;
198
+ const allocBuffer = "__allocBuffer" ;
198
199
const allocArray = "__allocArray" ;
199
200
}
200
201
export { Feature , featureToString } from "assemblyscript/std/assembly/shared/feature" ;
@@ -1013,7 +1014,7 @@ declare module "assemblyscript/src/ast" {
1013
1014
static createFieldDeclaration ( name : IdentifierExpression , type : TypeNode | null , initializer : Expression | null , decorators : DecoratorNode [ ] | null , flags : CommonFlags , range : Range ) : FieldDeclaration ;
1014
1015
static createForStatement ( initializer : Statement | null , condition : Expression | null , incrementor : Expression | null , statement : Statement , range : Range ) : ForStatement ;
1015
1016
static createFunctionDeclaration ( name : IdentifierExpression , typeParameters : TypeParameterNode [ ] | null , signature : FunctionTypeNode , body : Statement | null , decorators : DecoratorNode [ ] | null , flags : CommonFlags , arrowKind : ArrowKind , range : Range ) : FunctionDeclaration ;
1016
- static createIndexSignatureDeclaration ( keyType : NamedTypeNode , valueType : TypeNode , range : Range ) : IndexSignatureDeclaration ;
1017
+ static createIndexSignatureDeclaration ( keyType : NamedTypeNode , valueType : TypeNode , flags : CommonFlags , range : Range ) : IndexSignatureDeclaration ;
1017
1018
static createMethodDeclaration ( name : IdentifierExpression , typeParameters : TypeParameterNode [ ] | null , signature : FunctionTypeNode , body : Statement | null , decorators : DecoratorNode [ ] | null , flags : CommonFlags , range : Range ) : MethodDeclaration ;
1018
1019
static createNamespaceDeclaration ( name : IdentifierExpression , members : Statement [ ] , decorators : DecoratorNode [ ] | null , flags : CommonFlags , range : Range ) : NamespaceDeclaration ;
1019
1020
static createReturnStatement ( value : Expression | null , range : Range ) : ReturnStatement ;
@@ -1186,7 +1187,8 @@ declare module "assemblyscript/src/ast" {
1186
1187
export enum AssertionKind {
1187
1188
PREFIX = 0 ,
1188
1189
AS = 1 ,
1189
- NONNULL = 2
1190
+ NONNULL = 2 ,
1191
+ CONST = 3
1190
1192
}
1191
1193
/** Represents an assertion expression. */
1192
1194
export class AssertionExpression extends Expression {
@@ -3071,7 +3073,7 @@ declare module "assemblyscript/src/parser" {
3071
3073
parseClassOrInterface ( tn : Tokenizer , flags : CommonFlags , decorators : DecoratorNode [ ] | null , startPos : number ) : ClassDeclaration | null ;
3072
3074
parseClassExpression ( tn : Tokenizer ) : ClassExpression | null ;
3073
3075
parseClassMember ( tn : Tokenizer , parent : ClassDeclaration ) : DeclarationStatement | null ;
3074
- parseIndexSignatureDeclaration ( tn : Tokenizer , decorators : DecoratorNode [ ] | null ) : IndexSignatureDeclaration | null ;
3076
+ parseIndexSignatureDeclaration ( tn : Tokenizer , flags : CommonFlags , decorators : DecoratorNode [ ] | null ) : IndexSignatureDeclaration | null ;
3075
3077
parseNamespace ( tn : Tokenizer , flags : CommonFlags , decorators : DecoratorNode [ ] | null , startPos : number ) : NamespaceDeclaration | null ;
3076
3078
parseExport ( tn : Tokenizer , startPos : number , isDeclare : boolean ) : ExportStatement | null ;
3077
3079
parseExportMember ( tn : Tokenizer ) : ExportMember | null ;
@@ -3225,12 +3227,12 @@ declare module "assemblyscript/src/program" {
3225
3227
arrayBufferInstance : Class ;
3226
3228
/** Array prototype reference. */
3227
3229
arrayPrototype : ClassPrototype ;
3230
+ /** Static array prototype reference. */
3231
+ staticArrayPrototype : ClassPrototype ;
3228
3232
/** Set prototype reference. */
3229
3233
setPrototype : ClassPrototype ;
3230
3234
/** Map prototype reference. */
3231
3235
mapPrototype : ClassPrototype ;
3232
- /** Fixed array prototype reference. */
3233
- fixedArrayPrototype : ClassPrototype ;
3234
3236
/** Int8Array prototype. */
3235
3237
i8ArrayPrototype : ClassPrototype ;
3236
3238
/** Int16Array prototype. */
@@ -3275,6 +3277,8 @@ declare module "assemblyscript/src/program" {
3275
3277
typeinfoInstance : Function ;
3276
3278
/** RT `__instanceof(ptr: usize, superId: u32): bool` */
3277
3279
instanceofInstance : Function ;
3280
+ /** RT `__allocBuffer(size: usize, id: u32, data: usize = 0): usize` */
3281
+ allocBufferInstance : Function ;
3278
3282
/** RT `__allocArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize` */
3279
3283
allocArrayInstance : Function ;
3280
3284
/** Next class id. */
@@ -3290,7 +3294,7 @@ declare module "assemblyscript/src/program" {
3290
3294
/** Obtains the source matching the specified internal path. */
3291
3295
getSource ( internalPath : string ) : string | null ;
3292
3296
/** Writes a common runtime header to the specified buffer. */
3293
- writeRuntimeHeader ( buffer : Uint8Array , offset : number , classInstance : Class , payloadSize : number ) : void ;
3297
+ writeRuntimeHeader ( buffer : Uint8Array , offset : number , id : number , payloadSize : number ) : void ;
3294
3298
/** Gets the size of a runtime header. */
3295
3299
get runtimeHeaderSize ( ) : number ;
3296
3300
/** Creates a native variable declaration. */
@@ -4248,7 +4252,7 @@ declare module "assemblyscript/src/compiler" {
4248
4252
/** Ensures that a string exists in static memory and returns a pointer to it. Deduplicates. */
4249
4253
ensureStaticString ( stringValue : string ) : ExpressionRef ;
4250
4254
/** Adds a buffer to static memory and returns the created segment. */
4251
- private addStaticBuffer ;
4255
+ addStaticBuffer ( elementType : Type , values : ExpressionRef [ ] , id ?: number ) : MemorySegment ;
4252
4256
/** Adds an array header to static memory and returns the created segment. */
4253
4257
private addStaticArrayHeader ;
4254
4258
/** Ensures that a table entry exists for the specified function and returns its index. */
@@ -4443,6 +4447,8 @@ declare module "assemblyscript/src/compiler" {
4443
4447
private compileLiteralExpression ;
4444
4448
private compileStringLiteral ;
4445
4449
private compileArrayLiteral ;
4450
+ /** Compiles a special `fixed` array literal. */
4451
+ private compileStaticArrayLiteral ;
4446
4452
private compileObjectLiteral ;
4447
4453
private compileNewExpression ;
4448
4454
/** Gets the compiled constructor of the specified class or generates one if none is present. */
0 commit comments