@@ -2706,7 +2706,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
2706
2706
break ;
2707
2707
}
2708
2708
2709
- //TODO: implement wait/1
2710
2709
case OP_WAIT : {
2711
2710
uint32_t label ;
2712
2711
DECODE_LABEL (label , pc )
@@ -2723,7 +2722,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
2723
2722
break ;
2724
2723
}
2725
2724
2726
- //TODO: implement wait_timeout/2
2727
2725
case OP_WAIT_TIMEOUT : {
2728
2726
#ifdef IMPL_EXECUTE_LOOP
2729
2727
// PC for wait_timeout_trap_handler, just before label
@@ -3037,7 +3035,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3037
3035
#ifdef IMPL_EXECUTE_LOOP
3038
3036
TRACE ("is_number/2, label=%i, arg1=%lx\n" , label , arg1 );
3039
3037
3040
- //TODO: check for floats too
3041
3038
if (!term_is_number (arg1 )) {
3042
3039
pc = mod -> labels [label ];
3043
3040
}
@@ -3262,7 +3259,8 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3262
3259
#ifdef IMPL_EXECUTE_LOOP
3263
3260
TRACE ("test_arity/2, label=%i, arg1=%lx\n" , label , arg1 );
3264
3261
3265
- if (!(term_is_tuple (arg1 ) && (uint32_t ) term_get_tuple_arity (arg1 ) == arity )) {
3262
+ assert (term_is_tuple (arg1 ));
3263
+ if ((uint32_t ) term_get_tuple_arity (arg1 ) != arity ) {
3266
3264
pc = mod -> labels [label ];
3267
3265
}
3268
3266
#endif
@@ -3367,7 +3365,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3367
3365
#endif
3368
3366
3369
3367
#ifdef IMPL_EXECUTE_LOOP
3370
- //TODO: check if src_value is a tuple
3371
3368
if (!jump_to_address && ((uint32_t ) arity == cmp_value )) {
3372
3369
jump_to_address = mod -> labels [jmp_label ];
3373
3370
}
@@ -3599,9 +3596,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3599
3596
TRACE ("if_end/0\n" );
3600
3597
3601
3598
#ifdef IMPL_EXECUTE_LOOP
3602
- x_regs [0 ] = ERROR_ATOM ;
3603
- x_regs [1 ] = IF_CLAUSE_ATOM ;
3604
-
3605
3599
RAISE_ERROR (IF_CLAUSE_ATOM );
3606
3600
#endif
3607
3601
break ;
@@ -3826,7 +3820,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3826
3820
3827
3821
#ifdef IMPL_EXECUTE_LOOP
3828
3822
term catch_term = term_from_catch_label (mod -> module_index , label );
3829
- //TODO: here just write to y registers is enough
3830
3823
WRITE_REGISTER (dreg , catch_term );
3831
3824
#endif
3832
3825
break ;
@@ -3839,7 +3832,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3839
3832
TRACE ("try_end/1, reg=%c%i\n" , T_DEST_REG (dreg ));
3840
3833
3841
3834
#ifdef IMPL_EXECUTE_LOOP
3842
- //TODO: here just write to y registers is enough
3843
3835
WRITE_REGISTER (dreg , term_nil ());
3844
3836
#endif
3845
3837
break ;
@@ -3920,7 +3912,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3920
3912
3921
3913
#ifdef IMPL_EXECUTE_LOOP
3922
3914
term catch_term = term_from_catch_label (mod -> module_index , label );
3923
- // TODO: here just write to y registers is enough
3924
3915
WRITE_REGISTER (dreg , catch_term );
3925
3916
#endif
3926
3917
break ;
@@ -3933,7 +3924,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
3933
3924
TRACE ("catch_end/1, reg=%c%i\n" , T_DEST_REG (dreg ));
3934
3925
3935
3926
#ifdef IMPL_EXECUTE_LOOP
3936
- // TODO: here just write to y registers is enough
3937
3927
WRITE_REGISTER (dreg , term_nil ());
3938
3928
// C.f. https://www.erlang.org/doc/reference_manual/expressions.html#catch-and-throw
3939
3929
switch (term_to_atom_index (x_regs [0 ])) {
@@ -5537,7 +5527,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
5537
5527
DECODE_COMPACT_TERM (arity_term , pc )
5538
5528
5539
5529
#ifdef IMPL_EXECUTE_LOOP
5540
- TRACE ("is_function2/3, label=%i, arg1=%lx, arity=%i \n" , label , arg1 , arity );
5530
+ TRACE ("is_function2/3, label=%i, arg1=%lx, arity=%p \n" , label , arg1 , ( void * ) arity_term );
5541
5531
5542
5532
if (term_is_function (arg1 ) && term_is_integer (arity_term )) {
5543
5533
const term * boxed_value = term_to_const_term_ptr (arg1 );
@@ -5675,7 +5665,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
5675
5665
break ;
5676
5666
}
5677
5667
5678
- //TODO: stub, always false
5679
5668
case OP_IS_BITSTR : {
5680
5669
uint32_t label ;
5681
5670
DECODE_LABEL (label , pc )
@@ -5698,8 +5687,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
5698
5687
break ;
5699
5688
}
5700
5689
5701
- // TODO: This opcode is currently uncovered by tests.
5702
- // We need to implement GC bifs with arity 3, e.g. binary_part/3.
5703
5690
case OP_GC_BIF3 : {
5704
5691
uint32_t fail_label ;
5705
5692
DECODE_LABEL (fail_label , pc );
@@ -5773,7 +5760,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
5773
5760
}
5774
5761
5775
5762
#if MINIMUM_OTP_COMPILER_VERSION <= 23
5776
- //TODO: stub, implement recv_mark/1
5777
5763
//it looks like it can be safely left unimplemented
5778
5764
case OP_RECV_MARK : {
5779
5765
uint32_t label ;
@@ -5784,7 +5770,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
5784
5770
break ;
5785
5771
}
5786
5772
5787
- //TODO: stub, implement recv_set/1
5788
5773
//it looks like it can be safely left unimplemented
5789
5774
case OP_RECV_SET : {
5790
5775
uint32_t label ;
0 commit comments