@@ -4402,7 +4402,6 @@ impl Function {
44024402 // Too-complex shapes use hash tables; rb_shape_get_iv_index doesn't support them.
44034403 // Callers must filter these out before calling load_ivar.
44044404 assert ! ( !recv_type. shape( ) . is_complex( ) , "load_ivar called with too-complex shape" ) ;
4405-
44064405 let mut ivar_index: attr_index_t = 0 ;
44074406 if ! unsafe { rb_shape_get_iv_index ( recv_type. shape ( ) . 0 , id, & mut ivar_index) } {
44084407 // If there is no IVAR index, then the ivar was undefined when we
@@ -4414,14 +4413,7 @@ impl Function {
44144413 let layout = recv_type. shape ( ) . layout ( ) ;
44154414
44164415 match layout {
4417- // If we have an rclass layout, we load it from the fields obj from
4418- // the class ext. When RUBY_BOX is enabled, boxable classes
4419- // (classes like String which are defined at boot time), those classes
4420- // will have the "other" layout, so we are free to rely on this check
4421- // whether or not RUBY_BOX is enabled
44224416 ShapeLayout :: RClass | ShapeLayout :: RData => {
4423- // RClass and RData are very similar, but the fields object
4424- // is stored at a different offset.
44254417 let offset = if layout == ShapeLayout :: RClass {
44264418 RCLASS_OFFSET_PRIME_FIELDS_OBJ as i32
44274419 } else {
@@ -4478,16 +4470,9 @@ impl Function {
44784470 // need to wrap it again here.
44794471 self . push_insn_id ( block, insn_id) ; continue ;
44804472 }
4481-
4482- // Guard that the object is a heap object
44834473 let self_val = self . load_ivar_guard_type ( block, self_val, recv_type, state) ;
4484-
4485- // Get the runtime shape value
44864474 let shape = self . load_shape ( block, self_val) ;
4487-
4488- // Test that runtime shape is equal to the compile time shape
44894475 self . guard_shape ( block, shape, recv_type. shape ( ) , state, Some ( Recompile :: ProfileSelf ) ) ;
4490-
44914476 let replacement = self . load_ivar ( block, self_val, recv_type, id) ;
44924477 self . make_equal_to ( insn_id, replacement) ;
44934478 }
@@ -7210,15 +7195,10 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
72107195 if profiled_shape. is_complex ( ) { continue ; }
72117196 if seen_shape. contains ( & profiled_shape) { continue ; }
72127197 seen_shape. push ( profiled_shape) ;
7213-
7214- // Load the runtime shape from the object, we know
7215- // it's OK to do this because we did GuardType above.
72167198 let runtime_shape = fun. load_shape ( block, self_param) ;
7217-
72187199 // The expected shape can change over run, so we put it
72197200 // as a pointer to keep it stable in snapshot tests.
72207201 let expected_shape = fun. push_insn ( block, Insn :: Const { val : Const :: CShape ( profiled_shape) } ) ;
7221-
72227202 let has_shape = fun. push_insn ( block, Insn :: IsBitEqual { left : runtime_shape, right : expected_shape } ) ;
72237203 let iftrue_block = fun. new_block ( insn_idx) ;
72247204 let target = BranchEdge { target : iftrue_block, args : vec ! [ ] } ;
@@ -8371,29 +8351,16 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
83718351 if profiled_type. is_empty ( ) { break ; }
83728352 // Instance variable lookups on immediate values are always nil; don't bother
83738353 if profiled_type. flags ( ) . is_immediate ( ) { continue ; }
8374-
83758354 let profiled_shape = profiled_type. shape ( ) ;
8376-
83778355 // Too-complex shapes use hash tables for ivars;
83788356 // rb_shape_get_iv_index doesn't work for them.
83798357 // Let the fallthrough GetIvar handle these.
83808358 if profiled_shape. is_complex ( ) { continue ; }
8381-
8382- // If we've generated code for this shape already,
8383- // then skip it
83848359 if seen_shape. contains ( & profiled_shape) { continue ; }
83858360 seen_shape. push ( profiled_shape) ;
8386-
8387- // Load the runtime shape from the object, we know
8388- // it's OK to do this because we did GuardType above
83898361 let runtime_shape = fun. load_shape ( block, self_param) ;
8390-
83918362 // Load the expected shape to a variable
83928363 let expected_shape = fun. push_insn ( block, Insn :: Const { val : Const :: CShape ( profiled_shape) } ) ;
8393-
8394- // If the expected is equal to the actual, then
8395- // we're good and can load the IV. Otherwise jump
8396- // to the next block.
83978364 let has_shape = fun. push_insn ( block, Insn :: IsBitEqual { left : runtime_shape, right : expected_shape } ) ;
83988365 let iftrue_block = fun. new_block ( insn_idx) ;
83998366 let target = BranchEdge { target : iftrue_block, args : vec ! [ ] } ;
0 commit comments