We have tests that disable it but we train app-jit snapshot for Kernel with field guards enabled so
we need to make sure that Kernel isolate runs with correct settings matching the settings at the time
when app-jit snapshot was created.
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2715213008 .
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 .
This pattern ensures the generation of 'and' instructions on the Smi x Smi path of a polymorphic & operation.
There are two 'and' operations on most simple _InternalLinkedHashMap and _CompactLinkedHashSet operations. One of the inputs, the hashCode, is occasionally a _Bigint. This change ensures that the usual case path has an 'and' instruction instead of a call to _IntegerImplementation.&
R=regis@google.com
Review URL: https://codereview.chromium.org/1913663002 .
We can have stores inlined in the optimizer that are not initializing stores.
Mark initializing stores in the parser instead to distinguish
initializing- and non-initializing stores more precisely.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/2112973002 .
Move some common code into the FlowGraphInliner to avoid duplication.
Also, only emit the receiver class check when necessary in the first place.
There is more duplicate code in jit_optimizer.cc and aot_optimizer.cc which is
independent of the compilation mode. This CL is just a step.
Removed receiver class check for SIMD operations that require unboxing: The unbox operation already checks the argument type.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/2102663003 .
- [x] Add an is static call bit to ICData
- [x] Rewrite the reset ICData iterators to rely on that bit rather than the function's ic data map
BUG=
Review URL: https://codereview.chromium.org/2064693003 .
Rework how we check guarded state consistency in background compiler.
Background compiler was storing original fields inside guarded fields list. This caused a race during inlining when inliner would copy guarded fields one by one from the callee function into the caller, because ParsedFunction::AddToGuardedFields looks at the guarded_cid to filter out those fields that should not be guarded.
As a result if some guarded field transitioned to unguarded (kDynamicCid) after callee graph construction but before list of guarded fields were copied then AddToGuardedFields would simply skip that field because it now has guarded_cid() == kDynamicCid.
We fix this race by always placing copies into the list of guarded fields and unwrapping them only in FinalizeCode.
Placing the copies also allows us to simplify a lot of code that was trying to verify guarded state consistency before committing the generated optimized code - now that we store copies in the list we can just compare their state to the originals and abort if the state is different.
Additionally fix deduplication check that was comparing original fields with copies - resulting in adding the same field into the list multiple times.
Add an assertion that verifies that we are not trying to access guarded_cid of original field from background compiler.
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org/2006793002 .
CHA::HasOverride skips non-finalized classes when looking for overrides which means that we will install incorrect code if some subclass with an override was finalized while compilation was in progress.
To catch situations like this we record the number of finalized subclasses that class had
when CHA made the first negative decision about it (e.g. that it has no subclasses or that it has no overrides for some function) and before installing the code we check that number of subclasses matches.
Additionally renamed "leaf classes" to "guarded classes" because those classes are not necessarily leaf.
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org/2002583002 .
Added support for external string using flow graph based intrinsics
which helps with precompiled code, but also polymorphic calls in jitted code.
I also added support for the missing cases in the flow graph optimizer.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/1961393002 .
Use the existing class-id check for dense ranges in more places.
Previously we would fall back to megamorphic lookup with >4 cids,
even though we can check cid ranges up to word-size efficiently.
Next step is to generalize the dense class id checks to multiple
word-sizes.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/1847293002 .
With catch blocks appearing as additional function entry blocks,
there can be phis for the receiver (parameter 0).
This CL fixes the problem that the receiver type information
was lost in the presence of try-catch.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/1841073003 .