Changeset 22843 for v6

Show
Ignore:
Timestamp:
10/31/08 20:30:41 (2 months ago)
Author:
pmurias
Message:

[smop] bytecode length is calculated when creating a new Mold, smop_mold is also included

Location:
v6/smop/SMOP
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/SMOP/SMOP.xs

    r22806 r22843  
    99#include <smop_s1p.h> 
    1010#include <smop_identifiers.h> 
     11#include <smop_mold.h> 
    1112 
    1213MODULE = SMOP           PACKAGE = SMOP           
     
    106107 
    107108SV* 
    108 create(SV* p5class, int ccount, SV* consts, int bcount, SV* bytecode) 
     109create(SV* p5class, int ccount, SV* consts, SV* bytecode) 
    109110  CODE: 
    110111    AV* constsav = (AV*)SvRV(consts); 
     
    137138        code_arr[i] = SvIV(*e); 
    138139    } 
    139     SMOP__Object* mold = SMOP__Mold_create(ccount, consts_arr, bcount, code_arr); 
     140    SMOP__Object* mold = SMOP__Mold_create(ccount, consts_arr, codelen, code_arr); 
    140141    SV* pointer = newSViv((int)mold); 
    141142    SV* object = newRV_noinc(pointer); 
  • v6/smop/SMOP/lib/SMOP.pm

    r22801 r22843  
    2727  my $rootns = SMOP::S1P->RootNamespace; 
    2828  my $prelud = SMOP::S1P->LexicalPrelude; 
    29   my $mold = SMOP::Mold->create(12,[$rootns, $int, $true, $fals], 
    30                                 45,[1,2,3,1,2,3,1,2,3]); 
     29  my $mold = SMOP::Mold->create(12,[$rootns, $int, $true, $fals], [1,2,3,1,2,3,1,2,3]); 
    3130  my $frame = SMOP::MoldFrame->create($mold); 
    3231  my $result = SMOP::Interpreter->run($frame); 
  • v6/smop/SMOP/t/run_mold.t

    r22803 r22843  
    1717      [ '$OUT','$_','FETCH','back','continuation', 
    1818        'goto','lookup','postcircumfix:{ }','print' ], 
    19       59, 
    2019      [ 1,11,10,7,1,1,0,1,12,11,2,0,0,1,13,12,2,0,0,1, 
    2120        15,10,6,1,0,0,1,16,15,2,0,0,1,14,16,8,1,13,0,1, 
    2221        17,9,4,0,0,1,18,17,3,0,0,1,14,9,5,1,18,0,0 ]), 
    2322     SMOP::S1P->LexicalPrelude ], 
    24    146, 
    2523   [ 1,23,21,10,1,3,0,1,24,23,7,0,0,1,22,24,19,1,5,0,1,25,21, 
    2624     10,1,6,0,1,26,25,7,0,0,1,27,1,12,0,2,16,21,1,28,27,16,0,