Ticket #389: nsentry.patch

File nsentry.patch, 7.5 KB (added by bacek, 12 years ago)

Salvaged stuff from nsentry branch

  • compilers/imcc/pbc.c

    diff --git a/compilers/imcc/pbc.c b/compilers/imcc/pbc.c
    index 1500ceb..09f535a 100644
    a b  
    14101410        else 
    14111411            sub->ns_entry_name = sub->name; 
    14121412    } 
     1413    else if (unit->is_method || unit->is_vtable_method) 
     1414        sub->ns_entry_name = Parrot_str_new_constant(interp, ""); 
    14131415    else 
    14141416        sub->ns_entry_name = sub->name; 
    14151417 
  • compilers/pge/PGE/Exp.pir

    diff --git a/compilers/pge/PGE/Exp.pir b/compilers/pge/PGE/Exp.pir
    index 3342260..b324f17 100644
    a b  
    163163    .local string returnop 
    164164    returnop = '.yield' 
    165165    code.'emit'(<<"        CODE", name, pirflags, namecorou, .INTERPINFO_CURRENT_SUB) 
    166       .sub %0 :method %1 
     166      .sub %0 :nsentry(%0) :method %1 
    167167          .param pmc adverbs   :slurpy :named 
    168168          .local pmc mob 
    169169          .const 'Sub' corou = %2 
     
    192192    ##   Initial code for a rule that cannot be backtracked into. 
    193193    returnop = '.return' 
    194194    code.'emit'(<<"        CODE", name, pirflags) 
    195       .sub %0 :method %1 
     195      .sub %0 :nsentry(%0) :method %1 
    196196          .param pmc adverbs      :unique_reg :slurpy :named 
    197197          .local pmc mob 
    198198          .local string target    :unique_reg 
  • compilers/pge/PGE/Regex.pir

    diff --git a/compilers/pge/PGE/Regex.pir b/compilers/pge/PGE/Regex.pir
    index 81a375b..0a94a60 100644
    a b  
    3737 
    3838=cut 
    3939 
    40 .sub 'ident' :method 
     40.sub 'ident' :method :nsentry 
    4141    .param pmc adverbs         :slurpy :named 
    4242    .local string target 
    4343    .local pmc mob, mfrom, mpos 
  • runtime/parrot/library/Stream/Base.pir

    diff --git a/runtime/parrot/library/Stream/Base.pir b/runtime/parrot/library/Stream/Base.pir
    index 622312a..8d9452e 100644
    a b  
    6565 
    6666=cut 
    6767 
    68 .sub close :method 
     68.sub close :method :nsentry 
    6969    .local pmc temp 
    7070 
    7171    # reset source 
  • runtime/parrot/library/pcore.pir

    diff --git a/runtime/parrot/library/pcore.pir b/runtime/parrot/library/pcore.pir
    index a64cb02..ac78cec 100644
    a b  
    77.namespace [ 'Sub' ] 
    88 
    99# implementation Sub.get_lexenv :method 
    10 .sub get_lexenv :method 
     10.sub get_lexenv :method :nsentry 
    1111    .local pmc env, pad, interp 
    1212    env = new 'ResizablePMCArray' 
    1313    .local int level 
  • src/global.c

    diff --git a/src/global.c b/src/global.c
    index 1c181c5..1e726fe 100644
    a b  
    757757    PMC        *multisub; 
    758758 
    759759    PMC_get_sub(interp, sub_pmc, sub); 
    760     ns_entry_name = sub->ns_entry_name; 
     760    ns_entry_name = Parrot_str_equal(interp, sub->method_name, CONST_STRING(interp, "")) 
     761                    ? sub->ns_entry_name 
     762                    : sub->method_name; 
     763 
    761764    multisub      = VTABLE_get_pmc_keyed_str(interp, ns, ns_entry_name); 
    762765 
    763766    /* is there an existing MultiSub PMC? or do we need to create one? */ 
  • t/compilers/imcc/syn/subflags.t

    diff --git a/t/compilers/imcc/syn/subflags.t b/t/compilers/imcc/syn/subflags.t
    index db7bb85..82473b8 100644
    a b  
    6767    isa_ok($P30, 'Sub', ":method sub found w/.const") 
    6868    $P0 = get_global 'method1' 
    6969    $I0 = isnull $P0 
    70     todo($I0, ":method sub not found in namespace") 
     70    ok($I0, ":method sub not found in namespace") 
    7171 
    7272    ## :subid subs 
    7373    .const 'Sub' $P40 = 'subid1' 
  • t/library/p6object.t

    diff --git a/t/library/p6object.t b/t/library/p6object.t
    index 20a3e13..aed4d44 100644
    a b  
    404404 
    405405 
    406406.namespace ['ABC'] 
    407 .sub 'foo' :method 
     407.sub 'foo' :method :nsentry 
    408408    .return ('ABC::foo') 
    409409.end 
    410410 
  • t/oo/composition.t

    diff --git a/t/oo/composition.t b/t/oo/composition.t
    index 0f9fbcb..3561123 100644
    a b  
    3434    multi_composition() 
    3535.end 
    3636 
    37 .sub badger :method 
     37.sub badger :method :nsentry 
    3838    .return('Badger!') 
    3939.end 
    40 .sub badger2 :method 
     40.sub badger2 :method :nsentry 
    4141    .return('Second Badger!') 
    4242.end 
    43 .sub mushroom :method 
     43.sub mushroom :method :nsentry 
    4444    .return('Mushroom!') 
    4545.end 
    46 .sub snake :method 
     46.sub snake :method :nsentry 
    4747    .return('Snake!') 
    4848.end 
    4949.sub fire 
  • t/oo/mro-c3.t

    diff --git a/t/oo/mro-c3.t b/t/oo/mro-c3.t
    index f42c632..d972753 100644
    a b  
    2727    diamond_inheritance() 
    2828.end 
    2929 
    30 .sub method_A :method 
     30.sub method_A :method :nsentry 
    3131    .return('Method from A') 
    3232.end 
    3333 
    34 .sub method_B :method 
     34.sub method_B :method :nsentry 
    3535    .return('Method from B') 
    3636.end 
    3737 
    38 .sub method_C :method 
     38.sub method_C :method :nsentry 
    3939    .return('Method from C') 
    4040.end 
    4141 
    42 .sub method_D :method 
     42.sub method_D :method :nsentry 
    4343    .return('Method from D') 
    4444.end 
    4545 
  • t/oo/proxy.t

    diff --git a/t/oo/proxy.t b/t/oo/proxy.t
    index 315d092..ba93906 100644
    a b  
    9393.end 
    9494 
    9595.namespace ['Complex'] 
    96 .sub 'Complex' :method 
     96.sub 'Complex' :method :nsentry 
    9797    .return (self) 
    9898.end 
    9999 
  • t/op/calling.t

    diff --git a/t/op/calling.t b/t/op/calling.t
    index 9d3531c..ba4343b 100644
    a b  
    991991    f(o, "ok 4\n") 
    992992.end 
    993993.namespace ["Foo"] 
    994 .sub bar :method 
     994.sub bar :method :nsentry 
    995995    .param string s 
    996996    print self 
    997997    print " " 
    998998    print s 
    999999.end 
    1000 .sub baz :method 
     1000.sub baz :method :nsentry 
    10011001    .param string s 
    10021002    print self 
    10031003    print " " 
  • t/op/gc.t

    diff --git a/t/op/gc.t b/t/op/gc.t
    index 972297b..56bdaad 100755
    a b  
    182182    ok(1, "leaving do_inc") 
    183183.end 
    184184 
    185 .sub __increment :method 
     185.sub 'increment' :vtable :method 
    186186    ok(1, "in __increment") 
    187187    sweep 1 
    188188.end 
  • t/pmc/class.t

    diff --git a/t/pmc/class.t b/t/pmc/class.t
    index 7731c36..8915640 100644
    a b  
    458458    is(result, 42, 'new() added method returns expected value') 
    459459.end 
    460460 
    461 .sub add :method 
     461.sub add :method :nsentry 
    462462    $P0 = getattribute self, "x" 
    463463    $P1 = getattribute self, "y" 
    464464    $P2 = new ['Integer'] 
  • t/pmc/freeze.t

    diff --git a/t/pmc/freeze.t b/t/pmc/freeze.t
    index b8156ac..838ae1a 100644
    a b  
    765765.end 
    766766 
    767767.namespace ['Conure'] 
    768 .sub __init :method 
     768.sub 'init' :method :vtable 
    769769    $P0 = new ['Integer'] 
    770770    $P0 = 37 
    771771    setattribute self, 'temperature', $P0 
  • t/pmc/objects.t

    diff --git a/t/pmc/objects.t b/t/pmc/objects.t
    index 8d96d9c..e605e5a 100644
    a b  
    13901390 
    13911391.namespace [ 'Foo41' ] 
    13921392 
    1393 .sub '__get_string' :method 
     1393.sub 'get_string' :method :vtable 
    13941394    .return('Hello world') 
    13951395.end 
    13961396 
  • t/pmc/pmcproxy.t

    diff --git a/t/pmc/pmcproxy.t b/t/pmc/pmcproxy.t
    index cb07de7..a23adad 100644
    a b  
    190190    is($P3, 42, "the magic overriding sub was called") 
    191191    ok(1, 'Called non-overridden method, which called overridden vtable method') 
    192192.end 
    193 .sub always42 :method 
     193.sub always42 :method :nsentry 
    194194    .param string what 
    195195    $P0 = new ['Integer'] 
    196196    $P0 = 42