Class: CodeTools::AST::Super
- Inherits:
-
SendWithArguments
- Object
- Node
- Send
- SendWithArguments
- CodeTools::AST::Super
- Defined in:
- lib/rubinius/code/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
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
993 994 995 |
# File 'lib/rubinius/code/ast/sends.rb', line 993 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
993 994 995 |
# File 'lib/rubinius/code/ast/sends.rb', line 993 def name @name end |
Instance Method Details
#block_bytecode(g) ⇒ Object
1002 1003 1004 1005 1006 1007 1008 |
# File 'lib/rubinius/code/ast/sends.rb', line 1002 def block_bytecode(g) if @block @block.bytecode(g) else g.push_block end end |
#bytecode(g) ⇒ Object
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 |
# File 'lib/rubinius/code/ast/sends.rb', line 1010 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
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 |
# File 'lib/rubinius/code/ast/sends.rb', line 1026 def defined(g) nope = g.new_label done = g.new_label g.invoke_primitive :vm_check_super_callable, 0 g.goto_if_false nope g.push_literal "super" g.string_dup g.goto done nope.set! g.push_nil done.set! end |
#to_sexp ⇒ Object
1044 1045 1046 |
# File 'lib/rubinius/code/ast/sends.rb', line 1044 def to_sexp arguments_sexp :super end |