Age | Commit message (Collapse) | Author |
|
1) Delete `src/mono/netcore/corerun/` folder, we can build/use coreclr's corerun (it has `--clr-path`)
2) Add `RunSample` to build & run HelloWorld with mono runtime.
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
|
|
|
|
|
|
|
|
|
|
[wasm] Put function names in call stacks.
Add --profiling-funcs to release wasm build.
This is a weaker for of -g2 or -g3 or -g4 or --profiling.
It sounds like the weakest form that preserves names.
Documentation is around here: https://emscripten.org/docs/tools_reference/emcc.html#emcc-g1
Now when reproducing for example https://github.com/mono/mono/issues/18646, you get:
```
e.stack
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[interp_inline_method]@[wasm code]
<?>.wasm-function[interp_transform_call]@[wasm code]
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[interp_inline_method]@[wasm code]
<?>.wasm-function[interp_transform_call]@[wasm code]
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[interp_inline_method]@[wasm code]
<?>.wasm-function[generate_code]@[wasm code]
<?>.wasm-function[generate]@[wasm code]
<?>.wasm-function[mono_interp_transform_method]@[wasm code]
<?>.wasm-function[do_transform_method]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_class_init_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_class_init_full]@[wasm code]
<?>.wasm-function[mono_interp_transform_method]@[wasm code]
<?>.wasm-function[do_transform_method]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_invoke_checked]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke_array]@[wasm code]
<?>.wasm-function[ves_icall_InternalInvoke]@[wasm code]
<?>.wasm-function[ves_icall_InternalInvoke_raw]@[wasm code]
<?>.wasm-function[do_icall]@[wasm code]
<?>.wasm-function[do_icall_wrapper]@[wasm code]
<?>.wasm-function[interp_exec_method_full]@[wasm code]
<?>.wasm-function[interp_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_jit_runtime_invoke]@[wasm code]
<?>.wasm-function[do_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_try_invoke]@[wasm code]
<?>.wasm-function[mono_runtime_invoke]@[wasm code]
<?>.wasm-function[mono_wasm_invoke_method]@[wasm code]
wasm-stub@[wasm code]
Db@[native code]
http://192.168.0.20:8000/_framework/wasm/dotnet.js:1:189579
call_method@http://192.168.0.20:8000/_framework/wasm/dotnet.js:1:153837
http://192.168.0.20:8000/_framework/wasm/dotnet.js:1:156177
callEntryPoint@http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:37229
http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:33889
http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:32396
i@http://192.168.0.20:8000/_framework/blazor.webassembly.js:1:31247
promiseReactionJob@[native code]
```
|
|
(#18678)
[interp] Remove goto for code_type unknown | interp | compiled.
[interp] Remove goto for code_type unknown | interp | compiled.
The goto kinda implies a loop, but it is really just handling one case
before the other, but the source misorders the checks, perhaps for perf,
which maybe, can be done equivalently with G_UNLIKELY, and also remove
some possible extra memory reads.
|
|
[interp][wasm]Use per-call recursive functions in interpreter to aid debugging.
When the interpreter does recurse, use a different function
for each call site, so you can tell from a WebAssembly stack
which case it is. i.e. with function names but no line numbers.
With this, we can see that call_varargs contributes to the problem
here: https://github.com/mono/mono/issues/18646
Also, do not inline the interpreter, it probably/hopefully never was.
|
|
Fixes https://github.com/mono/mono/issues/18675.
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
|
|
* Bump linker.
* [csproj] Update project files
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
[interp]Fix the type of clause_args.
|
|
|
|
(#18680)
Fixes https://github.com/mono/mono/issues/18676.
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
|
|
calls AppDomain.UnhandledException. (#18642)
|
|
* [mini] Add optional method name to --stats (#18387)
* Implement parsing for optional method name to --stats command line argument.
* Implement parsing for optional method name to --stats command line argument.
Co-authored-by: Kyle Markland <v-kymark@microsoft.com>
Co-authored-by: Rene Garcia <v-regarc@microsoft.com>
* Respond to PR feedback.
* Refactored away helper functions.
* Refactored counter setup into separate function. Moved stats optional method into its own condition.
Co-authored-by: Kyle Markland <v-kymark@microsoft.com>
Co-authored-by: Rene Garcia <v-regarc@microsoft.com>
* Renamed mono_setup_counters->mono_enable_counters. Restore whitespace to 0a51d89c4238c46f07f8b5405383547c1530809b
Co-authored-by: Kyle Markland <v-kymark@microsoft.com>
Co-authored-by: Rene Garcia <v-regarc@microsoft.com>
* [mini] Print header for stats. (#18442)
* Add an enum for dumping stats at points in time. Print header before dumping stats in mini_cleanup.
* Make print_stats_header private.
* Remove unused variable.
* Refactored print_stats_header to better accomodate optional methods for stats
* Change printf calls to g_printf in response to feedback.
* Undo changes in response to @CoffeeFlux 's feedback. Add g_printf calls to mini_cleanup
* Avoid always printing stats at shutdown.
* Condition on `mono_stats` instead of `mono_jit_stats`.
* [mini] Global JIT Stats Printing (#18483)
* Make print_jit_stats global to enable interp and JIT-triggered stat dumps.
* Rename some functions for consistency.
* Add a comment to clarify the necessary locking in different contexts.
* Rename mono_print_jit_stats to mono_runtime_print_stats and make it more generic.
* Rename runtime_cleanup_stats back to jit_stats_cleanup.
* Fix a line that was indented with spaces.
* [mini] parse fully qualified method name using mono_method_desc_new (#18499)
* Make print_jit_stats global to enable interp and JIT-triggered stat dumps.
* Rename some functions for consistency.
* Add a comment to clarify the necessary locking in different contexts.
* Use MonoMethodDesc struct and associated helpers to parse from command
line args. Remove unused stats_method_name and setter function.
Squashed commit of the following:
commit de7410696dab10723c76f545076522daa17e85d1
Author: Rene Garcia <rgarc@mit.edu>
Date: Thu Jan 16 23:01:23 2020 -0500
Utilize new stats printing function.
commit 1e5038adfec06c670dbaced771a8ff9344502d17
Author: Rene Garcia <rgarc@mit.edu>
Date: Thu Jan 16 22:37:53 2020 -0500
Remove unused stats_method_name and setter function. Use mono_method_desc_full_match instead of mono_method_desc_match.
commit 04f86c66c139e064bc35738f955f960232eb6cbb
Author: Rene Garcia <rgarc@mit.edu>
Date: Thu Jan 16 18:11:37 2020 -0500
Modify mono_method_desc_match to actually match namespace and class. Add global MonoMethodDesc, and parse it from command line args. Leave TODO print statement in mono_jit_compile_method_inner.
* Move mono_method_desc to mini-runtime header. Fix whitespace.
* Cherry pick @KyleMarkland 's changes, and resolve merge conflicts.
* Fix leak. Give better error message when parsing empty method name.
* Move freeing of mono_stats_method_desc.
Co-authored-by: KyleMarkland <59579632+KyleMarkland@users.noreply.github.com>
* Add a conditional to transform.c to enable stat dumping from the interpreter. (#18540)
* [mini] Use g_printerr instead of g_printf before exiting (#18574)
* Rename g_printf -> g_print
* Use g_printerr on errors instead of g_printf.
* Pass NULL to mono_counters_dump. Revert g_printf to g_print.
* Update manpage
* Feedback
Co-authored-by: rgarc <rgarc@users.noreply.github.com>
Co-authored-by: KyleMarkland <59579632+KyleMarkland@users.noreply.github.com>
|
|
Fixed by https://github.com/mono/mono/commit/9ea350ed3c963c77f0f4f77ec590cc3c84773424
|
|
I fear this causing packaging problems, but as-is we require Python 3 for most of our Python files but don't actually check for that in configure. We should be consistent about this. Some projects (notably wasm) also use the Python version detected here, so bumping this will also bump the version used in those cases (a good thing, since there are some known bugs when using the scripts with Python 2).
|
|
We were failing to dereference a managed pointer to the enum, due to incorrect checks, when doing a constrained call.
Fixes https://github.com/mono/mono/issues/18530
Co-authored-by: Vlad Brezae <brezaevlad@gmail.com>
|
|
The original fix back at #18554 did not work quite right, which was missed for lack of CI.
Reworked this check to instead test for `-mminimal-toc` on all powerpc hosts, and to only do the ELF version check on FreeBSD.
Fixes #18554 #18578 current CI build failures on AIX
|
|
is detected. (#18649)
This fixes: https://issuetracker.unity3d.com/issues/unity-physics-collisions-do-not-work-and-errors-are-thrown-when-entering-play-mode
|
|
See https://github.com/mono/mono/issues/16243. This will allow elision
of redundant bounds checks. This pass is already used during AOT (as
part of opt -O2).
|
|
|
|
|
|
|
|
* [aot] Handle '|' during symbol mangling.
* [aot] Clean up the construction of the linker command line.
* [aot] Pass -Wl,-install_name to the linker on osx, otherwise the shared object will be named based on the output file name i.e. <assembly>.dylib.tmp.
* [llvm] Pass the MonoAotFileInfo pointer to the init functions, not used yet.
* [jit] Add support for direct calls between methods in different AOT images in LLVM mode.
* Add a 'direct-extern-calls' AOT option.
* Initialize the PLT/GOT during method initialization,
this normally happens in load_method () but that is
not called when a method is directly called.
* Add self initialization support for JITted methods, they can be
called directly since they are fallbacks if LLVM fails.
* Fix the build.
* Avoid calling BeginInvoke etc. directly, its implemented by the runtime.
* Unify some cases.
* Init PLT at image load time since directly called methods without initializers might make calls through it.
* Fix a startup problem.
* Make the mono_is_corlib_image () check for during startup.
* Check for is_inited in the init icall wrappers, since they might be called from JITted code which doesn't check it.
* Address review comments.
|
|
The existing heuristic doesn't work with llvm.
|
|
|
|
|
|
When calling a generic class we need to make sure it has been inited.
This is done by calling generic_class_init. Since this call happens
frequently, but will only run once, it should be put out of line, assisting
branch predictor, preventing misspredictions (in all places but the first).
Currently this is not the case, since we will generate code like this:
0000000000000484: cmp byte ptr [rcx+2Dh],0
0000000000000488: jne 000000000000048F
000000000000048A: call p_3_plt_EmptyGame__jit_icall_mono_generic_class_init_llvm
000000000000048F: mov rax,qword ptr [mono_aot_EmptyGame_llvm_got+0C8h]
Where we will always (except for first call) take the forward branch.
Instead we should mark the call to the method as out of line, at least
giving the code generator the information so it can move it out of line
and preventing a jmp, unless when it needs to init, the slow path. Doing
that will generate the following code:
0000000000000484: cmp byte ptr [rcx+2Dh],0
0000000000000488: je 00000000000004C1
000000000000048A: mov rax,qword ptr [mono_aot_EmptyGame_llvm_got+0C8h]
...
00000000000004C1: call p_3_plt_EmptyGame__jit_icall_mono_generic_class_init_llvm
00000000000004C6: jmp 000000000000048A
|
|
decode_patch_info () would not decode patches if their corresponding GOT entry
was already set, causing half initialized MonoJumpInfo entries to be returned
to callers. Set the type of the MonoJumpInfo entry to MONO_PATCH_INFO_NONE
in these cases, and have the callers handle it.
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
|
|
reach the top invoke frame as unhandled when embedding. (#18610)
This is not really a MONO_DEBUG option, but easier to implement it this way.
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
|
|
* [wasm] Add --enable-checked-build=private_types configure option to disable direct access of MonoClass fields.
* [mono] Indirectly access MonoClass fields
|
|
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
|
|
When stepping out of a c# breakpoint into the runtime (or JS... Not sure if that's accurate),
multiple single step requests can be created when the breakpoint is hit again. In order to handle this scenario for wasm,
we just cancel the existing one.
NOTE: The debugger args addition seemed a better way to handle this than outright canceling in debugger-engine. If there
are implications to doing this, I can take it out.
|
|
This work mostly happened a while back, but this commit finishes the job.
|
|
Use -j with all example make invocations, mention Ninja dependency, mention raising ulimit, recommend py3 for running the server (when using py2, the port isn't properly released).
|
|
[wasm][debugger] Initial support for proxying flat sessions
|
|
Follow-up to https://github.com/mono/mono/pull/18228 since two parts wasn't enough to fix the size issue on 32bits devices.
We now use three parts.
Fixes https://github.com/mono/mono/issues/18614
|
|
* [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP
Only prevent `gdb` or `lldb` from being invoked.
MERP is controlled by separate mechanisms --- configure flags for crash
reporting and an explicit opt-in icall.
The existing code collects crashed process data in-process, but it writes the
data out (using mono_merp_invoke) in the forked child process. This is a bit
surprising, but in the interest of not disturbing the code too much, this PR
doesn't change that. We should revisit `dump_native_stacktrace` again in the
future and rationalize these decisions.
Addresses https://github.com/mono/mono/issues/18565
|
|
* [interp] Enable virtual calls to compiled code
If we have an aot-ed version of a method we should always go through it, because the IL for that method could be stripped.
* [interp] Disable jit call for wrappers
Some generic wrappers don't seem to work in mixed mode, probably due to the fact that the transition already reuses a gshared wrapper.
|
|
|
|
|
|
|
|
|
|
|
|
* Use memmove in Buffer.MemoryCopy
* add test case
|
|
|
|
Assume we have the following form `MyForm`:
```
using System;
using System.Drawing;
using System.Windows.Forms;
namespace test_TreeView
{
public class MyForm : Form
{
TreeView treeView = new TreeView()
public MyForm()
{
treeView.Nodes.Add("root node");
treeView.Nodes[0].Nodes.Add("first child node");
treeView.BackColor = Color.Gray;
treeView.LineColor = Color.Yellow;
treeView.DrawMode = TreeViewDrawMode.OwnerDrawText;
treeView.DrawNode += treeView_DrawNode;
Controls.Add(treeView);
}
private void treeView_DrawNode(object sender, DrawTreeNodeEventArgs e)
{
var brush = new SolidBrush(Color.FromArgb(100, 255, 0, 0));
e.Graphics.FillRectangle(brush, e.Bounds);
}
}
}
```
The displayed result is
![image](https://user-images.githubusercontent.com/12382656/73263417-92872980-41e1-11ea-8f7c-7cecbb376b60.png)
One can see couple drawing issues:
* White rectangles under each `TreeNode`.
* The area of custom drawing (red rectangles) is shifted with respect to this white rectangles.
Current PR proposes the fix of this issues.
Co-authored-by: monojenkins <jo.shields+jenkins@xamarin.com>
|
|
* Fix Return handling. Ensure correct ClientSize.
When pressing Return / Enter, ensure any target button is both visible
and enabled.
In CreateHandle(), ensure the ClientSize is correct if set. If not,
update it to make it right. Suspend layout while changing it so that
child controls with anchors other than Top Left are not moved.
* Select active control. PerformLayout after updating for client size.
Select the active control with SendControlFocus to avoid upsetting what
is currently selected.
* Improve Form window decoration adjustment handling
Reverts the incorrect attempted fix contained in previous commits.
Basically, when a property is changed that affects window decorations,
ensure the client size stays the same.
* Use UpdateFormStyles on FormBorderStyle too.
|
|
When the user types a letter or digit, KeySearch looks for and selects
an item starting with that character. However, it should not if
SelectionMode is None.
|