Skip to content

Remove obsolete blockiseq flag #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/syntax_tree/yarv/assembler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def visit_string_literal(node)
"FCALL" => CallData::CALL_FCALL,
"VCALL" => CallData::CALL_VCALL,
"ARGS_SIMPLE" => CallData::CALL_ARGS_SIMPLE,
"BLOCKISEQ" => CallData::CALL_BLOCKISEQ,
"KWARG" => CallData::CALL_KWARG,
"KW_SPLAT" => CallData::CALL_KW_SPLAT,
"TAILCALL" => CallData::CALL_TAILCALL,
Expand Down
34 changes: 20 additions & 14 deletions lib/syntax_tree/yarv/calldata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,26 @@ module YARV
# This is an operand to various YARV instructions that represents the
# information about a specific call site.
class CallData
CALL_ARGS_SPLAT = 1 << 0
CALL_ARGS_BLOCKARG = 1 << 1
CALL_FCALL = 1 << 2
CALL_VCALL = 1 << 3
CALL_ARGS_SIMPLE = 1 << 4
CALL_BLOCKISEQ = 1 << 5
CALL_KWARG = 1 << 6
CALL_KW_SPLAT = 1 << 7
CALL_TAILCALL = 1 << 8
CALL_SUPER = 1 << 9
CALL_ZSUPER = 1 << 10
CALL_OPT_SEND = 1 << 11
CALL_KW_SPLAT_MUT = 1 << 12
flags = %i[
CALL_ARGS_SPLAT
CALL_ARGS_BLOCKARG
CALL_FCALL
CALL_VCALL
CALL_ARGS_SIMPLE
CALL_KWARG
CALL_KW_SPLAT
CALL_TAILCALL
CALL_SUPER
CALL_ZSUPER
CALL_OPT_SEND
CALL_KW_SPLAT_MUT
]

# Insert the legacy CALL_BLOCKISEQ flag for Ruby 3.2 and earlier.
flags.insert(5, :CALL_BLOCKISEQ) if RUBY_VERSION < "3.3"

# Set the flags as constants on the class.
flags.each_with_index { |name, index| const_set(name, 1 << index) }

attr_reader :method, :argc, :flags, :kw_arg

Expand Down Expand Up @@ -50,7 +57,6 @@ def inspect
names << :FCALL if flag?(CALL_FCALL)
names << :VCALL if flag?(CALL_VCALL)
names << :ARGS_SIMPLE if flag?(CALL_ARGS_SIMPLE)
names << :BLOCKISEQ if flag?(CALL_BLOCKISEQ)
names << :KWARG if flag?(CALL_KWARG)
names << :KW_SPLAT if flag?(CALL_KW_SPLAT)
names << :TAILCALL if flag?(CALL_TAILCALL)
Expand Down