Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
118349f
Handle RunClassConstructor with nonreflectable cctor (#62947)
MichalStrehovsky Dec 18, 2021
3b2a700
Allow building libs against NativeAOT CoreLib (#62945)
MichalStrehovsky Dec 18, 2021
2abbe5b
Suppress OSR for crossgen2 execution (#62968)
AndyAyersMS Dec 18, 2021
a73d44f
[wasm] Testing with NodeJs on CI (#62779)
pavelsavara Dec 18, 2021
3424923
Add 'w' and 's' bit to xarch instruction flags. (#61198)
anthonycanino Dec 18, 2021
7213976
Have NativeAOT test execution project include SDK (#62927)
MichalStrehovsky Dec 18, 2021
eca7c43
Remove small casts on the RHS of ASG(CLS_VAR) (#62693)
SingleAccretion Dec 19, 2021
a891aed
Implement isMoffset for emitOutputAM (#62896)
SingleAccretion Dec 19, 2021
cbebb29
Fix managed CoreCLR build on Android (#63002)
MichalStrehovsky Dec 20, 2021
834b278
[main] Update dependencies from dotnet/arcade (#62985)
dotnet-maestro[bot] Dec 20, 2021
358cdf9
Improve XML documentation (#62994)
bjornen77 Dec 20, 2021
8cdf339
[main] Update dependencies from dotnet/linker (#62771)
dotnet-maestro[bot] Dec 20, 2021
3251f00
WinHttp: always read HTTP/2 streams to the end (#62870)
antonfirsov Dec 20, 2021
8619a63
fix race condition in System.IO.Packaging (#63013)
themcoo Dec 20, 2021
89857ea
[main] Update dependencies from dotnet/runtime (#63010)
dotnet-maestro[bot] Dec 20, 2021
192db36
Fixed typo in remarks section of OnCompleted (#62982)
slask Dec 20, 2021
9ddd58a
Various WASM AOT changes (#62997)
vargaz Dec 20, 2021
13924ac
Fix HAVE_PTHREAD_CONDATTR_SETCLOCK detection on Android (#62978)
MichalStrehovsky Dec 21, 2021
72bee25
Update ObjWriter package (#63035)
MichalStrehovsky Dec 21, 2021
13f938f
More static in System.ComponentModel.TypeConverter (#63017)
marek-safar Dec 21, 2021
1c09d36
[wasm][debugger] Run getter using Runtime.GetProperties (#62857)
thaystg Dec 21, 2021
6a9bfee
Expose AppContext.SetData in ref assembly (#62996)
deeprobin Dec 21, 2021
64649da
[wasm] updated samples for ES6 and CJS (#62292)
pavelsavara Dec 21, 2021
9a50493
Handle parameterless ctors in structs in STJ's ReflectionEmitMemberAc…
EgorBo Dec 21, 2021
2939f4b
[main] Update dependencies from 5 repositories (#63043)
dotnet-maestro[bot] Dec 22, 2021
6f2fa80
[wasm] Tweak set timeout (#62898)
maraf Dec 22, 2021
61c69c5
[wasm] fix sample make files & RunScript bash lowercase problem (#63062)
pavelsavara Dec 22, 2021
b25fb5b
[main] Update dependencies from dotnet/arcade dotnet/xharness (#63069)
dotnet-maestro[bot] Dec 22, 2021
2a48729
[tests] Cleanup copy/pasted assembly update test projects (#62970)
lambdageek Dec 22, 2021
b816643
disable failing HTTP3 interop test (#63055)
geoffkizer Dec 22, 2021
6047b3c
Override same attributes found at class and property level in Applica…
buyaa-n Dec 22, 2021
c3dd830
Delete some dead code (#63087)
am11 Dec 23, 2021
07af5b3
Remove unnecessary assignment of a value to local variables in SPC (#…
marek-safar Dec 23, 2021
397ae49
[mono][interp] Remove null check during initblk/cpblk with size 0 (#6…
BrzVlad Dec 23, 2021
8f80eed
[main] Update dependencies from dotnet/linker (#63044)
dotnet-maestro[bot] Dec 23, 2021
d2ebffc
Reduce size of HttpHeaderValueCollection (#63057)
geoffkizer Dec 23, 2021
1d12267
Fix setting the configuration parameter in the apple test runner (#63…
MaximLipnin Dec 24, 2021
0b17270
Update the apple testing doc (#63119)
MaximLipnin Dec 24, 2021
84680bf
Use System.Runtime.InteropServices.EnableConsumingManagedCodeFromNati…
marek-safar Dec 25, 2021
71192ea
Delete unused libs.native shims (#63132)
am11 Dec 25, 2021
4c83c3b
Fix libs.tests subset build on tizen arm64 (#63128)
am11 Dec 25, 2021
a95cc4d
Parse compiler version in init-compiler.sh (#63126)
am11 Dec 26, 2021
1c92746
Delete NativeAOT-specific CoreLib string resources (#63129)
jkotas Dec 26, 2021
7ab969c
NativeAOT: Do not run Vector version of Hardware Intrinsics when AVX2…
kant2002 Dec 27, 2021
46f5b99
[mono] Fix a regression caused by 9ddd58a58d14a7bec5ed6eb777c6703c48a…
vargaz Dec 27, 2021
00c1692
Move System.Runtime.InteropServices.RuntimeInformation to CoreLib (#6…
jkotas Dec 27, 2021
10e0ae7
Fixup some formatting in shared code (#63156)
pranavkm Dec 27, 2021
d094a34
Improve auto-formatting of ref/System.Runtime (#63139)
jkotas Dec 28, 2021
bdc6ad7
Deduplicate JIT/Methodical/tailcall tests and make them mergeable (#6…
trylek Dec 28, 2021
acde546
Use SIMD operations in InitBlkUnroll/CopyBlkUnroll and increase unrol…
echesakov Dec 28, 2021
eff08ef
Use shared strings for Array:Copy exception messages (#63163)
marek-safar Dec 28, 2021
2058f01
Unify build mode for one previously missed form _opt_dbg / _opt_rel (…
trylek Dec 28, 2021
15e95fc
Remove unneeded ifdefs (#63160)
BruceForstall Dec 28, 2021
25c675f
Fix _il suffix for _d/_r-variant ilproj tests (#63178)
trylek Dec 29, 2021
e731299
[mono] Use Xcode path from xcode-select instead of hardcoding (#63076)
akoeplinger Dec 29, 2021
e4e4cb6
Cleanup in NativeAOT from x86 attempt (#63182)
kant2002 Dec 30, 2021
af9202a
Fix NativeAOT multifile test run (#63183)
MichalStrehovsky Dec 30, 2021
4b6c7ed
Allow using ILCompiler without an IlcPath (#63211)
MichalStrehovsky Dec 30, 2021
077b3c6
Define MCREGs for ARM64 macOS (#63209)
MichalStrehovsky Dec 30, 2021
56c4eec
Fix typos in comments (#63220)
mganss Dec 30, 2021
92c55cd
Fix regex test OOM (#63092)
danmoseley Dec 30, 2021
d0631be
Fix ILVerify.ILVerifyTypeSystemContext.VerifyModuleName throws NullRe…
masonwheeler Dec 30, 2021
5699043
Rename test suppressions (#63210)
MichalStrehovsky Dec 30, 2021
7cc57dd
Allow managed type system tests on Alpine (#63207)
MichalStrehovsky Dec 30, 2021
a8e198c
Add ILLink.Shared project to Native AOT (#63230)
tlakollo Dec 31, 2021
07ed923
Switch to objwriter from the dotnet/llvm-project repo (#63177)
MichalStrehovsky Dec 31, 2021
58663f7
Speed up crossgen2 by a couple percent (#63234)
MichalStrehovsky Dec 31, 2021
58495a3
avoid ArgumentOutOfRangeException while processing invalid or incompl…
wfurt Dec 31, 2021
a78ad5e
Bring over ILCompiler.Compiler unit tests (#63232)
MichalStrehovsky Dec 31, 2021
260a306
Improve SuperPMI error message for JIT asserts (#63229)
BruceForstall Dec 31, 2021
dd298bb
Merge with main from upstream
Jan 1, 2022
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
Prev Previous commit
Next Next commit
[wasm] Tweak set timeout (dotnet#62898)
- Cache method lookup for TimerQueue.TimeoutCallback and ThreadPool.Callback.
- Remove unused parameter "id" from timer related functions.
  • Loading branch information
maraf authored Dec 22, 2021
commit 6f2fa8013dcbb03dcaf15a93cf26d7bca626a3fa
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ private TimerQueue(int id)
}

[DynamicDependency("TimeoutCallback")]
// The id argument is unused in netcore
// This replaces the current pending setTimeout with shorter one
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void SetTimeout(int timeout, int id);
private static extern void SetTimeout(int timeout);

// Called by mini-wasm.c:mono_set_timeout_exec
private static void TimeoutCallback()
Expand Down Expand Up @@ -78,7 +77,7 @@ private static void ReplaceNextSetTimeout(long shortestDueTimeMs, long currentTi
int shortestWait = Math.Max((int)(shortestDueTimeMs - currentTimeMs), 0);
// this would cancel the previous schedule and create shorter one
// it is expensive call
SetTimeout(shortestWait, 0);
SetTimeout(shortestWait);
}
}

Expand Down
39 changes: 22 additions & 17 deletions src/mono/mono/mini/mini-wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe

//functions exported to be used by JS
G_BEGIN_DECLS
EMSCRIPTEN_KEEPALIVE void mono_set_timeout_exec (int id);
EMSCRIPTEN_KEEPALIVE void mono_set_timeout_exec (void);

//JS functions imported that we use
extern void mono_set_timeout (int t, int d);
extern void mono_set_timeout (int t);
extern void mono_wasm_queue_tp_cb (void);
G_END_DECLS

Expand Down Expand Up @@ -581,21 +581,23 @@ mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo
}

EMSCRIPTEN_KEEPALIVE void
mono_set_timeout_exec (int id)
mono_set_timeout_exec (void)
{
ERROR_DECL (error);

MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "TimerQueue");
g_assert (klass);
static MonoMethod *method = NULL;
if (method == NULL) {
MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "TimerQueue");
g_assert (klass);

MonoMethod *method = mono_class_get_method_from_name_checked (klass, "TimeoutCallback", -1, 0, error);
mono_error_assert_ok (error);
g_assert (method);
method = mono_class_get_method_from_name_checked (klass, "TimeoutCallback", -1, 0, error);
mono_error_assert_ok (error);
g_assert (method);
}

gpointer params[1] = { &id };
MonoObject *exc = NULL;

mono_runtime_try_invoke (method, NULL, params, &exc, error);
mono_runtime_try_invoke (method, NULL, NULL, &exc, error);

//YES we swallow exceptions cuz there's nothing much we can do from here.
//FIXME Maybe call the unhandled exception function?
Expand All @@ -614,10 +616,10 @@ mono_set_timeout_exec (int id)
#endif

void
mono_wasm_set_timeout (int timeout, int id)
mono_wasm_set_timeout (int timeout)
{
#ifdef HOST_BROWSER
mono_set_timeout (timeout, id);
mono_set_timeout (timeout);
#endif
}

Expand All @@ -626,12 +628,15 @@ tp_cb (void)
{
ERROR_DECL (error);

MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
g_assert (klass);
static MonoMethod *method = NULL;
if (method == NULL) {
MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
g_assert (klass);

MonoMethod *method = mono_class_get_method_from_name_checked (klass, "Callback", -1, 0, error);
mono_error_assert_ok (error);
g_assert (method);
method = mono_class_get_method_from_name_checked (klass, "Callback", -1, 0, error);
mono_error_assert_ok (error);
g_assert (method);
}

MonoObject *exc = NULL;

Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/mini-wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ typedef struct {
// sdks/wasm/driver.c is C and uses this
G_EXTERN_C void mono_wasm_enable_debugging (int log_level);

void mono_wasm_set_timeout (int timeout, int id);
void mono_wasm_set_timeout (int timeout);

int mono_wasm_assembly_already_added (const char *assembly_name);
void mono_wasm_print_stack_trace (void);
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasm/runtime/cwraps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const fn_signatures: [ident: string, returnType: string | null, argTypes?: strin
["mono_wasm_parse_runtime_options", null, ["number", "number"]],
["mono_wasm_strdup", "number", ["string"]],
["mono_background_exec", null, []],
["mono_set_timeout_exec", null, ["number"]],
["mono_set_timeout_exec", null, []],
["mono_wasm_load_icu_data", "number", ["number"]],
["mono_wasm_get_icudt_name", "string", ["string"]],
["mono_wasm_add_assembly", "number", ["string", "number", "number"]],
Expand Down Expand Up @@ -82,7 +82,7 @@ export interface t_Cwraps {
mono_wasm_strdup(value: string): number;
mono_wasm_parse_runtime_options(length: number, argv: VoidPtr): void;
mono_background_exec(): void;
mono_set_timeout_exec(id: number): void;
mono_set_timeout_exec(): void;
mono_wasm_load_icu_data(offset: VoidPtr): number;
mono_wasm_get_icudt_name(name: string): string;
mono_wasm_add_assembly(name: string, data: VoidPtr, size: number): number;
Expand Down
6 changes: 3 additions & 3 deletions src/mono/wasm/runtime/scheduling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function prevent_timer_throttling(): void {
for (let schedule = next_reach_time; schedule < desired_reach_time; schedule += light_throttling_frequency) {
const delay = schedule - now;
setTimeout(() => {
cwraps.mono_set_timeout_exec(0);
cwraps.mono_set_timeout_exec();
pump_count++;
pump_message();
}, delay);
Expand All @@ -52,9 +52,9 @@ export function schedule_background_exec(): void {
}

let lastScheduledTimeoutId: any = undefined;
export function mono_set_timeout(timeout: number, id: number): void {
export function mono_set_timeout(timeout: number): void {
function mono_wasm_set_timeout_exec() {
cwraps.mono_set_timeout_exec(id);
cwraps.mono_set_timeout_exec();
}
if (lastScheduledTimeoutId) {
clearTimeout(lastScheduledTimeoutId);
Expand Down