Class: CastOff::Compiler::SimpleIR::Putstring
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, #mark, #param_irs, #param_variables, #propergate_boxed_value, #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
permalink
#initialize(param, argc, return_value, insn, cfg) ⇒ Putstring
[View source]
198
199
200
201
202
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 198
def initialize(param, argc, return_value, insn, cfg)
super(param, argc, return_value, insn, cfg)
bug() unless @argc == 1
bug() unless @param[0].param_value.is_a?(Literal)
end
|
Instance Method Details
permalink
#harmless?(recv_p) ⇒ Boolean
[View source]
230
231
232
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 230
def harmless?(recv_p)
true
end
|
permalink
#propergate_exact_class(defs) ⇒ Object
[View source]
209
210
211
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 209
def propergate_exact_class(defs)
@return_value.class_exact? ? false : @return_value.is_class_exact()
end
|
permalink
#propergate_guard_usage ⇒ Object
[View source]
204
205
206
207
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 204
def propergate_guard_usage()
params = param_irs()
params.each{|p| p.need_guard(false)}
end
|
permalink
#side_effect? ⇒ Boolean
[View source]
234
235
236
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 234
def side_effect?
false
end
|
permalink
#to_c(params) ⇒ Object
[View source]
213
214
215
216
217
218
219
220
221
222
223
224
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 213
def to_c(params)
ret = []
ret << super(params)
param = param_variables()
str = param.shift
bug() unless str.is_a?(Literal)
code = dont_duplicate_if_harmless(str)
code = " #{@return_value} = rb_str_resurrect(#{str});" unless code
ret << code
bug() unless param.empty?
ret.join("\n")
end
|
permalink
#type_propergation(defs) ⇒ Object
[View source]
226
227
228
|
# File 'lib/cast_off/compile/ir/call_ir.rb', line 226
def type_propergation(defs)
@return_value.is_static([String])
end
|