Skip to content

Commit

Permalink
move files
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Sep 21, 2023
1 parent 5149896 commit 8c0ac57
Show file tree
Hide file tree
Showing 84 changed files with 426 additions and 497 deletions.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/interp/jiterpreter.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ mono_jiterp_conv (void *dest, void *src, int opcode) {
return 0;
}

// keep in sync with jiterpreter-opcodes.ts
// keep in sync with jiterpreter/opcodes.ts
enum {
JITERP_CNE_UN_R4 = (0xFFFF + 0),
JITERP_CGE_UN_R4,
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasm/runtime/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jiterpreter-opcodes.ts
jiterpreter-tables.ts
jiterpreter/opcodes.ts
jiterpreter/tables.ts
4 changes: 2 additions & 2 deletions src/mono/wasm/runtime/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module.exports = {
"node_modules/**/*.*",
"bin/**/*.*",
"es6/*.js",
"jiterpreter-opcodes.ts",
"jiterpreter-tables.ts",
"jiterpreter/opcodes.ts",
"jiterpreter/tables.ts",
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { ENVIRONMENT_IS_SHELL, ENVIRONMENT_IS_WEB, Module, loaderHelpers, mono_a
import { mono_log_info, mono_log_debug, mono_log_warn, parseSymbolMapFile } from "./logging";
import { mono_wasm_load_bytes_into_heap } from "./memory";
import { endMeasure, MeasuredBlock, startMeasure } from "./profiler";
import { AssetEntryInternal } from "./types/internal";
import { AssetEntry } from "./types";
import { InstantiateWasmSuccessCallback, VoidPtr } from "./types/emscripten";
import { AssetEntryInternal } from "../types/internal";
import { AssetEntry } from "../types";
import { InstantiateWasmSuccessCallback, VoidPtr } from "../types/emscripten";

// this need to be run only after onRuntimeInitialized event, when the memory is ready
export function instantiate_asset(asset: AssetEntry, url: string, bytes: Uint8Array): void {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { _lookup_js_owned_object } from "./gc-handles";
import { createPromiseController, loaderHelpers, mono_assert } from "./globals";
import { TaskCallbackHolder } from "./marshal-to-cs";
import { ControllablePromise, GCHandle } from "./types/internal";
import { TaskCallbackHolder } from "../interop/marshal-to-cs";
import { ControllablePromise, GCHandle } from "../types/internal";

export const _are_promises_supported = ((typeof Promise === "object") || (typeof Promise === "function")) && (typeof Promise.resolve === "function");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MonoAssembly, MonoClass, MonoType, MonoTypeNull, MonoAssemblyNull } from "./types/internal";
import { MonoAssembly, MonoClass, MonoType, MonoTypeNull, MonoAssemblyNull } from "../types/internal";
import cwraps from "./cwraps";

const _assembly_cache_by_name = new Map<string, MonoAssembly>();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type {
MonoArray, MonoAssembly, MonoClass,
MonoMethod, MonoObject,
MonoType, MonoObjectRef, MonoStringRef, JSMarshalerArguments
} from "./types/internal";
import type { VoidPtr, CharPtrPtr, Int32Ptr, CharPtr, ManagedPointer } from "./types/emscripten";
} from "../types/internal";
import type { VoidPtr, CharPtrPtr, Int32Ptr, CharPtr, ManagedPointer } from "../types/emscripten";
import { linkerDisableLegacyJsInterop, linkerEnableAotProfiler, linkerEnableBrowserProfiler, Module } from "./globals";
import { mono_log_error } from "./logging";
import { mono_assert } from "./globals";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BuildConfiguration from "consts:configuration";
import { INTERNAL, Module, runtimeHelpers } from "./globals";
import { toBase64StringImpl } from "./base64";
import cwraps from "./cwraps";
import { VoidPtr, CharPtr } from "./types/emscripten";
import { VoidPtr, CharPtr } from "../types/emscripten";
import { mono_log_warn } from "./logging";
import { localHeapViewU8 } from "./memory";
import { utf8ToString } from "./strings";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

import type { MonoConfig, APIType } from "./types";
import type { MonoConfig, APIType } from "../types";

import { mono_wasm_get_assembly_exports } from "./invoke-cs";
import { mono_wasm_set_module_imports } from "./invoke-js";
import { mono_wasm_get_assembly_exports } from "../interop/invoke-cs";
import { mono_wasm_set_module_imports } from "../interop/invoke-js";
import { getB32, getF32, getF64, getI16, getI32, getI52, getI64Big, getI8, getU16, getU32, getU52, getU8, localHeapViewF32, localHeapViewF64, localHeapViewI16, localHeapViewI32, localHeapViewI64Big, localHeapViewI8, localHeapViewU16, localHeapViewU32, localHeapViewU8, setB32, setF32, setF64, setI16, setI32, setI52, setI64Big, setI8, setU16, setU32, setU52, setU8 } from "./memory";
import { mono_run_main, mono_run_main_and_exit } from "./run";
import { mono_wasm_setenv } from "./startup";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ import WasmEnableLegacyJsInterop from "consts:wasmEnableLegacyJsInterop";

import { mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint, mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_fire_debugger_agent_message_with_data_to_pause } from "./debug";
import { mono_wasm_release_cs_owned_object } from "./gc-handles";
import { mono_wasm_bind_cs_function } from "./invoke-cs";
import { mono_wasm_bind_js_function, mono_wasm_invoke_bound_function, mono_wasm_invoke_import } from "./invoke-js";
import { mono_interp_tier_prepare_jiterpreter, mono_jiterp_free_method_data_js } from "./jiterpreter";
import { mono_interp_jit_wasm_entry_trampoline, mono_interp_record_interp_entry } from "./jiterpreter-interp-entry";
import { mono_interp_jit_wasm_jit_call_trampoline, mono_interp_invoke_wasm_jit_call_trampoline, mono_interp_flush_jitcall_queue, mono_jiterp_do_jit_call_indirect } from "./jiterpreter-jit-call";
import { mono_wasm_marshal_promise } from "./marshal-to-js";
import { mono_wasm_eventloop_has_unsettled_interop_promises } from "./pthreads/shared/eventloop";
import { mono_wasm_pthread_on_pthread_attached, mono_wasm_pthread_on_pthread_detached } from "./pthreads/worker";
import { mono_wasm_bind_cs_function } from "../interop/invoke-cs";
import { mono_wasm_bind_js_function, mono_wasm_invoke_bound_function, mono_wasm_invoke_import } from "../interop/invoke-js";
import { mono_interp_tier_prepare_jiterpreter, mono_jiterp_free_method_data_js } from "../jiterpreter/index";
import { mono_interp_jit_wasm_entry_trampoline, mono_interp_record_interp_entry } from "../jiterpreter/interp-entry";
import { mono_interp_jit_wasm_jit_call_trampoline, mono_interp_invoke_wasm_jit_call_trampoline, mono_interp_flush_jitcall_queue, mono_jiterp_do_jit_call_indirect } from "../jiterpreter/jit-call";
import { mono_wasm_marshal_promise } from "../interop/marshal-to-js";
import { mono_wasm_eventloop_has_unsettled_interop_promises } from "../pthreads/shared/eventloop";
import { mono_wasm_pthread_on_pthread_attached, mono_wasm_pthread_on_pthread_detached } from "../pthreads/worker";
import { mono_wasm_schedule_timer, schedule_background_exec } from "./scheduling";
import { mono_wasm_asm_loaded } from "./startup";
import { mono_wasm_diagnostic_server_on_server_thread_created } from "./diagnostics/server_pthread";
import { mono_wasm_diagnostic_server_on_runtime_server_init, mono_wasm_event_pipe_early_startup_callback } from "./diagnostics";
import { mono_wasm_diagnostic_server_stream_signal_work_available } from "./diagnostics/server_pthread/stream-queue";
import { mono_wasm_diagnostic_server_on_server_thread_created } from "../diagnostics/server_pthread";
import { mono_wasm_diagnostic_server_on_runtime_server_init, mono_wasm_event_pipe_early_startup_callback } from "../diagnostics";
import { mono_wasm_diagnostic_server_stream_signal_work_available } from "../diagnostics/server_pthread/stream-queue";
import { mono_log_debug, mono_log_warn, mono_wasm_trace_logger } from "./logging";
import { mono_wasm_profiler_leave, mono_wasm_profiler_enter } from "./profiler";
import { mono_wasm_change_case, mono_wasm_change_case_invariant } from "./hybrid-globalization/change-case";
import { mono_wasm_compare_string, mono_wasm_ends_with, mono_wasm_starts_with, mono_wasm_index_of } from "./hybrid-globalization/collations";
import { mono_wasm_get_calendar_info } from "./hybrid-globalization/calendar";
import { mono_wasm_install_js_worker_interop, mono_wasm_uninstall_js_worker_interop } from "./pthreads/shared";
import { mono_wasm_change_case, mono_wasm_change_case_invariant } from "../hybrid-globalization/change-case";
import { mono_wasm_compare_string, mono_wasm_ends_with, mono_wasm_starts_with, mono_wasm_index_of } from "../hybrid-globalization/collations";
import { mono_wasm_get_calendar_info } from "../hybrid-globalization/calendar";
import { mono_wasm_install_js_worker_interop, mono_wasm_uninstall_js_worker_interop } from "../pthreads/shared";

import {
mono_wasm_invoke_js_blazor, mono_wasm_invoke_js_with_args_ref, mono_wasm_get_object_property_ref, mono_wasm_set_object_property_ref,
mono_wasm_get_by_index_ref, mono_wasm_set_by_index_ref, mono_wasm_get_global_object_ref
} from "./net6-legacy/method-calls";
import { mono_wasm_create_cs_owned_object_ref } from "./net6-legacy/cs-to-js";
import { mono_wasm_typed_array_to_array_ref } from "./net6-legacy/js-to-cs";
import { mono_wasm_typed_array_from_ref } from "./net6-legacy/buffers";
import { mono_wasm_get_culture_info } from "./hybrid-globalization/culture-info";
import { mono_wasm_get_first_day_of_week, mono_wasm_get_first_week_of_year } from "./hybrid-globalization/locales";
} from "../net6-legacy/method-calls";
import { mono_wasm_create_cs_owned_object_ref } from "../net6-legacy/cs-to-js";
import { mono_wasm_typed_array_to_array_ref } from "../net6-legacy/js-to-cs";
import { mono_wasm_typed_array_from_ref } from "../net6-legacy/buffers";
import { mono_wasm_get_culture_info } from "../hybrid-globalization/culture-info";
import { mono_wasm_get_first_day_of_week, mono_wasm_get_first_week_of_year } from "../hybrid-globalization/locales";

// the JS methods would be visible to EMCC linker and become imports of the WASM module

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import cwraps, { profiler_c_functions } from "./cwraps";
import { mono_wasm_send_dbg_command_with_parms, mono_wasm_send_dbg_command, mono_wasm_get_dbg_command_info, mono_wasm_get_details, mono_wasm_release_object, mono_wasm_call_function_on, mono_wasm_debugger_resume, mono_wasm_detach_debugger, mono_wasm_raise_debug_event, mono_wasm_change_debugger_log_level, mono_wasm_debugger_attached } from "./debug";
import { http_wasm_supports_streaming_request, http_wasm_supports_streaming_response, http_wasm_create_abort_controler, http_wasm_abort_request, http_wasm_abort_response, http_wasm_readable_stream_controller_enqueue, http_wasm_readable_stream_controller_error, http_wasm_fetch, http_wasm_fetch_stream, http_wasm_fetch_bytes, http_wasm_get_response_header_names, http_wasm_get_response_header_values, http_wasm_get_response_bytes, http_wasm_get_response_length, http_wasm_get_streamed_response_bytes } from "./http";
import { exportedRuntimeAPI, Module, runtimeHelpers } from "./globals";
import { get_property, set_property, has_property, get_typeof_property, get_global_this, dynamic_import } from "./invoke-js";
import { get_property, set_property, has_property, get_typeof_property, get_global_this, dynamic_import } from "../interop/invoke-js";
import { mono_wasm_stringify_as_error_with_stack } from "./logging";
import { ws_wasm_create, ws_wasm_open, ws_wasm_send, ws_wasm_receive, ws_wasm_close, ws_wasm_abort } from "./web-socket";
import { mono_wasm_get_loaded_files } from "./assets";
import { jiterpreter_dump_stats } from "./jiterpreter";
import { getOptions, applyOptions } from "./jiterpreter-support";
import { jiterpreter_dump_stats } from "../jiterpreter/index";
import { getOptions, applyOptions } from "../jiterpreter/support";
import { mono_wasm_gc_lock, mono_wasm_gc_unlock } from "./gc-lock";
import { loadLazyAssembly } from "./lazyLoading";
import { loadSatelliteAssemblies } from "./satelliteAssemblies";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import ProductVersion from "consts:productVersion";
import BuildConfiguration from "consts:configuration";
import WasmEnableLegacyJsInterop from "consts:wasmEnableLegacyJsInterop";
import type { RuntimeAPI } from "./types";
import type { RuntimeAPI } from "../types";

import { Module, linkerDisableLegacyJsInterop, exportedRuntimeAPI, passEmscriptenInternals, runtimeHelpers, setRuntimeGlobals, } from "./globals";
import { GlobalObjects, is_nullish } from "./types/internal";
import { GlobalObjects, is_nullish } from "../types/internal";
import { configureEmscriptenStartup, configureRuntimeStartup, configureWorkerStartup } from "./startup";

import { create_weak_ref } from "./weak-ref";
Expand All @@ -16,12 +16,12 @@ import { export_api } from "./export-api";
import { initializeReplacements } from "./polyfills";

// legacy
import { mono_bind_static_method } from "./net6-legacy/method-calls";
import { export_binding_api, export_internal_api, export_mono_api } from "./net6-legacy/exports-legacy";
import { initializeLegacyExports } from "./net6-legacy/globals";
import { mono_bind_static_method } from "../net6-legacy/method-calls";
import { export_binding_api, export_internal_api, export_mono_api } from "../net6-legacy/exports-legacy";
import { initializeLegacyExports } from "../net6-legacy/globals";
import { mono_log_warn, mono_wasm_stringify_as_error_with_stack } from "./logging";
import { instantiate_asset, instantiate_symbols_asset } from "./assets";
import { jiterpreter_dump_stats } from "./jiterpreter";
import { jiterpreter_dump_stats } from "../jiterpreter";
import { forceDisposeProxies } from "./gc-handles";

function initializeExports(globalObjects: GlobalObjects): RuntimeAPI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import MonoWasmThreads from "consts:monoWasmThreads";
import BuildConfiguration from "consts:configuration";

import { loaderHelpers, mono_assert, runtimeHelpers } from "./globals";
import { fn_wrapper_by_fn_handle } from "./invoke-js";
import { fn_wrapper_by_fn_handle } from "../interop/invoke-js";
import { mono_log_info, mono_log_warn } from "./logging";
import { bound_cs_function_symbol, imported_js_function_symbol, proxy_debug_symbol } from "./marshal";
import { GCHandle, GCHandleNull, JSHandle, JSHandleDisposed, JSHandleNull } from "./types/internal";
import { GCHandle, GCHandleNull, JSHandle, JSHandleDisposed, JSHandleNull } from "../types/internal";
import { _use_weak_ref, create_weak_ref } from "./weak-ref";
import { exportsByAssembly } from "./invoke-cs";
import { exportsByAssembly } from "../interop/invoke-cs";

const _use_finalization_registry = typeof globalThis.FinalizationRegistry === "function";
let _js_owned_object_registry: FinalizationRegistry<any>;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.

/* eslint-disable @typescript-eslint/triple-slash-reference */
/// <reference path="./types/v8.d.ts" />
/// <reference path="./types/node.d.ts" />
/// <reference path="../types/v8.d.ts" />
/// <reference path="../types/node.d.ts" />

import gitHash from "consts:gitHash";

import { RuntimeAPI } from "./types/index";
import type { GlobalObjects, EmscriptenInternals, RuntimeHelpers, LoaderHelpers, DotnetModuleInternal, PromiseAndController } from "./types/internal";
import { RuntimeAPI } from "../types/index";
import type { GlobalObjects, EmscriptenInternals, RuntimeHelpers, LoaderHelpers, DotnetModuleInternal, PromiseAndController } from "../types/internal";

// these are our public API (except internal)
export let Module: DotnetModuleInternal;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { wrap_as_cancelable_promise } from "./cancelable-promise";
import { ENVIRONMENT_IS_NODE, Module, createPromiseController, loaderHelpers, mono_assert } from "./globals";
import { ManagedObject, MemoryViewType, Span } from "./marshal";
import type { VoidPtr } from "./types/emscripten";
import { ControllablePromise, PromiseController } from "./types/internal";
import type { VoidPtr } from "../types/emscripten";
import { ControllablePromise, PromiseController } from "../types/internal";


function verifyEnvironment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

import cwraps from "./cwraps";
import { VoidPtr } from "./types/emscripten";
import { VoidPtr } from "../types/emscripten";

// @offset must be the address of an ICU data archive in the native heap.
// returns true on success.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

import { loaderHelpers, runtimeHelpers } from "./globals";
import { AssetEntry } from "./types";
import { AssetEntry } from "../types";

export async function loadLazyAssembly(assemblyNameToLoad: string): Promise<boolean> {
const resources = loaderHelpers.config.resources!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* eslint-disable no-console */
import { INTERNAL, runtimeHelpers } from "./globals";
import { utf8ToString } from "./strings";
import { CharPtr, VoidPtr } from "./types/emscripten";
import { CharPtr, VoidPtr } from "../types/emscripten";

let prefix = "MONO_WASM: ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import MonoWasmThreads from "consts:monoWasmThreads";

import { GCHandle, MarshalerToCs, MarshalerToJs, MarshalerType, MonoMethod } from "./types/internal";
import { GCHandle, MarshalerToCs, MarshalerToJs, MarshalerType, MonoMethod } from "../types/internal";
import cwraps from "./cwraps";
import { runtimeHelpers, Module, loaderHelpers, mono_assert } from "./globals";
import { alloc_stack_frame, get_arg, get_arg_gc_handle, set_arg_type, set_gc_handle } from "./marshal";
import { invoke_method_and_handle_exception } from "./invoke-cs";
import { marshal_array_to_cs, marshal_array_to_cs_impl, marshal_exception_to_cs, marshal_intptr_to_cs } from "./marshal-to-cs";
import { marshal_int32_to_js, marshal_string_to_js, marshal_task_to_js } from "./marshal-to-js";
import { invoke_method_and_handle_exception } from "../interop/invoke-cs";
import { marshal_array_to_cs, marshal_array_to_cs_impl, marshal_exception_to_cs, marshal_intptr_to_cs } from "../interop/marshal-to-cs";
import { marshal_int32_to_js, marshal_string_to_js, marshal_task_to_js } from "../interop/marshal-to-js";
import { do_not_force_dispose } from "./gc-handles";

export function init_managed_exports(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { js_owned_gc_handle_symbol, teardown_managed_proxy } from "./gc-handles"
import { Module, loaderHelpers, mono_assert, runtimeHelpers } from "./globals";
import { getF32, getF64, getI16, getI32, getI64Big, getU16, getU32, getU8, setF32, setF64, setI16, setI32, setI64Big, setU16, setU32, setU8, localHeapViewF64, localHeapViewI32, localHeapViewU8 } from "./memory";
import { mono_wasm_new_external_root } from "./roots";
import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerArguments, JSFunctionSignature, JSMarshalerType, JSMarshalerArgument, MarshalerToJs, MarshalerToCs, WasmRoot, MarshalerType } from "./types/internal";
import { CharPtr, TypedArray, VoidPtr } from "./types/emscripten";
import { GCHandle, JSHandle, MonoObject, MonoString, GCHandleNull, JSMarshalerArguments, JSFunctionSignature, JSMarshalerType, JSMarshalerArgument, MarshalerToJs, MarshalerToCs, WasmRoot, MarshalerType } from "../types/internal";
import { CharPtr, TypedArray, VoidPtr } from "../types/emscripten";

export const cs_to_js_marshalers = new Map<MarshalerType, MarshalerToJs>();
export const js_to_cs_marshalers = new Map<MarshalerType, MarshalerToCs>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import MonoWasmThreads from "consts:monoWasmThreads";

import { MemOffset, NumberOrPointer } from "./types/internal";
import { VoidPtr, CharPtr } from "./types/emscripten";
import { MemOffset, NumberOrPointer } from "../types/internal";
import { VoidPtr, CharPtr } from "../types/emscripten";
import cwraps, { I52Error } from "./cwraps";
import { Module, runtimeHelpers } from "./globals";
import { utf8ToString } from "./strings";
Expand Down
Loading

0 comments on commit 8c0ac57

Please sign in to comment.