78978 Commits

Author SHA1 Message Date
Kevin Newton
bf723b21cc [ruby/yarp] More flip flop flags
Whenever you see a `not` or a `!`, the receiver of that method should
potentially be marked as a flip-flop.

https://github.com/ruby/yarp/commit/ba5977a40a
2023-08-16 17:47:32 -07:00
Kevin Newton
fb287fa425 [ruby/yarp] Support the flipflop flag
https://github.com/ruby/yarp/commit/6315890390
2023-08-16 17:47:32 -07:00
Kevin Newton
ecf2e84c05 [ruby/yarp] Add a CHANGELOG
https://github.com/ruby/yarp/commit/b490ff0919
2023-08-16 17:47:32 -07:00
Jemma Issroff
86cc82a1ab [ruby/yarp] Improved comments, moved flags after type
https://github.com/ruby/yarp/commit/4815d77e82
2023-08-16 17:47:32 -07:00
Jemma Issroff
383c47f538 [ruby/yarp] Separate yp_node_flags_t from yp_node_type_t
Prior to this commit, we folded the flags into the type. This created
extra overhead when calculating the type and setting the flags. This
commit separates them.

https://github.com/ruby/yarp/commit/b783a5678c
2023-08-16 17:47:32 -07:00
Kevin Newton
89de544442 [ruby/yarp] Set constant path write node target type
https://github.com/ruby/yarp/commit/771f7ed789
2023-08-16 17:47:32 -07:00
Kevin Newton
ee885237f6 [ruby/yarp] Fix string concat parsing
https://github.com/ruby/yarp/commit/58f839a3eb
2023-08-16 17:47:32 -07:00
Kevin Newton
77e52735f0 [ruby/yarp] Fix warnings found from gcc-analyzer and clang-analyzer
https://github.com/ruby/yarp/commit/1f9a6e05c4
2023-08-16 17:47:32 -07:00
Kevin Newton
9b952670bb [ruby/yarp] Less const_get
Right now whenever you go to create a Ruby object from a C struct
we dynamically look up the constants. This is not great for
performance. Now instead we template out a constant for each VALUE
that holds the classes, and then directly reference it.

https://github.com/ruby/yarp/commit/f4756cda77
2023-08-16 17:47:32 -07:00
Thomas E. Enebo
96aebb4265 [ruby/yarp] Address PR comments
- odd whitespace
- a couple of name changes
- properly read uint32_t when not properly aligned

https://github.com/ruby/yarp/commit/3208ee3983
2023-08-16 17:47:32 -07:00
Kevin Newton
d6f9f3e498 [ruby/yarp] Rename RescueNode#exception to RescueNode#reference
https://github.com/ruby/yarp/commit/ad0eb4b2c3
2023-08-16 17:47:32 -07:00
Kevin Newton
a793260c15 [ruby/yarp] Also rework regexp lexer to check terminators properly
https://github.com/ruby/yarp/commit/4b157a8352
2023-08-16 17:47:32 -07:00
Kevin Newton
2ef54d3855 [ruby/yarp] Rework the list lexer to check terminators properly
https://github.com/ruby/yarp/commit/60315d0f13
2023-08-16 17:47:32 -07:00
Kevin Newton
5e9397279b [ruby/yarp] Handle escaping in regexp slow path
https://github.com/ruby/yarp/commit/8dd0a1b281
2023-08-16 17:47:32 -07:00
Thomas E. Enebo
7257145320 [ruby/yarp] Clang beats gcc in pedantry
Accidentally declared int32_t and not uint32_t and it was caught
on macos.

https://github.com/ruby/yarp/commit/6581520793
2023-08-16 17:47:32 -07:00
Thomas E. Enebo
1e0749e032 [ruby/yarp] Addressed review comments.
Missing any tests and in fact this is untested so still a WIP.

https://github.com/ruby/yarp/commit/5411abd651
2023-08-16 17:47:32 -07:00
Kevin Newton
0b6a26abff [ruby/yarp] Provide slow path for finding ) in regexp when encoding changes
https://github.com/ruby/yarp/commit/c1064a65e3
2023-08-16 17:47:32 -07:00
Kevin Newton
0004565a91 [ruby/yarp] Use yp_memchr in regexp parsing
https://github.com/ruby/yarp/commit/08081dd24f
2023-08-16 17:47:32 -07:00
Benoit Daloze
1ad0d19876 [ruby/yarp] Parse individual snippets of test/fixtures/*.txt
* To ensure the parser does not try to read bytes further than the end of each snippet.

https://github.com/ruby/yarp/commit/1c4438bdde
2023-08-16 17:47:32 -07:00
Kevin Newton
3f64defe13 [ruby/yarp] Make sure lexing ? does not read off the end
https://github.com/ruby/yarp/commit/d694e3ebf2
2023-08-16 17:47:32 -07:00
Benoit Daloze
d2eb82d969 [ruby/yarp] Fix test to use the new location of yarp.so
https://github.com/ruby/yarp/commit/a22b204a11
2023-08-16 17:47:32 -07:00
Benoit Daloze
1002b777c4 [ruby/yarp] Automatically find the right line for yarp/serialize.rb newline test
https://github.com/ruby/yarp/commit/5908130541
2023-08-16 17:47:32 -07:00
Kevin Newton
820a58c228 [ruby/yarp] Hide debug methods
https://github.com/ruby/yarp/commit/aa0dc2f301
2023-08-16 17:47:32 -07:00
Kevin Newton
1ea9e444ec [ruby/yarp] Fix memory leak from constant write node creation
https://github.com/ruby/yarp/commit/0071bee0bb
2023-08-16 17:47:32 -07:00
Kevin Newton
e66e60cf69 [ruby/yarp] Handle invalid multiple parameters
https://github.com/ruby/yarp/commit/2f83265653
2023-08-16 17:47:32 -07:00
Kevin Newton
7a1c497426 [ruby/yarp] Add constant write node
https://github.com/ruby/yarp/commit/a62f2f0153
2023-08-16 17:47:32 -07:00
Kevin Newton
9c61e0c831 [ruby/yarp] Ensure token cannot begin an expression
https://github.com/ruby/yarp/commit/837522217c
2023-08-16 17:47:32 -07:00
Kevin Newton
3d032cf3e8 [ruby/yarp] Simplify creation of numerics
https://github.com/ruby/yarp/commit/e5f6ffa23a
2023-08-16 17:47:32 -07:00
Benoit Daloze
b6f26c2e4a [ruby/yarp] Use common fields for yp_string_t
* Otherwise it is undefined behavior to access the field of another `.as`.
* Accessing the right `.as` field according mode would be extra overhead.

https://github.com/ruby/yarp/commit/7dc41ee803
2023-08-16 17:47:32 -07:00
Benoit Daloze
ab2f638a27 [ruby/yarp] Test YARP.parse_file by using it in tests
https://github.com/ruby/yarp/commit/c603bba89a
2023-08-16 17:47:32 -07:00
Benoit Daloze
7cc5b22bbc [ruby/yarp] Add comment that extension.c should not contain non-trivial logic
https://github.com/ruby/yarp/commit/638f6849be
2023-08-16 17:47:32 -07:00
Benoit Daloze
e712bc9b93 [ruby/yarp] Move efficient file reading using demand paging to librubyparser
* So it can be reused by the Fiddle backend, etc and not just the C extension.
* Add YP_STRING_MAPPED to use a consistent interface for yp_string_t.
  That way yp_string_free() can be used like for other string types.
* Fix handling of empty file for !HAVE_MMAP && !_WIN32

https://github.com/ruby/yarp/commit/e40bc35801
2023-08-16 17:47:32 -07:00
Benoit Daloze
2ccaaaa101 [ruby/yarp] Add simpler exported unescape function to librubyparser
* Moves logic from the C extension to librubyparser which can be shared with the Fiddle backend.

https://github.com/ruby/yarp/commit/aa48d5e444
2023-08-16 17:47:32 -07:00
Kevin Newton
31960a9627 [ruby/yarp] Handle missing block parameters
https://github.com/ruby/yarp/commit/bc9049418d
2023-08-16 17:47:32 -07:00
Kevin Newton
eca3b93437 [ruby/yarp] **nil can be a STAR_STAR token
https://github.com/ruby/yarp/commit/33b06f252c
2023-08-16 17:47:32 -07:00
Kevin Newton
e56da35637 [ruby/yarp] Handle invalid regexps more gracefully
https://github.com/ruby/yarp/commit/584a49f123
2023-08-16 17:47:32 -07:00
Kevin Newton
4c4e75c0de [ruby/yarp] Add error cases for ustar appearing in infix position
https://github.com/ruby/yarp/commit/8736c17359
2023-08-16 17:47:32 -07:00
Kevin Newton
cededf73dc [ruby/yarp] For errored % characters, use TOKEN_PERCENT and not TOKEN_STRING_BEGIN
https://github.com/ruby/yarp/commit/2ec671fe1e
2023-08-16 17:47:32 -07:00
Kevin Newton
242f3c3a77 [ruby/yarp] Don't read off the end when parsing % literals
https://github.com/ruby/yarp/commit/aff40871e6
2023-08-16 17:47:32 -07:00
Kevin Newton
45efbadba5 [ruby/yarp] Enable all of -wconversion
https://github.com/ruby/yarp/commit/638163f6c6
2023-08-16 17:47:32 -07:00
Kevin Newton
f1658efe38 [ruby/yarp] Split out newline test
https://github.com/ruby/yarp/commit/eeb4f6cb9d
2023-08-16 17:47:32 -07:00
Kevin Newton
41e8ba01ae [ruby/yarp] Mark locations in the tree where newlines can occur
https://github.com/ruby/yarp/commit/479e835756
2023-08-16 17:47:32 -07:00
Kevin Newton
86b32dac92 [ruby/yarp] Handle pound terminator in isolation
https://github.com/ruby/yarp/commit/1cfce46107
2023-08-16 17:47:32 -07:00
Thomas E. Enebo
ede55edbd5 [ruby/yarp] Remove trailing whitespace
https://github.com/ruby/yarp/commit/04de272383
2023-08-16 17:47:32 -07:00
Thomas E. Enebo
76c77b5eca [ruby/yarp] WIP - Introduce contextually parsing programs vs evals
This is more or less the code I used in my POC in JRuby
to parse evals.  Evals depend on parent variable scopes
and will produce a different syntax tree.

Questions:
  1. How does MRI compile evals currently?  I cannot find anything.
  2. This passes in a char * of data.  It does not encode the
     variables we pass in because the system calling this already
     knows.  Is this adequate though?
  3. Can I get guidance on how best to test this?

https://github.com/ruby/yarp/commit/f441b6fd2c
2023-08-16 17:47:32 -07:00
Mike Dalessio
0f8091947d [ruby/yarp] Move the gem's C extension into lib/yarp/
and change the require from "yarp.so" to "yarp/yarp", which is more
aligned with existing community conventions for gems.

https://github.com/ruby/yarp/commit/64b70e2658
2023-08-16 17:47:32 -07:00
Jemma Issroff
c5dad5f1d7 Sync script updates 2023-08-16 17:47:32 -07:00
Nobuyoshi Nakada
f339937abb RJIT: Remove macros inherited from MJIT but no longer used 2023-08-17 08:33:52 +09:00
Nobuyoshi Nakada
0d7e847153
Consider the special node when printing
Appreciation to the reporter, Huichiao Tsai <hctsai.cs10@nycu.edu.tw>.
2023-08-16 23:52:04 +09:00
Nobuyoshi Nakada
7d3634a121
Extract GC for fd parts as TRY_WITH_GC 2023-08-16 22:53:00 +09:00