Changeset 22548

Show
Ignore:
Timestamp:
10/09/08 00:46:46 (6 weeks ago)
Author:
ruoso
Message:

[smop] first sketch on the test for multi subs

Location:
v6/smop
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/CMakeLists.txt

    r22540 r22548  
    197197    test/35_array_grep.m0ld 
    198198    test/36_adhoc_signature.m0ld 
     199    test/37_multisub.m0ld 
    199200    test/38_ritest.m0ld 
    200201) 
  • v6/smop/src/s1p_adhocsignature.ri

    r22533 r22548  
    1717    SMOP__Object* mold = ((smop_s1p_adhocsignature_struct*)invocant)->bind_mold; 
    1818    smop_lowlevel_unlock(invocant); 
    19  
    20     SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    21                                                SMOP__ID__continuation, 
    22                                                SMOP__NATIVE__capture_create(interpreter, 
    23                                                                             SMOP_REFERENCE(interpreter,interpreter), 
    24                                                                             NULL,NULL)); 
    25  
    26     SMOP__Object* frame = SMOP__Mold__Frame_create(interpreter, 
    27                                                    SMOP_REFERENCE(interpreter,mold)); 
    28  
    29     mold_reg_set(interpreter,frame,0,SMOP_REFERENCE(interpreter,capture)); 
    30     mold_reg_set(interpreter,frame,1,continuation); 
    31     mold_reg_set(interpreter,frame,2,SMOP_REFERENCE(interpreter,interpreter)); 
    32  
    33     SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    34                   SMOP__ID__goto, 
    35                   frame); 
     19     
     20    if (mold) { 
     21        SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
     22                                                   SMOP__ID__continuation, 
     23                                                   SMOP__NATIVE__capture_create(interpreter, 
     24                                                                                SMOP_REFERENCE(interpreter,interpreter), 
     25                                                                                NULL,NULL)); 
     26     
     27        SMOP__Object* frame = SMOP__Mold__Frame_create(interpreter, 
     28                                                       SMOP_REFERENCE(interpreter,mold)); 
     29     
     30        mold_reg_set(interpreter,frame,0,SMOP_REFERENCE(interpreter,capture)); 
     31        mold_reg_set(interpreter,frame,1,continuation); 
     32        mold_reg_set(interpreter,frame,2,SMOP_REFERENCE(interpreter,interpreter)); 
     33      
     34        SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
     35                      SMOP__ID__goto, 
     36                      frame); 
     37    } 
    3638 
    3739%method ACCEPTS 
     
    4042    smop_lowlevel_unlock(invocant); 
    4143 
    42     SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    43                                                SMOP__ID__continuation, 
    44                                                SMOP__NATIVE__capture_create(interpreter, 
    45                                                                             SMOP_REFERENCE(interpreter,interpreter), 
    46                                                                             NULL,NULL)); 
    47  
    48     SMOP__Object* frame = SMOP__Mold__Frame_create(interpreter, 
    49                                                    SMOP_REFERENCE(interpreter,mold)); 
    50  
    51     mold_reg_set(interpreter,frame,0,SMOP_REFERENCE(interpreter,capture)); 
    52  
    53     mold_reg_set(interpreter,frame,1,continuation); 
    54     mold_reg_set(interpreter,frame,2,SMOP_REFERENCE(interpreter,interpreter)); 
    55  
    56     SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    57                   SMOP__ID__goto, 
    58                   frame); 
     44    if (mold) { 
     45        SMOP__Object* continuation = SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
     46                                                   SMOP__ID__continuation, 
     47                                                   SMOP__NATIVE__capture_create(interpreter, 
     48                                                                                SMOP_REFERENCE(interpreter,interpreter), 
     49                                                                                NULL,NULL)); 
     50     
     51        SMOP__Object* frame = SMOP__Mold__Frame_create(interpreter, 
     52                                                       SMOP_REFERENCE(interpreter,mold)); 
     53     
     54        mold_reg_set(interpreter,frame,0,SMOP_REFERENCE(interpreter,capture)); 
     55     
     56        mold_reg_set(interpreter,frame,1,continuation); 
     57        mold_reg_set(interpreter,frame,2,SMOP_REFERENCE(interpreter,interpreter)); 
     58     
     59        SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
     60                      SMOP__ID__goto, 
     61                      frame); 
     62    } 
    5963 
    6064%method DESTROYALL