@@ -733,6 +733,7 @@ pub enum Insn {
733733 ArrayLength { array : InsnId } ,
734734
735735 HashAref { hash : InsnId , key : InsnId , state : InsnId } ,
736+ HashAset { hash : InsnId , key : InsnId , val : InsnId , state : InsnId } ,
736737 HashDup { val : InsnId , state : InsnId } ,
737738
738739 /// Allocate an instance of the `val` object without calling `#initialize` on it.
@@ -991,7 +992,8 @@ impl Insn {
991992 | Insn :: PatchPoint { .. } | Insn :: SetIvar { .. } | Insn :: SetClassVar { .. } | Insn :: ArrayExtend { .. }
992993 | Insn :: ArrayPush { .. } | Insn :: SideExit { .. } | Insn :: SetGlobal { .. }
993994 | Insn :: SetLocal { .. } | Insn :: Throw { .. } | Insn :: IncrCounter ( _) | Insn :: IncrCounterPtr { .. }
994- | Insn :: CheckInterrupts { .. } | Insn :: GuardBlockParamProxy { .. } | Insn :: StoreField { .. } | Insn :: WriteBarrier { .. } => false ,
995+ | Insn :: CheckInterrupts { .. } | Insn :: GuardBlockParamProxy { .. } | Insn :: StoreField { .. } | Insn :: WriteBarrier { .. }
996+ | Insn :: HashAset { .. } => false ,
995997 _ => true ,
996998 }
997999 }
@@ -1182,6 +1184,7 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
11821184 Insn :: ArrayDup { val, .. } => { write ! ( f, "ArrayDup {val}" ) }
11831185 Insn :: HashDup { val, .. } => { write ! ( f, "HashDup {val}" ) }
11841186 Insn :: HashAref { hash, key, .. } => { write ! ( f, "HashAref {hash}, {key}" ) }
1187+ Insn :: HashAset { hash, key, val, .. } => { write ! ( f, "HashAset {hash}, {key}, {val}" ) }
11851188 Insn :: ObjectAlloc { val, .. } => { write ! ( f, "ObjectAlloc {val}" ) }
11861189 & Insn :: ObjectAllocClass { class, .. } => {
11871190 let class_name = get_class_name ( class) ;
@@ -2034,6 +2037,7 @@ impl Function {
20342037 & ArrayDup { val, state } => ArrayDup { val : find ! ( val) , state } ,
20352038 & HashDup { val, state } => HashDup { val : find ! ( val) , state } ,
20362039 & HashAref { hash, key, state } => HashAref { hash : find ! ( hash) , key : find ! ( key) , state } ,
2040+ & HashAset { hash, key, val, state } => HashAset { hash : find ! ( hash) , key : find ! ( key) , val : find ! ( val) , state } ,
20372041 & ObjectAlloc { val, state } => ObjectAlloc { val : find ! ( val) , state } ,
20382042 & ObjectAllocClass { class, state } => ObjectAllocClass { class, state : find ! ( state) } ,
20392043 & CCall { cfunc, recv, ref args, name, return_type, elidable } => CCall { cfunc, recv : find ! ( recv) , args : find_vec ! ( args) , name, return_type, elidable } ,
@@ -2131,7 +2135,7 @@ impl Function {
21312135 | Insn :: PatchPoint { .. } | Insn :: SetIvar { .. } | Insn :: SetClassVar { .. } | Insn :: ArrayExtend { .. }
21322136 | Insn :: ArrayPush { .. } | Insn :: SideExit { .. } | Insn :: SetLocal { .. } | Insn :: IncrCounter ( _)
21332137 | Insn :: CheckInterrupts { .. } | Insn :: GuardBlockParamProxy { .. } | Insn :: IncrCounterPtr { .. }
2134- | Insn :: StoreField { .. } | Insn :: WriteBarrier { .. } =>
2138+ | Insn :: StoreField { .. } | Insn :: WriteBarrier { .. } | Insn :: HashAset { .. } =>
21352139 panic ! ( "Cannot infer type of instruction with no output: {}. See Insn::has_output()." , self . insns[ insn. 0 ] ) ,
21362140 Insn :: Const { val : Const :: Value ( val) } => Type :: from_value ( * val) ,
21372141 Insn :: Const { val : Const :: CBool ( val) } => Type :: from_cbool ( * val) ,
@@ -4004,6 +4008,12 @@ impl Function {
40044008 worklist. push_back ( key) ;
40054009 worklist. push_back ( state) ;
40064010 }
4011+ & Insn :: HashAset { hash, key, val, state } => {
4012+ worklist. push_back ( hash) ;
4013+ worklist. push_back ( key) ;
4014+ worklist. push_back ( val) ;
4015+ worklist. push_back ( state) ;
4016+ }
40074017 & Insn :: Send { recv, ref args, state, .. }
40084018 | & Insn :: SendForward { recv, ref args, state, .. }
40094019 | & Insn :: SendWithoutBlock { recv, ref args, state, .. }
@@ -4699,7 +4709,8 @@ impl Function {
46994709 self . assert_subtype ( insn_id, index, types:: Fixnum )
47004710 }
47014711 // Instructions with Hash operands
4702- Insn :: HashAref { hash, .. } => self . assert_subtype ( insn_id, hash, types:: Hash ) ,
4712+ Insn :: HashAref { hash, .. }
4713+ | Insn :: HashAset { hash, .. } => self . assert_subtype ( insn_id, hash, types:: Hash ) ,
47034714 Insn :: HashDup { val, .. } => self . assert_subtype ( insn_id, val, types:: HashExact ) ,
47044715 // Other
47054716 Insn :: ObjectAllocClass { class, .. } => {
0 commit comments