@@ -387,10 +387,7 @@ impl<'a, 't> Evaluator<'a, 't> {
387387 body = vec ! [ init; n as usize + 1 ] ; // Array body
388388
389389 // Length value
390- body[ 0 ] = self
391- . vall ( alloc. inputs ( self . sea ) [ 2 + 2 ] . unwrap ( ) )
392- . try_into ( )
393- . unwrap ( ) ;
390+ body[ 0 ] = self . vall ( alloc. inputs ( self . sea ) [ 2 + 2 ] . unwrap ( ) ) . into ( ) ;
394391 } else {
395392 let num = ty. fields ( ) . len ( ) ;
396393 body = ( 0 ..num)
@@ -407,8 +404,8 @@ impl<'a, 't> Evaluator<'a, 't> {
407404 }
408405
409406 fn load ( & self , load : Load ) -> Object {
410- let from = self . valo ( load. ptr ( & self . sea ) . unwrap ( ) ) ;
411- let off = self . vall ( load. off ( & self . sea ) . unwrap ( ) ) ;
407+ let from = self . valo ( load. ptr ( self . sea ) . unwrap ( ) ) ;
408+ let off = self . vall ( load. off ( self . sea ) . unwrap ( ) ) ;
412409 let idx = get_field_index ( from. ty , load. to_mem_name ( self . sea ) . unwrap ( ) , off) ;
413410 if idx == from. ty . fields ( ) . len ( ) - 1 && from. ty . is_ary ( ) {
414411 let len = from. fields . len ( ) - from. ty . fields ( ) . len ( ) + 1 ;
@@ -423,10 +420,10 @@ impl<'a, 't> Evaluator<'a, 't> {
423420 }
424421
425422 fn store ( & mut self , store : Store ) -> Object {
426- let ptr = store. ptr ( & self . sea ) . unwrap ( ) ;
423+ let ptr = store. ptr ( self . sea ) . unwrap ( ) ;
427424 let to = self . valo ( ptr) ;
428- let off = self . vall ( store. off ( & self . sea ) . unwrap ( ) ) ;
429- let val = self . val ( store. val ( & self . sea ) . unwrap ( ) ) ;
425+ let off = self . vall ( store. off ( self . sea ) . unwrap ( ) ) ;
426+ let val = self . val ( store. val ( self . sea ) . unwrap ( ) ) ;
430427 let idx = get_field_index ( to. ty , store. to_mem_name ( self . sea ) . unwrap ( ) , off) ;
431428
432429 if idx == to. ty . fields ( ) . len ( ) - 1 && to. ty . is_ary ( ) {
@@ -525,14 +522,14 @@ impl<'a, 't> Evaluator<'a, 't> {
525522 TypedNode :: Div ( n) => self . div ( n) . into ( ) ,
526523 TypedNode :: DivF ( n) => self . divf ( n) . into ( ) ,
527524 TypedNode :: Minus ( _) => self
528- . vall ( node. inputs ( & self . sea ) [ 1 ] . unwrap ( ) )
525+ . vall ( node. inputs ( self . sea ) [ 1 ] . unwrap ( ) )
529526 . wrapping_neg ( )
530527 . into ( ) ,
531- TypedNode :: MinusF ( _) => self . vald ( node. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) . neg ( ) . into ( ) ,
528+ TypedNode :: MinusF ( _) => self . vald ( node. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) . neg ( ) . into ( ) ,
532529 TypedNode :: Mul ( _) => self . binaryl ( node, i64:: wrapping_mul) ,
533530 TypedNode :: MulF ( _) => self . binaryd ( node, f64:: mul) ,
534531 TypedNode :: Not ( _) => Object :: Long (
535- if self . is_true ( self . val ( node. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) ) {
532+ if self . is_true ( self . val ( node. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) ) {
536533 0
537534 } else {
538535 1
@@ -546,19 +543,19 @@ impl<'a, 't> Evaluator<'a, 't> {
546543 TypedNode :: And ( _) => self . binaryl ( node, i64:: bitand) ,
547544 TypedNode :: Or ( _) => self . binaryl ( node, i64:: bitor) ,
548545 TypedNode :: Xor ( _) => self . binaryl ( node, i64:: bitxor) ,
549- TypedNode :: Cast ( _) => self . val ( node. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) ,
550- TypedNode :: ToFloat ( _) => ( self . vall ( node. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) as f64 ) . into ( ) ,
546+ TypedNode :: Cast ( _) => self . val ( node. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) ,
547+ TypedNode :: ToFloat ( _) => ( self . vall ( node. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) as f64 ) . into ( ) ,
551548 TypedNode :: Load ( n) => self . load ( n) ,
552549 TypedNode :: Store ( n) => self . store ( n) ,
553550 TypedNode :: New ( n) => self . alloc ( n) ,
554551 TypedNode :: CProj ( n) => {
555- self . valo ( n. inputs ( & self . sea ) [ 0 ] . unwrap ( ) ) . fields [ self . sea [ n] . index ]
552+ self . valo ( n. inputs ( self . sea ) [ 0 ] . unwrap ( ) ) . fields [ self . sea [ n] . index ]
556553 }
557554 TypedNode :: Proj ( n) => {
558- self . valo ( n. inputs ( & self . sea ) [ 0 ] . unwrap ( ) ) . fields [ self . sea [ n] . index ]
555+ self . valo ( n. inputs ( self . sea ) [ 0 ] . unwrap ( ) ) . fields [ self . sea [ n] . index ]
559556 }
560557 TypedNode :: ScopeMin ( _) => Object :: Null ,
561- TypedNode :: ReadOnly ( n) => self . val ( n. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) ,
558+ TypedNode :: ReadOnly ( n) => self . val ( n. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) ,
562559 n => unreachable ! ( "Unexpected node {n:?}" ) ,
563560 }
564561 }
@@ -593,10 +590,10 @@ impl<'a, 't> Evaluator<'a, 't> {
593590
594591 match exit_node. downcast ( & self . sea . ops ) {
595592 TypedNode :: Return ( n) => {
596- return EResult :: Value ( self . val ( n. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) )
593+ return EResult :: Value ( self . val ( n. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) )
597594 }
598595 TypedNode :: If ( n) => {
599- let condition = self . is_true ( self . val ( n. inputs ( & self . sea ) [ 1 ] . unwrap ( ) ) ) ;
596+ let condition = self . is_true ( self . val ( n. inputs ( self . sea ) [ 1 ] . unwrap ( ) ) ) ;
600597 block = self . blocks [ block] . next [ if condition { 0 } else { 1 } ] ;
601598 // if (block == null) return Status.FALLTHROUGH;
602599 }
@@ -607,12 +604,12 @@ impl<'a, 't> Evaluator<'a, 't> {
607604 loops -= 1 ;
608605
609606 let exit = self . blocks [ block] . exit_id . unwrap ( ) ;
610- debug_assert ! ( exit > 0 && exit_node. inputs( & self . sea) . len( ) > exit) ;
607+ debug_assert ! ( exit > 0 && exit_node. inputs( self . sea) . len( ) > exit) ;
611608 block = self . blocks [ block] . next [ 0 ] ;
612609 // assert block != null;
613610 while i < self . blocks [ block] . nodes . len ( ) {
614- if let Some ( phi) = self . blocks [ block] . nodes [ i] . to_phi ( & self . sea ) {
615- let exit_node = phi. inputs ( & self . sea ) [ exit] . unwrap ( ) ;
611+ if let Some ( phi) = self . blocks [ block] . nodes [ i] . to_phi ( self . sea ) {
612+ let exit_node = phi. inputs ( self . sea ) [ exit] . unwrap ( ) ;
616613 self . phi_cache . push ( self . val ( exit_node) )
617614 } else {
618615 break ;
0 commit comments