Class: CastOff::Compiler::SimpleIR::CastOffFetchArgs

Inherits:
VMInsnIR show all
Defined in:
lib/cast_off/compile/ir/call_ir.rb

Constant Summary

Constants included from Instruction

Instruction::BlockSeparator, Instruction::BranchInstruction, Instruction::IgnoreInstruction, Instruction::JumpOrReturnInstruction, Instruction::SupportInstruction, Instruction::TypeInfoUser, Instruction::VM_CALL_ARGS_BLOCKARG_BIT, Instruction::VM_CALL_ARGS_SPLAT_BIT, Instruction::VM_CALL_FCALL_BIT, Instruction::VM_CALL_OPT_SEND_BIT, Instruction::VM_CALL_SUPER_BIT, Instruction::VM_CALL_TAILCALL_BIT, Instruction::VM_CALL_TAILRECURSION_BIT, Instruction::VM_CALL_VCALL_BIT

Instance Attribute Summary

Attributes inherited from VMInsnIR

#argv

Attributes inherited from CallIR

#argc, #result_variable, #return_value, #values, #variables, #variables_without_result

Attributes inherited from IR

#alias, #insn

Instance Method Summary collapse

Methods inherited from VMInsnIR

#dont_duplicate_if_harmless, #should_be_alive?

Methods inherited from CallIR

#can_not_unbox, #harmless?, #mark, #param_irs, #param_variables, #propergate_boxed_value, #propergate_exact_class, #sampling_return_value, #sampling_return_value?, #should_be_alive?, #unboxing_prelude

Methods included from Util

#bug, #dlog, #todo, #vlog

Methods inherited from IR

#add_sampling_variable, #alive, #alive?, #dispatch_method?, #generate_guard, #get_definition, #get_definition_str, #get_usage, #get_variable, #inlining_target?, #propergate_boxed_value, #reset, #sampling_variable, #set_info, #standard_guard_target, #unboxing_prelude, #vanish, #vanish?

Constructor Details

#initialize(param, argc, return_value, insn, cfg) ⇒ CastOffFetchArgs

Returns a new instance of CastOffFetchArgs.



1131
1132
1133
# File 'lib/cast_off/compile/ir/call_ir.rb', line 1131

def initialize(param, argc, return_value, insn, cfg)
  super(param, argc, return_value, insn, cfg)
end

Instance Method Details

#propergate_guard_usageObject



1135
1136
1137
1138
# File 'lib/cast_off/compile/ir/call_ir.rb', line 1135

def propergate_guard_usage()
  params = param_irs()
  params.each{|p| p.need_guard(false)}
end

#side_effect?Boolean

Returns:

  • (Boolean)


1167
1168
1169
# File 'lib/cast_off/compile/ir/call_ir.rb', line 1167

def side_effect?
  true
end

#to_c(params) ⇒ Object



1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
# File 'lib/cast_off/compile/ir/call_ir.rb', line 1140

def to_c(params)
  ret = []
  ret << super(params)
  param = param_variables()
  argv = @operands
  if argv[0]
    # root iseq
    must, opt, rest, post, block, args = *argv[0]
    ret << "  {\n    int num = rb_scan_args(argc, argv, \\\"\#{must}\#{opt}\#{rest}\#{post}\#{block}\\\", &\#{args.join(\", &\")});\n    \#{@return_value} = INT2FIX(num);\n  }\n    EOS\n  else\n    # child iseq\n    bug() if @translator.inline_block?\n    ret << \"  \#{@return_value} = INT2FIX(num);\"\n  end\n  bug() unless param.empty?\n  ret.join(\"\\n\")\nend\n"

#type_propergation(defs) ⇒ Object



1163
1164
1165
# File 'lib/cast_off/compile/ir/call_ir.rb', line 1163

def type_propergation(defs)
  @return_value.is_static([Fixnum])
end