Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ export class Module {
binaryen._BinaryenSetAlwaysInlineMaxSize(
optimizeLevel == 0 && shrinkLevel >= 0
? 2
: 4
: 9
);
binaryen._BinaryenSetFlexibleInlineMaxSize(65);
binaryen._BinaryenSetOneCallerInlineMaxSize(80);
Expand Down
23 changes: 0 additions & 23 deletions std/assembly/atomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ import { ArrayBufferView } from "./arraybuffer";
import { E_INDEXOUTOFRANGE } from "./util/error";

export namespace Atomics {

// @ts-ignore: decorator
@inline
export function load<T extends ArrayBufferView>(array: T, index: i32): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.load<valueof<T>>(
changetype<usize>(array.buffer) + (index << alignof<valueof<T>>()) + array.byteOffset
);
}

// @ts-ignore: decorator
@inline
export function store<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): void {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
atomic.store<valueof<T>>(
Expand All @@ -22,8 +17,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function add<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.add<valueof<T>>(
Expand All @@ -32,8 +25,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function sub<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.sub<valueof<T>>(
Expand All @@ -42,8 +33,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function and<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.and<valueof<T>>(
Expand All @@ -52,8 +41,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function or<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.or<valueof<T>>(
Expand All @@ -62,8 +49,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function xor<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.xor<valueof<T>>(
Expand All @@ -72,8 +57,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function exchange<T extends ArrayBufferView>(array: T, index: i32, value: valueof<T>): valueof<T> {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.xchg<valueof<T>>(
Expand All @@ -82,8 +65,6 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function compareExchange<T extends ArrayBufferView>(
array: T,
index: i32,
Expand All @@ -98,14 +79,10 @@ export namespace Atomics {
);
}

// @ts-ignore: decorator
@inline
export function wait<T extends ArrayBufferView>(array: T, value: valueof<T>, timeout: i64 = -1): AtomicWaitResult {
return atomic.wait<valueof<T>>(changetype<usize>(array.buffer) + array.byteOffset, value, timeout);
}

// @ts-ignore: decorator
@inline
export function notify<T extends ArrayBufferView>(array: T, index: i32, count: i32 = -1): i32 {
if (index < 0 || (index << alignof<valueof<T>>()) >= array.byteLength) throw new RangeError(E_INDEXOUTOFRANGE);
return atomic.notify(changetype<usize>(array.buffer) + (index << alignof<valueof<T>>()) + array.byteOffset, count);
Expand Down
4 changes: 2 additions & 2 deletions std/assembly/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

export class Date {

@inline static UTC(
static UTC(
year: i32,
month: i32 = 0,
day: i32 = 1,
Expand All @@ -17,7 +17,7 @@ export class Date {
return <i64>Date_UTC(year, month, day, hour, minute, second, <f64>millisecond);
}

@inline static now(): i64 {
static now(): i64 {
return <i64>Date_now();
}

Expand Down
2 changes: 0 additions & 2 deletions std/assembly/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const BUCKET_SIZE = sizeof<usize>();

/** Computes the alignment of an entry. */
// @ts-ignore: decorator
@inline
function ENTRY_ALIGN<K,V>(): usize {
// can align to 4 instead of 8 if 32-bit and K/V is <= 32-bits
const maxkv = sizeof<K>() > sizeof<V>() ? sizeof<K>() : sizeof<V>();
Expand All @@ -54,7 +53,6 @@ function ENTRY_ALIGN<K,V>(): usize {

/** Computes the aligned size of an entry. */
// @ts-ignore: decorator
@inline
function ENTRY_SIZE<K,V>(): usize {
const align = ENTRY_ALIGN<K,V>();
const size = (offsetof<MapEntry<K,V>>() + align) & ~align;
Expand Down
Loading