Commit 52672ded
52672ded9c57Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 6 files · +3 added · ~3 modified
Description
Add module method dispatch/return type, port 5 more benchmarks
- Module.method() codegen dispatch (was unsupported)
- Module method return type resolution in resolve_class_types
- Fix: module class methods no longer default to FLOAT return type
- OBJECT nil? → ptr == NULL runtime check
Benchmarks: splay (23x), structaref (>21x), structaset, gcbench (19x), getivar-module (>100x), object-new-initialize, send_cfunc_block 82/82 tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]
Details
- Commit
- 52672ded9c57
- Parent
- 4e2092a74656
examples/bm_getivar_module.rbaddedView file
1+
# getivar-module benchmark (from yjit-bench)2+
# Uses module-level ivar access via class method3+
4+
module TheModule5+
@levar = 16+
7+
def self.get_value_loop8+
sum = 09+
i = 010+
while i < 100000011+
sum = sum + @levar12+
sum = sum + @levar13+
sum = sum + @levar14+
sum = sum + @levar15+
sum = sum + @levar16+
sum = sum + @levar17+
sum = sum + @levar18+
sum = sum + @levar19+
sum = sum + @levar20+
sum = sum + @levar21+
i = i + 122+
end23+
sum24+
end25+
end26+
27+
total = 028+
idx = 029+
while idx < 1030+
total = total + TheModule.get_value_loop31+
idx = idx + 132+
end33+
puts total34+
puts "done"examples/bm_object_new_init.rbaddedView file
Loading diff…
examples/bm_send_cfunc_block.rbaddedView file
Loading diff…
src/codegen.cmodifiedView file
Loading diff…
src/expr.cmodifiedView file
Loading diff…
src/type.cmodifiedView file
Loading diff…