Class: Rubinius::ToolSet.current::TS::AST::Super
- Inherits:
-
SendWithArguments
- Object
- Node
- Send
- SendWithArguments
- Rubinius::ToolSet.current::TS::AST::Super
- Defined in:
- lib/rubinius/ast/sends.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from SendWithArguments
Attributes inherited from Send
#privately, #receiver, #variable, #vcall_style
Attributes inherited from Node
Instance Method Summary collapse
- #block_bytecode(g) ⇒ Object
- #bytecode(g) ⇒ Object
- #defined(g) ⇒ Object
-
#initialize(line, arguments) ⇒ Super
constructor
A new instance of Super.
- #to_sexp ⇒ Object
Methods inherited from SendWithArguments
Methods inherited from Send
#arguments_sexp, #check_local_reference, #receiver_sexp, #sexp_name, #value_defined
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, arguments) ⇒ Super
Returns a new instance of Super.
905 906 907 908 909 910 |
# File 'lib/rubinius/ast/sends.rb', line 905 def initialize(line, arguments) @line = line @block = nil @name = nil @arguments = ActualArguments.new line, arguments end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
903 904 905 |
# File 'lib/rubinius/ast/sends.rb', line 903 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
903 904 905 |
# File 'lib/rubinius/ast/sends.rb', line 903 def name @name end |
Instance Method Details
#block_bytecode(g) ⇒ Object
912 913 914 915 916 917 918 |
# File 'lib/rubinius/ast/sends.rb', line 912 def block_bytecode(g) if @block @block.bytecode(g) else g.push_block end end |
#bytecode(g) ⇒ Object
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 |
# File 'lib/rubinius/ast/sends.rb', line 920 def bytecode(g) pos(g) @name = g.state.super.name if g.state.super? @arguments.bytecode(g) block_bytecode(g) if @arguments.splat? g.send_super @name, @arguments.size, true else g.send_super @name, @arguments.size end end |
#defined(g) ⇒ Object
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 |
# File 'lib/rubinius/ast/sends.rb', line 936 def defined(g) nope = g.new_label done = g.new_label g.invoke_primitive :vm_check_super_callable, 0 g.gif nope g.push_literal "super" g.string_dup g.goto done nope.set! g.push :nil done.set! end |
#to_sexp ⇒ Object
954 955 956 |
# File 'lib/rubinius/ast/sends.rb', line 954 def to_sexp arguments_sexp :super end |