Class: Nydp::InterpretedFunctionWithoutClosure

Inherits:
InterpretedFunction show all
Defined in:
lib/nydp/interpreted_function.rb

Constant Summary

Constants inherited from InterpretedFunction

Nydp::InterpretedFunction::NIL

Instance Attribute Summary

Attributes inherited from InterpretedFunction

#arg_names, #body, #context_builder

Instance Method Summary collapse

Methods inherited from InterpretedFunction

build, #can_do?, compile_body, #compile_do_expr_to_ruby, #compile_to_ruby, index_parameters, #inspect, #lexical_reach, #nydp_type, #run_body, #to_s

Methods included from Helper

#cons, #list, #literal?, #pair?, #sig, #sym, #sym?

Methods included from Converter

#n2r, #r2n, #rubify

Instance Method Details

#execute(vm) ⇒ Object



251
252
253
254
# File 'lib/nydp/interpreted_function.rb', line 251

def execute vm
  # vm.push_arg self
  self
end

#invoke(vm, arg_values) ⇒ Object



242
243
244
245
246
247
248
249
# File 'lib/nydp/interpreted_function.rb', line 242

def invoke vm, arg_values
  cc                 = vm.current_context
  vm.current_context = set_args(vm.current_context, arg_values)
  res                = run_body(vm)
  vm.current_context = cc
  res
  # vm.push_instructions self.body, set_args(vm.current_context, arg_values)
end

#invoke_1(vm) ⇒ Object



206
207
208
209
210
211
212
213
# File 'lib/nydp/interpreted_function.rb', line 206

def invoke_1 vm
  cc                 = vm.current_context
  vm.current_context = set_args_0(vm.current_context)
  res                = run_body(vm)
  vm.current_context = cc
  res
  # vm.push_instructions self.body, set_args_0(vm.current_context)
end

#invoke_2(vm, arg) ⇒ Object



215
216
217
218
219
220
221
222
# File 'lib/nydp/interpreted_function.rb', line 215

def invoke_2 vm, arg
  cc                 = vm.current_context
  vm.current_context = set_args_1(vm.current_context, arg)
  res                = run_body(vm)
  vm.current_context = cc
  res
  # vm.push_instructions self.body, set_args_1(vm.current_context, arg)
end

#invoke_3(vm, arg_0, arg_1) ⇒ Object



224
225
226
227
228
229
230
231
# File 'lib/nydp/interpreted_function.rb', line 224

def invoke_3 vm, arg_0, arg_1
  cc                 = vm.current_context
  vm.current_context = set_args_2(vm.current_context, arg_0, arg_1)
  res                = run_body(vm)
  vm.current_context = cc
  res
  # vm.push_instructions self.body, set_args_2(vm.current_context, arg_0, arg_1)
end

#invoke_4(vm, arg_0, arg_1, arg_2) ⇒ Object



233
234
235
236
237
238
239
240
# File 'lib/nydp/interpreted_function.rb', line 233

def invoke_4 vm, arg_0, arg_1, arg_2
  cc                 = vm.current_context
  vm.current_context = set_args_3(vm.current_context, arg_0, arg_1, arg_2)
  res                = run_body(vm)
  vm.current_context = cc
  res
  # vm.push_instructions self.body, set_args_3(vm.current_context, arg_0, arg_1, arg_2)
end