| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
* ZJIT: Add stats for cfuncs that are not optimized
* ZJIT: Add IncrCounterPtr HIR instead
From `lobsters`
```
Top-20 Unoptimized C functions (73.0% of total 15,276,688):
Kernel#is_a?: 2,052,363 (13.4%)
Class#current: 1,892,623 (12.4%)
String#to_s: 975,973 ( 6.4%)
Hash#key?: 677,623 ( 4.4%)
String#empty?: 636,468 ( 4.2%)
TrueClass#===: 457,232 ( 3.0%)
Hash#[]=: 455,908 ( 3.0%)
FalseClass#===: 448,798 ( 2.9%)
ActiveSupport::OrderedOptions#_get: 377,468 ( 2.5%)
Kernel#kind_of?: 339,551 ( 2.2%)
Kernel#dup: 329,371 ( 2.2%)
String#==: 324,286 ( 2.1%)
String#include?: 297,528 ( 1.9%)
Hash#[]: 294,561 ( 1.9%)
Array#include?: 287,145 ( 1.9%)
Kernel#block_given?: 283,633 ( 1.9%)
BasicObject#!=: 278,874 ( 1.8%)
Hash#delete: 250,951 ( 1.6%)
Set#include?: 246,447 ( 1.6%)
NilClass#===: 242,776 ( 1.6%)
```
From `liquid-render`
```
Top-20 Unoptimized C functions (99.8% of total 5,195,549):
Hash#key?: 2,459,048 (47.3%)
String#to_s: 1,119,758 (21.6%)
Set#include?: 799,469 (15.4%)
Kernel#is_a?: 214,223 ( 4.1%)
Integer#<<: 171,073 ( 3.3%)
Integer#/: 127,622 ( 2.5%)
CGI::EscapeExt#escapeHTML: 56,971 ( 1.1%)
Regexp#===: 50,008 ( 1.0%)
String#empty?: 43,990 ( 0.8%)
String#===: 36,838 ( 0.7%)
String#==: 21,309 ( 0.4%)
Time#strftime: 21,251 ( 0.4%)
String#strip: 15,271 ( 0.3%)
String#scan: 13,753 ( 0.3%)
String#+@: 12,603 ( 0.2%)
Array#include?: 8,059 ( 0.2%)
String#+: 5,295 ( 0.1%)
String#dup: 4,606 ( 0.1%)
String#-@: 3,213 ( 0.1%)
Class#generate: 3,011 ( 0.1%)
```
|
|
No point taking the panic risks with RefCell when most fields in it are
already in a Cell. Put `iseq` in a Cell and we no longer need the
wrapping. Saves memory, too.
|
|
|
|
|
|
|
|
* ZJIT: Incorporate bb0-prologue and PC check into HIR
* Fix an outdated comment
* Use shallow clone for LoadPC and EntryPoint
* Reproduce the actual HIR graph to pass validation
* Fill out param types for jit_entry_block
* Add Type::from_cptr
* Add a TODO comment about Const::CPtr printing
|
|
* ZJIT: Allow testing JIT code on zjit-test
* Resurrect TestingAllocator tests
|
|
ZJIT: Add stack overflow check to gen_ccall_variadic
|
|
|
|
It's not just the default allocator; other allocators are also leaf.
|
|
* ZJIT: Avoid unnecessary `PopOpnds` codegen
If there's no opnds to restore, we don't need to do anything.
* ZJIT: Avoid unnecessary sub_into when there's no opnds to allocate
|
|
We can use `Vec<Opnd>` instead of `Vec<(Opnd, Opnd)>` in NewHash HIR
as it's the only usage of such type, which requires special handling.
|
|
ZJIT: Measure writing to locals with level > 0
|
|
This is a) a lot of memory traffic and b) is another good proxy for our
ability to strength reduce method calls.
|
|
* ZJIT: Compile sendforward with dynamic dispatch
* Reload locals only if it has blockiseq
* Add a test case of ... with other args
|
|
* ZJIT: Support variadic C calls
This reduces the `dynamic_send_count` in `liquid-render` by ~21%
* ZJIT: Reuse gen_push_frame
* ZJIT: Avoid optimizing variadic C call when tracing is enabled
|
|
|
|
|
|
This has fewer effects (can be elided!) and will eventually get better
codegen, too.
Fix https://github.com/Shopify/ruby/issues/752
|
|
* ZJIT: Split Insn::Const from Insn::GetBlockParamProxy
* Print [BlockParamProxy]
* Link a TODO comment to a Shopify/ruby issue
|
|
I thought about creating a new HIR like `SendWithoutBlockFailedToOptimize` that can carry very specific reasons later. But it'll mean adding it to every branch matching `SendWithoutBlock` and may make code unnecessarily complicated.
So I take the easier path for now:
```
Top-4 send fallback def_types (100.0% of total 21,375,357):
cfunc: 20,164,487 (94.3%)
optimized: 1,197,897 ( 5.6%)
attrset: 12,953 ( 0.1%)
alias: 20 ( 0.0%)
```
|
|
* functional debug mechanism; small refactor
* make all tests pass
* clean up implementation of debug mechanism for gen_prepare_call_with_gc
* revert unnecessary change to gen_object_alloc
* make ObjectAlloc non-leaf
* fix merge error; reintroduce accidentally deleted counter
* remove outdated comment
* changes as per review comments
* make set_stack_canary more stable
* add todo comment to specialize object_alloc
* revert whitespace changes
* create gen_prepare_leaf_call_with_gc helper
* fix spacing
|
|
|
|
Previously, the included test crashed or turned into an infinite
loop due to the missing check.
|
|
* Revert "ZJIT: Removed unused self_val from Send"
This reverts commit 13c2f8d5c2b41ec78344ae60f9b5ec1564029418.
* Revert "ZJIT: Removed unused self_val from InvokeSuper"
This reverts commit 877b625922e0f8de4e7ad801dd0306e69b34d263.
* ZJIT: Rename self_val in dispatching HIRs to recv
* ZJIT: Remove unnecessary constructor param names
|
|
ZJIT: Support invokeblock insn
Basically like other send-ish insns, except that it doesn't pop the receiver.
|
|
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
|
|
* failing test for ObjToString optimization with GuardType
* profile ObjToString receiver and rewrite with guard
* adjust integration tests for objtostring type guard optimization
* Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings
* codegen for GuardTypeNot
* typo fixes
* better name for tests; fix side exit reason for GuardTypeNot
* revert accidental change
* make bindgen
* Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
|
|
|
|
|
|
Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
|
|
This fixes:
```
warning: unused import: `ParseError`
--> zjit/src/codegen.rs:20:61
|
20 | use crate::hir::{Const, FrameState, Function, Insn, InsnId, ParseError};
| ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
```
|
|
ZJIT: Add patchpoint for TracePoint activation
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
|
|
* ZJIT: Support compiling ISEQs for opt_pc = 0
* Test send with optional arguments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Failing optimization tests for NewRangeFixnum
* NewRangeFixnum general idea
* Use gen_prepare_call_with_gc on gen_new_range_fixnum; add additional hir tests
* Remove unused NewRange rewrite trigger when neither range is Fixnum literal
* Remove misleading 'profiled' name in range optimization tests
* Adjustments as per review comments
* Include new_range_fixnum tests
* remove non-ASCII character from comments as per PR review
* remove non-ASCII character from comments as per PR review
|
|
|
|
Specialize monomorphic `GetIvar` into:
* `GuardType(HeapObject)`
* `GuardShape`
* `LoadIvarEmbedded` or `LoadIvarExtended`
This requires profiling self for `getinstancevariable` (it's not on the operand
stack).
This also optimizes `GetIvar`s that happen as a result of inlining
`attr_reader` and `attr_accessor`.
Also move some (newly) shared JIT helpers into jit.c.
|