@@ -56,18 +56,20 @@ declare module "assemblyscript/src/common" {
56
56
RESOLVED = 2097152 ,
57
57
/** Is compiled. */
58
58
COMPILED = 4194304 ,
59
+ /** Did error. */
60
+ ERRORED = 8388608 ,
59
61
/** Has a constant value and is therefore inlined. */
60
- INLINED = 8388608 ,
62
+ INLINED = 16777216 ,
61
63
/** Is scoped. */
62
- SCOPED = 16777216 ,
64
+ SCOPED = 33554432 ,
63
65
/** Is a stub. */
64
- STUB = 33554432 ,
66
+ STUB = 67108864 ,
65
67
/** Is a virtual method. */
66
- VIRTUAL = 67108864 ,
68
+ VIRTUAL = 134217728 ,
67
69
/** Is (part of) a closure. */
68
- CLOSURE = 134217728 ,
70
+ CLOSURE = 268435456 ,
69
71
/** Is quoted. */
70
- QUOTED = 268435456
72
+ QUOTED = 536870912
71
73
}
72
74
/** Path delimiter inserted between file system levels. */
73
75
export const PATH_DELIMITER = "/" ;
@@ -358,6 +360,7 @@ declare module "assemblyscript/src/diagnosticMessages.generated" {
358
360
A_class_can_only_implement_an_interface = 2422 ,
359
361
A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged = 2434 ,
360
362
Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses = 2445 ,
363
+ Variable_0_used_before_its_declaration = 2448 ,
361
364
The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly = 2453 ,
362
365
Type_0_has_no_property_1 = 2460 ,
363
366
The_0_operator_cannot_be_applied_to_type_1 = 2469 ,
@@ -2381,17 +2384,16 @@ declare module "assemblyscript/src/module" {
2381
2384
DataDrop = 35 ,
2382
2385
MemoryCopy = 36 ,
2383
2386
MemoryFill = 37 ,
2384
- Push = 38 ,
2385
- Pop = 39 ,
2386
- RefNull = 40 ,
2387
- RefIsNull = 41 ,
2388
- RefFunc = 42 ,
2389
- Try = 43 ,
2390
- Throw = 44 ,
2391
- Rethrow = 45 ,
2392
- BrOnExn = 46 ,
2393
- TupleMake = 47 ,
2394
- TupleExtract = 48
2387
+ Pop = 38 ,
2388
+ RefNull = 39 ,
2389
+ RefIsNull = 40 ,
2390
+ RefFunc = 41 ,
2391
+ Try = 42 ,
2392
+ Throw = 43 ,
2393
+ Rethrow = 44 ,
2394
+ BrOnExn = 45 ,
2395
+ TupleMake = 46 ,
2396
+ TupleExtract = 47
2395
2397
}
2396
2398
export enum UnaryOp {
2397
2399
ClzI32 = 0 ,
@@ -2482,25 +2484,33 @@ declare module "assemblyscript/src/module" {
2482
2484
AbsF32x4 = 85 ,
2483
2485
NegF32x4 = 86 ,
2484
2486
SqrtF32x4 = 87 ,
2485
- AbsF64x2 = 88 ,
2486
- NegF64x2 = 89 ,
2487
- SqrtF64x2 = 90 ,
2488
- TruncSatF32x4ToI32x4 = 91 ,
2489
- TruncSatF32x4ToU32x4 = 92 ,
2490
- TruncSatF64x2ToI64x2 = 93 ,
2491
- TruncSatF64x2ToU64x2 = 94 ,
2492
- ConvertI32x4ToF32x4 = 95 ,
2493
- ConvertU32x4ToF32x4 = 96 ,
2494
- ConvertI64x2ToF64x2 = 97 ,
2495
- ConvertU64x2ToF64x2 = 98 ,
2496
- WidenLowI8x16ToI16x8 = 99 ,
2497
- WidenHighI8x16ToI16x8 = 100 ,
2498
- WidenLowU8x16ToU16x8 = 101 ,
2499
- WidenHighU8x16ToU16x8 = 102 ,
2500
- WidenLowI16x8ToI32x4 = 103 ,
2501
- WidenHighI16x8ToI32x4 = 104 ,
2502
- WidenLowU16x8ToU32x4 = 105 ,
2503
- WidenHighU16x8ToU32x4 = 106
2487
+ CeilF32x4 = 88 ,
2488
+ FloorF32x4 = 89 ,
2489
+ TruncF32x4 = 90 ,
2490
+ NearestF32x4 = 91 ,
2491
+ AbsF64x2 = 92 ,
2492
+ NegF64x2 = 93 ,
2493
+ SqrtF64x2 = 94 ,
2494
+ CeilF64x2 = 95 ,
2495
+ FloorF64x2 = 96 ,
2496
+ TruncF64x2 = 97 ,
2497
+ NearestF64x2 = 98 ,
2498
+ TruncSatF32x4ToI32x4 = 99 ,
2499
+ TruncSatF32x4ToU32x4 = 100 ,
2500
+ TruncSatF64x2ToI64x2 = 101 ,
2501
+ TruncSatF64x2ToU64x2 = 102 ,
2502
+ ConvertI32x4ToF32x4 = 103 ,
2503
+ ConvertU32x4ToF32x4 = 104 ,
2504
+ ConvertI64x2ToF64x2 = 105 ,
2505
+ ConvertU64x2ToF64x2 = 106 ,
2506
+ WidenLowI8x16ToI16x8 = 107 ,
2507
+ WidenHighI8x16ToI16x8 = 108 ,
2508
+ WidenLowU8x16ToU16x8 = 109 ,
2509
+ WidenHighU8x16ToU16x8 = 110 ,
2510
+ WidenLowI16x8ToI32x4 = 111 ,
2511
+ WidenHighI16x8ToI32x4 = 112 ,
2512
+ WidenLowU16x8ToU32x4 = 113 ,
2513
+ WidenHighU16x8ToU32x4 = 114
2504
2514
}
2505
2515
export enum BinaryOp {
2506
2516
AddI32 = 0 ,
@@ -2659,27 +2669,27 @@ declare module "assemblyscript/src/module" {
2659
2669
DotI16x8 = 153 ,
2660
2670
AddI64x2 = 154 ,
2661
2671
SubI64x2 = 155 ,
2662
- AddF32x4 = 156 ,
2663
- SubF32x4 = 157 ,
2664
- MulF32x4 = 158 ,
2665
- DivF32x4 = 159 ,
2666
- MinF32x4 = 160 ,
2667
- MaxF32x4 = 161 ,
2668
- PminF32x4 = 162 ,
2669
- PmaxF32x4 = 163 ,
2670
- AddF64x2 = 164 ,
2671
- SubF64x2 = 165 ,
2672
- MulF64x2 = 166 ,
2673
- DivF64x2 = 167 ,
2674
- MinF64x2 = 168 ,
2675
- MaxF64x2 = 169 ,
2676
- PminF64x2 = 170 ,
2677
- PmaxF64x2 = 171 ,
2678
- NarrowI16x8ToI8x16 = 172 ,
2679
- NarrowU16x8ToU8x16 = 173 ,
2680
- NarrowI32x4ToI16x8 = 174 ,
2681
- NarrowU32x4ToU16x8 = 175 ,
2682
- SwizzleV8x16 = 176
2672
+ AddF32x4 = 157 ,
2673
+ SubF32x4 = 158 ,
2674
+ MulF32x4 = 159 ,
2675
+ DivF32x4 = 160 ,
2676
+ MinF32x4 = 161 ,
2677
+ MaxF32x4 = 162 ,
2678
+ PminF32x4 = 163 ,
2679
+ PmaxF32x4 = 164 ,
2680
+ AddF64x2 = 165 ,
2681
+ SubF64x2 = 166 ,
2682
+ MulF64x2 = 167 ,
2683
+ DivF64x2 = 168 ,
2684
+ MinF64x2 = 169 ,
2685
+ MaxF64x2 = 170 ,
2686
+ PminF64x2 = 171 ,
2687
+ PmaxF64x2 = 172 ,
2688
+ NarrowI16x8ToI8x16 = 173 ,
2689
+ NarrowU16x8ToU8x16 = 174 ,
2690
+ NarrowI32x4ToI16x8 = 175 ,
2691
+ NarrowU32x4ToU16x8 = 176 ,
2692
+ SwizzleV8x16 = 177
2683
2693
}
2684
2694
export enum HostOp {
2685
2695
MemorySize = 0 ,
@@ -2815,8 +2825,9 @@ declare module "assemblyscript/src/module" {
2815
2825
throw ( eventName : string , operands : ExpressionRef [ ] ) : ExpressionRef ;
2816
2826
rethrow ( exnref : ExpressionRef ) : ExpressionRef ;
2817
2827
br_on_exn ( name : string , eventName : string , exnref : ExpressionRef ) : ExpressionRef ;
2818
- push ( value : ExpressionRef ) : ExpressionRef ;
2819
2828
pop ( type : NativeType ) : ExpressionRef ;
2829
+ tuple_make ( operands : ExpressionRef [ ] ) : ExpressionRef ;
2830
+ tuple_extract ( tuple : ExpressionRef , index : Index ) : ExpressionRef ;
2820
2831
simd_extract ( op : SIMDExtractOp , vec : ExpressionRef , idx : number ) : ExpressionRef ;
2821
2832
simd_replace ( op : SIMDReplaceOp , vec : ExpressionRef , idx : number , value : ExpressionRef ) : ExpressionRef ;
2822
2833
simd_shuffle ( vec1 : ExpressionRef , vec2 : ExpressionRef , mask : Uint8Array ) : ExpressionRef ;
@@ -2825,8 +2836,6 @@ declare module "assemblyscript/src/module" {
2825
2836
simd_load ( op : SIMDLoadOp , ptr : ExpressionRef , offset : number , align : number ) : ExpressionRef ;
2826
2837
ref_is_null ( expr : ExpressionRef ) : ExpressionRef ;
2827
2838
ref_func ( name : string ) : ExpressionRef ;
2828
- tuple_make ( operands : ExpressionRef [ ] ) : ExpressionRef ;
2829
- tuple_extract ( tuple : ExpressionRef , index : Index ) : ExpressionRef ;
2830
2839
addGlobal ( name : string , type : NativeType , mutable : boolean , initializer : ExpressionRef ) : GlobalRef ;
2831
2840
getGlobal ( name : string ) : GlobalRef ;
2832
2841
removeGlobal ( name : string ) : void ;
@@ -3005,7 +3014,8 @@ declare module "assemblyscript/src/module" {
3005
3014
ImplicitTrap = 256 ,
3006
3015
IsAtomic = 512 ,
3007
3016
Throws = 1024 ,
3008
- Any = 2047
3017
+ DanglingPop = 2048 ,
3018
+ Any = 4095
3009
3019
}
3010
3020
export function getSideEffects ( expr : ExpressionRef , features ?: FeatureFlags ) : SideEffects ;
3011
3021
export function hasSideEffects ( expr : ExpressionRef , features ?: FeatureFlags ) : boolean ;
@@ -3382,10 +3392,14 @@ declare module "assemblyscript/src/flow" {
3382
3392
getScopedLocal ( name : string ) : Local | null ;
3383
3393
/** Adds a new scoped local of the specified name. */
3384
3394
addScopedLocal ( name : string , type : Type , except ?: Set < number > | null ) : Local ;
3395
+ /** Adds a new scoped dummy local of the specified name. */
3396
+ addScopedDummyLocal ( name : string , type : Type ) : Local ;
3385
3397
/** Adds a new scoped alias for the specified local. For example `super` aliased to the `this` local. */
3386
3398
addScopedAlias ( name : string , type : Type , index : number , reportNode ?: Node | null ) : Local ;
3387
3399
/** Tests if this flow has any scoped locals that must be free'd. */
3388
3400
get hasScopedLocals ( ) : boolean ;
3401
+ /** Frees a single scoped local by its name. */
3402
+ freeScopedDummyLocal ( name : string ) : void ;
3389
3403
/** Frees this flow's scoped variables and returns its parent flow. */
3390
3404
freeScopedLocals ( ) : void ;
3391
3405
/** Looks up the local of the specified name in the current scope. */
@@ -4499,6 +4513,8 @@ declare module "assemblyscript/src/program" {
4499
4513
export class Local extends VariableLikeElement {
4500
4514
/** Zero-based index within the enclosing function. `-1` indicates a virtual local. */
4501
4515
index : number ;
4516
+ /** Original name of the (temporary) local. */
4517
+ private originalName ;
4502
4518
/** Constructs a new local variable. */
4503
4519
constructor (
4504
4520
/** Simple name. */
@@ -4511,6 +4527,10 @@ declare module "assemblyscript/src/program" {
4511
4527
parent : Function ,
4512
4528
/** Declaration reference. */
4513
4529
declaration ?: VariableLikeDeclarationStatement ) ;
4530
+ /** Sets the temporary name of this local. */
4531
+ setTemporaryName ( name : string ) : void ;
4532
+ /** Resets the temporary name of this local. */
4533
+ resetTemporaryName ( ) : void ;
4514
4534
}
4515
4535
/** A yet unresolved function prototype. */
4516
4536
export class FunctionPrototype extends DeclaredElement {
@@ -5009,6 +5029,8 @@ declare module "assemblyscript/src/compiler" {
5009
5029
pendingClassInstanceOf : Set < ClassPrototype > ;
5010
5030
/** Functions potentially involving a virtual call. */
5011
5031
virtualCalls : Set < Function > ;
5032
+ /** Elements currently undergoing compilation. */
5033
+ pendingElements : Set < Element > ;
5012
5034
/** Compiles a {@link Program} to a {@link Module} using the specified options. */
5013
5035
static compile ( program : Program ) : Module ;
5014
5036
/** Constructs a new compiler for a {@link Program} using the specified options. */
@@ -5596,6 +5618,10 @@ declare module "assemblyscript/src/builtins" {
5596
5618
const v128_avgr = "~lib/builtins/v128.avgr" ;
5597
5619
const v128_abs = "~lib/builtins/v128.abs" ;
5598
5620
const v128_sqrt = "~lib/builtins/v128.sqrt" ;
5621
+ const v128_ceil = "~lib/builtins/v128.ceil" ;
5622
+ const v128_floor = "~lib/builtins/v128.floor" ;
5623
+ const v128_trunc = "~lib/builtins/v128.trunc" ;
5624
+ const v128_nearest = "~lib/builtins/v128.nearest" ;
5599
5625
const v128_eq = "~lib/builtins/v128.eq" ;
5600
5626
const v128_ne = "~lib/builtins/v128.ne" ;
5601
5627
const v128_lt = "~lib/builtins/v128.lt" ;
@@ -5759,6 +5785,10 @@ declare module "assemblyscript/src/builtins" {
5759
5785
const f32x4_pmax = "~lib/builtins/f32x4.pmax" ;
5760
5786
const f32x4_abs = "~lib/builtins/f32x4.abs" ;
5761
5787
const f32x4_sqrt = "~lib/builtins/f32x4.sqrt" ;
5788
+ const f32x4_ceil = "~lib/builtins/f32x4.ceil" ;
5789
+ const f32x4_floor = "~lib/builtins/f32x4.floor" ;
5790
+ const f32x4_trunc = "~lib/builtins/f32x4.trunc" ;
5791
+ const f32x4_nearest = "~lib/builtins/f32x4.nearest" ;
5762
5792
const f32x4_eq = "~lib/builtins/f32x4.eq" ;
5763
5793
const f32x4_ne = "~lib/builtins/f32x4.ne" ;
5764
5794
const f32x4_lt = "~lib/builtins/f32x4.lt" ;
@@ -5783,6 +5813,10 @@ declare module "assemblyscript/src/builtins" {
5783
5813
const f64x2_pmax = "~lib/builtins/f64x2.pmax" ;
5784
5814
const f64x2_abs = "~lib/builtins/f64x2.abs" ;
5785
5815
const f64x2_sqrt = "~lib/builtins/f64x2.sqrt" ;
5816
+ const f64x2_ceil = "~lib/builtins/f64x2.ceil" ;
5817
+ const f64x2_floor = "~lib/builtins/f64x2.floor" ;
5818
+ const f64x2_trunc = "~lib/builtins/f64x2.trunc" ;
5819
+ const f64x2_nearest = "~lib/builtins/f64x2.nearest" ;
5786
5820
const f64x2_eq = "~lib/builtins/f64x2.eq" ;
5787
5821
const f64x2_ne = "~lib/builtins/f64x2.ne" ;
5788
5822
const f64x2_lt = "~lib/builtins/f64x2.lt" ;
0 commit comments