summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2023-11-08[PRISM] Add tests for OptionalKeywordParameterNodeJemma Issroff
This commit adds tests for the compilation of the OptionalKeywordParameterNode, and fixes cases on the RequiredKeywordParameterNode
2023-11-08[PRISM] Added tests for ForwardingParameterNode, KeywordRestParameterNodeJemma Issroff
2023-11-08[PRISM] Add tests for several parameters nodesJemma Issroff
This commit adds tests for BlockParameterNode, RequiredParameterNode, RequiredKeywordParameterNode and RestParameterNode
2023-11-08YJIT: Disable code GC (#8865)Takashi Kokubun
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2023-11-08Improve error and memory handlingAdam Hess
Apply Nobu's suggestions which improve style, memory handling and error correction. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-11-07Use embedded TypedData for Time objectsPeter Zhu
This drops the total size of a Time object from 86 bytes to 80 bytes. Running the benchmark benchmark/time_now.yml, this commit improves performance of Time.now by about 30%: ``` Time.now Branch: 13159405.4 i/s Master: 10036908.7 i/s - 1.31x slower Time.now(in: "+09:00") Branch: 2712172.6 i/s Master: 2138637.9 i/s - 1.27x slower ``` It also decreases memory usage by about 20%: ``` ary = 10_000_000.times.map { Time.now } puts `ps -o rss= -p #{$$}` ``` Branch: 961792 Master: 1196544 Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-11-07[PRISM] Implement compilation for different parametersJemma Issroff
This commit compiles most parameter types, setting appropriate values on the ISEQ_BODY. It also adds tests for callers and callees of methods, using many versions of tests from bootstraptest
2023-11-07[PRISM] CompileEnsureNodeMatt Valentine-House
2023-11-06[PRISM] Implement compilation for MultiWriteNodes, fix MultiTargetNodesJemma Issroff
Compilation now works for MultiWriteNodes and MultiTargetNodes, with nesting on MultiWrites. See the tests added in this commit for example behavior.
2023-11-06generic_ivar_set: properly check for TOO_COMPLEX on capacity transitionJean Boussier
2023-11-06[Bug #19985] Raise LoadError with the converted feature nameNobuyoshi Nakada
`Kernel#require` converts feature name objects that have the `to_path` method such as `Pathname`, but had used the original object on error and had resulted in an unexpected `TypeError`.
2023-11-05ast.rb: Fix bug for source of multibyte charactersalpaca-tc
first_column and last_column return byte positions, but existing implementations did not consider multibyte.
2023-11-03[PRISM] Fix stack consistency with Popped beginMatt Valentine-House
When a begin node is popped it only needs to putnil if that nil is going to be the return value, otherwise it can successfully be optimised out.
2023-11-03rb_ivar_defined: handle complex modulesJean Boussier
It was assuming only objects can be complex.
2023-11-03[PRISM] Fix CallNode with arguments when poppedMatt Valentine-House
Previously emitting a call node with an argument followed by another node would cause the argument to be mistakenly omitted from the argument list causing a stack underflow. ``` PRISM: ************************************************** -- raw disasm-------- 0000 putself ( 0) 0001 send <calldata:puts, 1>, nil ( 0) * 0004 pop ( 0) 0005 putobject 1 ( 0) 0007 leave ( 0) --------------------- ```
2023-11-02[PRISM] Fix popped for ForNodeJemma Issroff
2023-11-02[PRISM] Fix popped for CallOperatorWriteNodeJemma Issroff
2023-11-02[PRISM] Fix popped for Call{And,Or}WriteNodeJemma Issroff
2023-11-02[PRISM] Fix popped for SingletonClassNodeJemma Issroff
2023-11-02[PRISM] Fix popped for CaseNodeJemma Issroff
2023-11-02[PRISM] Fix popped for AssocSplatNodeJemma Issroff
2023-11-02[PRISM] Fix popped for MatchWriteNodeJemma Issroff
2023-11-02[PRISM] Fix popped for ConstantPathOperatorWriteNodeJemma Issroff
2023-11-02[PRISM] Fix popped for ConstantPathOrWriteNodeJemma Issroff
2023-11-02[PRISM] Fix popped on DefinedNodeJemma Issroff
2023-11-02[PRISM] Fixed popped for ConstantPathAndWriteNodeJemma Issroff
2023-11-02[PRISM] Fix test infrastucture, comment out failing testsJemma Issroff
Unfortunately, 84dfa0fa5e451adb87beaf497165cb5a1bc93770 introduced a bug where we were no longer testing the "popped" case because the "; 1" meant to be appended to the source was no longer functioning as intended. This commit re-introduces the popped case, and comments out all now failing tests.
2023-11-02Fix vm_getivar to handle module with TOO_COMPLEX shapeJean Boussier
2023-11-02Make every initial size pool shape a root shapePeter Zhu
This commit makes every initial size pool shape a root shape and assigns it a capacity of 0.
2023-11-02YJIT: Always define method codegen table at boot (#8807)Takashi Kokubun
2023-11-02Better handle running out of shapes in remove_shape_recursiveJean Boussier
2023-11-01Fix SystemStackError in test_run_out_of_shape_for_class_cvarPeter Zhu
2023-11-01Fix remove_class_variable for too complex classesPeter Zhu
2023-11-01remove_instance_variable: Handle running out of shapesJean Boussier
`remove_shape_recursive` wasn't considering that if we run out of shapes, it might have to transition to SHAPE_TOO_COMPLEX. When this happens, we now return with an error and the caller initiates the evacuation.
2023-11-01Fix removing non-existent ivar for too complexPeter Zhu
2023-10-31Fix remove_instance_variable for too complex generic ivarPeter Zhu
2023-10-31Fix SystemStackError for test_run_out_of_shape_for_classPeter Zhu
2023-10-31Fix remove_instance_variable for too complex classPeter Zhu
2023-10-31[PRISM] Implement compilation for SuperNodeJemma Issroff
2023-10-31[PRISM] Compile forwarding super nodeJemma Issroff
2023-10-31Fix "too complex" iv sets on generic ivar objectsAaron Patterson
We weren't taking in to account that objects with generic IV tables could go "too complex" in the IV set code. This commit takes that in to account and also ensures FL_EXIVAR is set when a geniv object transitions to "too complex" Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-10-31Handle SHAPE_TOO_COMPLEX in `generic_ivar_set`Jean Boussier
2023-10-31Handle running out of shapes in `Object#dup`Jean Boussier
There is a handful of call sites where we may transition to OBJ_TOO_COMPLEX_SHAPE if we just ran out of shapes, but that weren't handling it properly.
2023-10-31[PRISM] Implement compilation for PostExecutionNodeJemma Issroff
This commit implements compilation for the PostExeuctionNode by using the ScopeNode to create child iseqs where appropriate.
2023-10-31Add defined array nodeHParker
2023-10-31compile defined with nested constants and stovetopHParker
2023-10-31Keep unused literal nodesyui-knk
For static analysis, it’s better to keep unused literal nodes. If simply change `block_append` to fall through, both "unused literal ignored" and "possibly useless use of a literal in void context" warnings are shown for the same line. But it’s verbose then remove "unused literal ignored" warning. This kind of optimization is already implemented on compile.c. `compile_block` calls `iseq_compile_each0` with `popped = 1` when NODE_BLOCK has next.
2023-10-30[Prism] Add ForNode testsMatt Valentine-House
2023-10-30Optimize regexp matching for look-around and atomic groups (#7931)Hiroya Fujinami
2023-10-28Extract transcoding assertionsNobuyoshi Nakada
- Prefix `check_both_ways` with `assert_` to show proper failure lines. - Extract dedicated assertions for Encoding::UndefinedConversionError and Encoding::InvalidByteSequenceError.