When replacing _instanceOf with a cid range check, the
number of arguments passed as arguments changes.
The new environment must reflect this change.
The failing test is from #28431, but the bug itself has nothing to
do with checked mode.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2639273003 .
On DBC calls return value on the stack instead of a dedicate register but not all calls have a return value (e.g. CheckStack does not) and such calls don't push anything. Implementation of a lazy deopt however assumed that value is always present and tried to manually preserve it by popping and pushing it back after the frame was rewritten. This of course damaged the frame if we performed a lazy deoptimization after the call that did not push anything.
Instead of manually preserving result value value use frame translation to handle it. This allows to handle calls that return value and those that do not uniformly in the Deopt bytecode. Compiler takes care of creating the right deoptimization environment instead.
BUG=
R=zra@google.com
Review-Url: https://codereview.chromium.org/2587133002 .
Fix my previous: Forgot to insert code that actually uses the
variable.
Strangely, clang did not report this, but other compilers did.
tbr=vegorov@
BUG=
Review URL: https://codereview.chromium.org/2466933002 .
This reverts commit 890f694de5.
Previous commit was passing field_type_map_ down in a place where it was not passed down before.
This caused some handles to be used across zones, which caused crashes.
BUG=
Review URL: https://codereview.chromium.org/2453463006 .
Start by removing all get:runtimeType overrides in the patch files to have a single point computing the runtime type - Object.get:runtimeType. Handle string, double and integer types inside both intrinsic and runtime call to unify their handling and guarantee that code works even with intrinsifier disabled.
With overrides removed we can easily check that get:runtimeType is unique function name within the application that is being precompiled and use that to convert InstanceCall(get:runtimeType, ...) into StaticCall even nothing is known about the receiver.
This enables us to check if both left side and right side of comparison are StaticCall(Object.get:runtimeType, ...) when specializing InstanceCall(==, x, y). If they are we convert InstanceCall(==, StaticCall(get:runtimeType, a), StaticCall(get:runtimeType, b)) into StaticCall(Object._hasSameRuntimeType, a, b). A canonicalization rule will later delete unused get:runtimeType invocations.
Object._hasSameRuntimeType is implemented in C++ and intrinsified. It operates without creating new runtime types (except for Closures - where it does for simplicity). Cases of different class ids (i.e. a.[cid] != b.[cid]) and non-parameterized types are handled completely in the intrinsic. The rest is handled in the runtime code.
Microbenchmarking results:
Same parameterized classes: 15x improvement
Different parameterized classes: 300x improvement
Different/same non-parameterized classes: 2x improvement
BUG=
R=fschneider@google.com, regis@google.com
Review URL: https://codereview.chromium.org/2379733002 .
Move inlining OneByteString._setAt, List constructor, Object constructor
and a few math function to the flow-graph inliner.
Enable inlining of trigonometric math functions in AOT that were previously not inlined.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2273943002 .
This allows inlining of these methods in the AOT optimizer.
Also fix missing inlining of some SIMD constructors (Float32x4FromInt32x4Bits and Int32x4FromFloat32x4Bits)
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2254053002 .
Certain CheckedSmiOp operations can be specialized later during optimization
when the compile type turns out to be smi, and we know that the operation
can't deoptimize.
BUG=#26761
R=vegorov@google.com
Review URL: https://codereview.chromium.org/2094613003 .
Most of the infrastructure is fixed to work with DBC stack layout:
- register allocator allocates DBC registers with the limitation that we allocate only 20 registers and bail out if anything needs spilling (there is no use implementing spilling on DBC because registers are memory locations themselves). We should be able to bump number of CPU registers on DBC up to 256 but this requires major surgery in some parts - so I postponed this;
- lazy deoptimization is implemented, eager deoptimization is not - because we don't emit any code that actually requires it. it's a minor change to support it once we have a target;
- stack scanning respects stack maps built by registers allocator;
We bailout from all unsupported instructions.
R=zra@google.com
Review URL: https://codereview.chromium.org/1992963002 .
This is a cut of the work that Todd and I collaborated on in the reload branch.
In this CL, we've dropped the loader port hacks, in other words, on stack reloading in the standalone embedder does not work yet.
- [x] Support for hot reloading of isolate source code
- [x] Unit test harness and many tests
- [x] Service protocol and Observatory support
- [x] Product build does not include support for hot reloading.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1965823002 .
Since we don't have precise liveness information inside try-catch blocks,
there are often redundant phis inside try-catch of the form
v <- phi(v, v, ..., R, v, v, ...)
This CL finds these redundant phis and replaces them with R.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1918913002 .
This reduces Uri.toString() in dart2js from 514 lines to 345 lines.
(lines are instructions or code comments).
I noticed the following:
Uri.toString() has a statement: sb.write('//');
This was lined two levels deep, with effectively the following code
for the inlining of interoplateSingle:
TestCids on constant '//':
_OneByteString -> return '//';
Uri -> fallthrough;
Message -> fallthrough;
else deopt;
if ('//' is not Uri) deopt;
String s = Uri.toString('//');
if (s is !_OneByteString) deopt;
return s;
With canonicalization of TestCidsInstr, this whole thing clears up
eliminate interoplateSingle.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/1891353003 .
- Some minor cleanups
- Return an empty array right away in the parser instead of creating an
empty array and canonicalizing it
- The canonical bit was not being set for some of the singleton objects.
R=regis@google.com
Review URL: https://codereview.chromium.org/1873143003 .