This CL is a draft implementation of optimizing 'is', int and double
operators using statically known strong mode types in Dart VM AOT.
As of now, not all cases are handled and null checks are not inserted
(required for correctness). The new logic is added under
--experimental-strong-mode flag.
The primary reason for submitting this code is to keep up with ongoing
refactoring of Dart VM compiler.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Ia441fa3e346a184a1e5c87d0749aec652e2cde0a
Reviewed-on: https://dart-review.googlesource.com/4144
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Originally these passes were a single confusingly named flow_graph_optimizer
pass, they later were completely split by duplicating flow_graph_optimizer
twice as jit_optimizer.cc and aot_optimizer.cc and tweaking them in few
places.
Duplication has been done in anticipation that these passes will diverge
considerably, however simple diffing reveals that in 2 years they have
not actually diverged much at all.
Diffing also reveals numerous bugs and inconsistencies between jit_optimizer
and aot_optimizer.
It does not make sense to keep these files duplicated so this change merges
them back together - extracting most of their common behaviour into
CallSpecializer base class.
The separation is not entirely clean - for simplicity we introduce
the knowledge about precompiled_mode into CallSpecializer base class.
You can look for FLAG_precompiled_mode and FLAG_use_field_guards in the
call_specializer.cc to see where base class has to be aware about both AOT and
JIT mode.
This change also renames XyzOptimizer to XyzCallSpecializer because the main
optimization these classes were doing was specialization of calls based on
type feedback or inferred types.
Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I0b062c4b7549d08b1bee9303d92a3fb549f54e21
Reviewed-on: https://dart-review.googlesource.com/3640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
reified generic function.
Clean up code to avoid similar issue in the future, i.e. make it clear whether
the passed type argument vector is counted or not by using better names.
Change-Id: I60fd6f6acb302235d8c1ae4f2bc4bf459724421e
Reviewed-on: https://dart-review.googlesource.com/3400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL adds a couple of new assertions to the compiler:
1. Check for 'use_speculative_inlining' in FlowGraphCompiler::AddDeoptStub
enables early detection of the deopt path generation in AOT.
Although this condition is also detected later (in precompiler),
it is much more obvious and easy to debug it with early assertion
failure, pointing directly to the place which triggered deopt generation.
2. Check register assignment in UnboxInstr::EmitLoadFromBox() for ia32
and 32-bit arm to ensure the correctness of generated code.
Also, this CL includes minor refactoring of UnboxInstr::ComputeCanDeoptimize()
to more closely match UnboxInstr::EmitNativeCode().
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Icf6129d54f3da50c043aab84e5e3ee524c264aec
Reviewed-on: https://dart-review.googlesource.com/3305
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
New folder structure (nested under vm/):
- compiler/
- jit/ - JIT specific code
- aot/ - AOT specific code
- backend/ - all middle-end and back-end code (IL, flow graph)
- assembler/ - assemblers and disassemblers
- frontend/ - front ends (AST -> IL, Kernel -> IL)
compiler/README.md would be the documentation root for the compiler
pipeline
Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>