@@ -2169,6 +2169,11 @@ impl Function {
21692169 state
21702170 } ) ;
21712171
2172+ if let Some ( profiled_type) = profiled_type {
2173+ // Guard receiver class
2174+ recv = fun. push_insn ( block, Insn :: GuardType { val : recv, guard_type : Type :: from_profiled_type ( profiled_type) , state } ) ;
2175+ }
2176+
21722177 let cfun = unsafe { get_mct_func ( cfunc) } . cast ( ) ;
21732178 let ccall = fun. push_insn ( block, Insn :: CCallVariadic {
21742179 cfun,
@@ -7131,9 +7136,10 @@ mod opt_tests {
71317136 v4:StringExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
71327137 v6:StringExact = StringCopy v4
71337138 PatchPoint MethodRedefined(Object@0x1008, puts@0x1010, cme:0x1018)
7134- v16:BasicObject = CCallVariadic puts@0x1040, v0, v6
7139+ v16:HeapObject[class_exact*:Object@VALUE(0x1008)] = GuardType v0, HeapObject[class_exact*:Object@VALUE(0x1008)]
7140+ v17:BasicObject = CCallVariadic puts@0x1040, v16, v6
71357141 CheckInterrupts
7136- Return v16
7142+ Return v17
71377143 " ) ;
71387144 }
71397145
@@ -8515,7 +8521,8 @@ mod opt_tests {
85158521 PatchPoint MethodRedefined(Set@0x1008, new@0x1010, cme:0x1018)
85168522 v10:HeapObject = ObjectAlloc v34
85178523 PatchPoint MethodRedefined(Set@0x1008, initialize@0x1040, cme:0x1048)
8518- v39:BasicObject = CCallVariadic initialize@0x1070, v10
8524+ v39:HeapObject[class_exact:Set] = GuardType v10, HeapObject[class_exact:Set]
8525+ v40:BasicObject = CCallVariadic initialize@0x1070, v39
85198526 CheckInterrupts
85208527 CheckInterrupts
85218528 Return v10
0 commit comments