Class: Duby::JVM::Types::JavaDynamicMethod
- Inherits:
-
JavaMethod
- Object
- JavaCallable
- JavaConstructor
- JavaMethod
- Duby::JVM::Types::JavaDynamicMethod
- Defined in:
- lib/duby/jvm/types/methods.rb
Instance Attribute Summary
Attributes inherited from JavaCallable
Instance Method Summary collapse
- #argument_types ⇒ Object
- #call(compiler, ast, expression) ⇒ Object
- #declaring_class ⇒ Object
-
#initialize(name, *types) ⇒ JavaDynamicMethod
constructor
A new instance of JavaDynamicMethod.
- #return_type ⇒ Object
Methods inherited from JavaMethod
#abstract?, #actual_return_type, #call_special, #constructor?, #static?, #void?
Methods inherited from JavaConstructor
#actual_return_type, #constructor?, #exceptions
Methods inherited from JavaCallable
#field?, #name, #parameter_types
Methods included from ArgumentConversion
Constructor Details
#initialize(name, *types) ⇒ JavaDynamicMethod
Returns a new instance of JavaDynamicMethod.
256 257 258 259 |
# File 'lib/duby/jvm/types/methods.rb', line 256 def initialize(name, *types) @name = name @types = types end |
Instance Method Details
#argument_types ⇒ Object
269 270 271 |
# File 'lib/duby/jvm/types/methods.rb', line 269 def argument_types @types end |
#call(compiler, ast, expression) ⇒ Object
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/duby/jvm/types/methods.rb', line 273 def call(compiler, ast, expression) target = ast.target.inferred_type ast.target.compile(compiler, true) ast.parameters.each do |param| param.compile(compiler, true) end compiler.method.invokedynamic( target, "dyn:callPropWithThis:#{name}", [return_type, target, *@types]) unless expression compiler.method.pop end compiler.bootstrap_dynamic end |
#declaring_class ⇒ Object
265 266 267 |
# File 'lib/duby/jvm/types/methods.rb', line 265 def declaring_class java.lang.Object end |