Inline isNaN and isFinite

Looking at our existing tests it seems that inlining these can be performed by reusing locals most of the time, and sometimes enables erasing quite a bit of unnecessary code when optimizing.
This commit is contained in:
dcodeIO
2018-07-19 04:12:40 +02:00
parent cf8e3dfa12
commit 34839353fd
9 changed files with 570 additions and 625 deletions

View File

@ -12,8 +12,8 @@
@builtin export declare function isArray<T>(value?: T): bool;
@builtin export declare function isDefined(expression: void): bool;
@builtin export declare function isConstant(expression: void): bool;
export function isNaN<T>(value: T): bool { return value != value; }
export function isFinite<T>(value: T): bool { return value - value == 0; }
@inline export function isNaN<T>(value: T): bool { return value != value; }
@inline export function isFinite<T>(value: T): bool { return value - value == 0; }
@builtin export declare function clz<T>(value: T): T;
@builtin export declare function ctz<T>(value: T): T;