Commit graph

625 commits

Author SHA1 Message Date
Matt Valentine-House
dcb9ded6c9 [PRISM] Fix CallNode with arguments when popped
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-03 07:28:05 +00:00
Jemma Issroff
c6f5c64639 [PRISM] Fix popped for ForNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
7f18448a8e [PRISM] Fix popped for CallOperatorWriteNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
d8bdb15a8b [PRISM] Fix popped for Call{And,Or}WriteNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
5acced49c2 [PRISM] Fix popped for SingletonClassNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
33f18b3d2f [PRISM] Fix popped for CaseNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
62baf723b6 [PRISM] Fix popped for AssocSplatNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
8b4b3b1d38 [PRISM] Fix popped for MatchWriteNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
0359f9ca67 [PRISM] Fix popped for ConstantPathOperatorWriteNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
ddf12e8a3b [PRISM] Fix popped for ConstantPathOrWriteNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
ca24136da6 [PRISM] Fix popped on DefinedNode 2023-11-02 17:46:43 -03:00
Jemma Issroff
698654ca84 [PRISM] Fixed popped for ConstantPathAndWriteNode 2023-11-02 17:46:43 -03:00
Kevin Newton
717fb5bb0b [prism] Use a pointer for optional node list 2023-11-01 10:36:21 -04:00
Jemma Issroff
b7a3e2e71d
[PRISM] Remove unnecessary variable 2023-10-31 15:57:25 -03:00
Jemma Issroff
b3744c749d [PRISM] Implement compilation for SuperNode 2023-10-31 13:59:40 -03:00
Jemma Issroff
57748ef2a2 [PRISM] Compile forwarding super node 2023-10-31 13:08:09 -03:00
Jemma Issroff
85ad102532 [PRISM] Implement compilation for PostExecutionNode
This commit implements compilation for the PostExeuctionNode by
using the ScopeNode to create child iseqs where appropriate.
2023-10-31 12:51:06 -03:00
HParker
d8a9245513 Add defined array node 2023-10-31 07:01:00 -03:00
HParker
b05a7bc512 compile defined with nested constants and stovetop 2023-10-31 07:01:00 -03:00
Matt Valentine-House
962c62057f Fix warning in Prism compile For Node 2023-10-31 09:01:56 +00:00
Jemma Issroff
f0b7895637 [PRISM] Implement all argument types for CallNodes 2023-10-30 18:07:04 -03:00
Matt Valentine-House
b17b0336b6 Document TEMP_CONSTANT_IDENTIFIER 2023-10-30 19:44:42 +00:00
Matt Valentine-House
9249b8622b Move constant indexing into rb_translate_prism 2023-10-30 19:44:42 +00:00
Matt Valentine-House
5dfba84cff [Prism] Compile ForNode
Fixes ruby/prism#1648
2023-10-30 19:44:42 +00:00
Matt Valentine-House
b0f715fa3b More accurate functions documentation 2023-10-30 19:44:42 +00:00
Kevin Newton
e3258dd627
Integrate new prism multi target names 2023-10-26 15:03:33 -04:00
eileencodes
a082e560bb [PRISM] Implement regex encoding flags
Added the  correct encoding to the allocated regex. This required making
a new method to set the encoding and pass that to `rb_enc_reg_new`
instead of `rb_reg_new`. The former `rb_reg_new` would set the encoding
to ASCII8BIT regardless of encoding flag.
2023-10-26 11:11:52 -07:00
Jemma Issroff
4f8a33eb05 [PRISM] Cleanup macro usage for common ADD_INSN 2023-10-26 12:47:28 -03:00
HParker
8f4a8cd05b teach prism define to compile basic types 2023-10-26 11:54:26 -03:00
Jemma Issroff
9570a88bb3 [PRISM] Implement compilation for ConstantPathAndWriteNode 2023-10-26 11:42:15 -03:00
Jemma Issroff
ec2878c11b [PRISM] Implement compilation for ConstantPathOrWriteNode 2023-10-26 11:42:15 -03:00
Jemma Issroff
b5f61750b9 [PRISM] Implemented ConstantPathOperatorWriteNode 2023-10-26 11:42:15 -03:00
Jemma Issroff
bfb9b5e699 [PRISM] Implement compilation for CaseNode 2023-10-26 08:45:43 -03:00
Jemma Issroff
8e5744588f [PRISM] Implement CallOperatorWriteNode 2023-10-26 07:15:35 -03:00
Jemma Issroff
68a81b44e3 [PRISM] Implement compilation for CallOrWriteNode 2023-10-26 07:15:35 -03:00
Jemma Issroff
e28a033035 [PRISM] Extract helper to use for CallOrWriteNode 2023-10-26 07:15:35 -03:00
Jemma Issroff
2a8dbb1323 [PRISM] Implemented compilation for CallAndWriteNode 2023-10-26 07:15:35 -03:00
Jemma Issroff
b5f6e2a7c4 [PRISM] ScopeNode doesn't need void * anymore 2023-10-25 18:18:35 -03:00
Jemma Issroff
0abf2d86b9 [PRISM] Move pm_scope_node_init to prism_compile.c
pm_scope_node_init is only used for CRuby, so should not live in the
ruby/prism repo. We will merge the changes here first so they're
not breaking, and will then remove from ruby/prism
2023-10-25 18:18:35 -03:00
Jemma Issroff
f87c31f3e0 [PRISM] Add PM_POP macro, cleanup missing macro usage 2023-10-25 17:27:00 -03:00
Jemma Issroff
8197bbb0a9 [PRISM] Toggled accepts_no_kwarg to true on NoKeywordsParameterNode 2023-10-25 13:02:44 -03:00
Jemma Issroff
fb0a30166d [PRISM] Add tests for ParametersNode 2023-10-25 13:02:44 -03:00
Jemma Issroff
fe0827013b [PRISM] Implement NoKeywordsParameterNode 2023-10-25 13:02:44 -03:00
Jemma Issroff
39207b496e [PRISM] Implement compilation for PreExecutionNodes 2023-10-23 13:22:55 -07:00
Jemma Issroff
5abff9dbff [PRISM] Add PM_PUTNIL macro 2023-10-23 13:22:55 -07:00
Jemma Issroff
7c4e3ca27b [PRISM] Fix AssocSplat node
This commit emits the correct instructions for hashes which have
both AssocSplat and Assoc nodes contained within them
2023-10-23 13:15:52 -07:00
Jemma Issroff
60196b4780 [PRISM] Fix __LINE__ to be 1-indexed by default 2023-10-23 13:59:48 -03:00
Jemma Issroff
62c674f98c [PRISM] Fix compilation for IfNode, UnlessNode
This properly implements the branch condition for FlipFlopNodes on
If / UnlessNodes, and also fixes the bug in UnlessNodes
2023-10-23 12:37:50 -03:00
Jemma Issroff
01787d53bf [PRISM] Setup encodings in prism compiler 2023-10-20 16:29:06 -03:00
Jemma Issroff
a426a230de [PRISM] Fixed StringConcatNode, uncommented tests 2023-10-20 11:49:53 -03:00