* Do not reset unhandled exception hook
* Add processUnhandledException to perform default unhandled exception
processing
* Add terminateWithUnhandledException to report the unhandled exception
and terminate the program
* Use the default unhandled exception processing in entrypoint, interop
boundaries and in Worker.executeAfter
* Add -Xworker-exception-handling to control exception processing of
Worker.executeAfter. By default its the old behaviour with the old MM,
and new behaviour with the new MM.
Recent versions of LLVM complain when caller and callee have
different vector attributes: https://reviews.llvm.org/D82562.
To mitigate this problem this commit changes how we include
polyHashUnroll* and polyHashTail into Traits: we duplicate them
inside each trait with correct attributes by using
```
#pragma clang attribute push(ATTRIBUTE, apply_to = function)
```
This solution is not pretty for sure, but Clang is not complaining
anymore.
### What's done:
- Fixed incorrect logic of String.toFloat() and String.toDouble().
Long string without any digits were treated as Float or Double:
"this string does not look as float isn't it?".toFloat() == "Infinity".
- Fixed incorrect parsing of floating point constants "NaN" and "Infinity":
String values like "NaNPICEZy" or "InfinityN" were treated as valid numbers.
- Merged parsing logic for Double and Float:
Removed the code duplication, unified methods, made the code more Kotlin-like, not C++-like.
- Updated tests:
Removed useless tests that checked nothing, updated tests with regression scenarios.
Clang may replace a call to `pow (10.0, x)` with a call to `exp10(x)`
(or `__exp10` on MacOS).
We use this function in float parsing logic, so this function should
be added to the good function list.
After linking runtime, llvm-ir is modified to add checker function
call at all points where unknown function, which can possibly run long
is called. This function checks Native state is set, to avoid long locks
at gc.
Previously they were skipped, and this was an incorrect optimization:
even if super class implements the interface too, this doesn't mean
that virtual adapters provided by that interface are inherited
by non-exported subclass that needs them;
for example, this doesn't happen when the super class is exported
(i.e. Obj-C class is not created at runtime).
Remove incorrect optimization instead of making it more sophisticated,
because it is useless anyway.
^KT-46431 Fixed
The new GC will require threads to suspend right after registering
if Stop-The-World is requested. This patch changes the initial
thread state to kNative and adds a separate state switch right
after thread registering. This switch suspends if it is necessary.