[svn:parrot] r41420 - in branches/nsentry2: compilers/imcc compilers/pge/PGE runtime/parrot/library runtime/parrot/library/Stream src t/compilers/imcc/syn t/library t/oo t/op t/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Sep 22 22:54:59 UTC 2009


Author: bacek
Date: Tue Sep 22 22:54:57 2009
New Revision: 41420
URL: https://trac.parrot.org/parrot/changeset/41420

Log:
Salvaged stuff for nsentry branch

Modified:
   branches/nsentry2/compilers/imcc/pbc.c
   branches/nsentry2/compilers/pge/PGE/Exp.pir
   branches/nsentry2/compilers/pge/PGE/Regex.pir
   branches/nsentry2/runtime/parrot/library/Stream/Base.pir
   branches/nsentry2/runtime/parrot/library/pcore.pir
   branches/nsentry2/src/global.c
   branches/nsentry2/t/compilers/imcc/syn/subflags.t
   branches/nsentry2/t/library/p6object.t
   branches/nsentry2/t/oo/composition.t
   branches/nsentry2/t/oo/mro-c3.t
   branches/nsentry2/t/oo/proxy.t
   branches/nsentry2/t/op/calling.t
   branches/nsentry2/t/op/gc.t
   branches/nsentry2/t/pmc/class.t
   branches/nsentry2/t/pmc/freeze.t
   branches/nsentry2/t/pmc/objects.t
   branches/nsentry2/t/pmc/pmcproxy.t

Modified: branches/nsentry2/compilers/imcc/pbc.c
==============================================================================
--- branches/nsentry2/compilers/imcc/pbc.c	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/compilers/imcc/pbc.c	Tue Sep 22 22:54:57 2009	(r41420)
@@ -1410,6 +1410,8 @@
         else
             sub->ns_entry_name = sub->name;
     }
+    else if (unit->is_method || unit->is_vtable_method)
+        sub->ns_entry_name = Parrot_str_new_constant(interp, "");
     else
         sub->ns_entry_name = sub->name;
 

Modified: branches/nsentry2/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/nsentry2/compilers/pge/PGE/Exp.pir	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/compilers/pge/PGE/Exp.pir	Tue Sep 22 22:54:57 2009	(r41420)
@@ -163,7 +163,7 @@
     .local string returnop
     returnop = '.yield'
     code.'emit'(<<"        CODE", name, pirflags, namecorou, .INTERPINFO_CURRENT_SUB)
-      .sub %0 :method %1
+      .sub %0 :nsentry(%0) :method %1
           .param pmc adverbs   :slurpy :named
           .local pmc mob
           .const 'Sub' corou = %2
@@ -192,7 +192,7 @@
     ##   Initial code for a rule that cannot be backtracked into.
     returnop = '.return'
     code.'emit'(<<"        CODE", name, pirflags)
-      .sub %0 :method %1
+      .sub %0 :nsentry(%0) :method %1
           .param pmc adverbs      :unique_reg :slurpy :named
           .local pmc mob
           .local string target    :unique_reg

Modified: branches/nsentry2/compilers/pge/PGE/Regex.pir
==============================================================================
--- branches/nsentry2/compilers/pge/PGE/Regex.pir	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/compilers/pge/PGE/Regex.pir	Tue Sep 22 22:54:57 2009	(r41420)
@@ -37,7 +37,7 @@
 
 =cut
 
-.sub 'ident' :method
+.sub 'ident' :method :nsentry
     .param pmc adverbs         :slurpy :named
     .local string target
     .local pmc mob, mfrom, mpos

Modified: branches/nsentry2/runtime/parrot/library/Stream/Base.pir
==============================================================================
--- branches/nsentry2/runtime/parrot/library/Stream/Base.pir	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/runtime/parrot/library/Stream/Base.pir	Tue Sep 22 22:54:57 2009	(r41420)
@@ -65,7 +65,7 @@
 
 =cut
 
-.sub close :method
+.sub close :method :nsentry
     .local pmc temp
 
     # reset source

Modified: branches/nsentry2/runtime/parrot/library/pcore.pir
==============================================================================
--- branches/nsentry2/runtime/parrot/library/pcore.pir	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/runtime/parrot/library/pcore.pir	Tue Sep 22 22:54:57 2009	(r41420)
@@ -7,7 +7,7 @@
 .namespace [ 'Sub' ]
 
 # implementation Sub.get_lexenv :method
-.sub get_lexenv :method
+.sub get_lexenv :method :nsentry
     .local pmc env, pad, interp
     env = new 'ResizablePMCArray'
     .local int level

Modified: branches/nsentry2/src/global.c
==============================================================================
--- branches/nsentry2/src/global.c	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/src/global.c	Tue Sep 22 22:54:57 2009	(r41420)
@@ -757,7 +757,10 @@
     PMC        *multisub;
 
     PMC_get_sub(interp, sub_pmc, sub);
-    ns_entry_name = sub->ns_entry_name;
+    ns_entry_name = Parrot_str_equal(interp, sub->method_name, CONST_STRING(interp, ""))
+                    ? sub->ns_entry_name
+                    : sub->method_name;
+
     multisub      = VTABLE_get_pmc_keyed_str(interp, ns, ns_entry_name);
 
     /* is there an existing MultiSub PMC? or do we need to create one? */

Modified: branches/nsentry2/t/compilers/imcc/syn/subflags.t
==============================================================================
--- branches/nsentry2/t/compilers/imcc/syn/subflags.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/compilers/imcc/syn/subflags.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -67,7 +67,7 @@
     isa_ok($P30, 'Sub', ":method sub found w/.const")
     $P0 = get_global 'method1'
     $I0 = isnull $P0
-    todo($I0, ":method sub not found in namespace")
+    ok($I0, ":method sub not found in namespace")
 
     ## :subid subs
     .const 'Sub' $P40 = 'subid1'

Modified: branches/nsentry2/t/library/p6object.t
==============================================================================
--- branches/nsentry2/t/library/p6object.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/library/p6object.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -404,7 +404,7 @@
 
 
 .namespace ['ABC']
-.sub 'foo' :method
+.sub 'foo' :method :nsentry
     .return ('ABC::foo')
 .end
 

Modified: branches/nsentry2/t/oo/composition.t
==============================================================================
--- branches/nsentry2/t/oo/composition.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/oo/composition.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -34,16 +34,16 @@
     multi_composition()
 .end
 
-.sub badger :method
+.sub badger :method :nsentry
     .return('Badger!')
 .end
-.sub badger2 :method
+.sub badger2 :method :nsentry
     .return('Second Badger!')
 .end
-.sub mushroom :method
+.sub mushroom :method :nsentry
     .return('Mushroom!')
 .end
-.sub snake :method
+.sub snake :method :nsentry
     .return('Snake!')
 .end
 .sub fire

Modified: branches/nsentry2/t/oo/mro-c3.t
==============================================================================
--- branches/nsentry2/t/oo/mro-c3.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/oo/mro-c3.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -27,19 +27,19 @@
     diamond_inheritance()
 .end
 
-.sub method_A :method
+.sub method_A :method :nsentry
     .return('Method from A')
 .end
 
-.sub method_B :method
+.sub method_B :method :nsentry
     .return('Method from B')
 .end
 
-.sub method_C :method
+.sub method_C :method :nsentry
     .return('Method from C')
 .end
 
-.sub method_D :method
+.sub method_D :method :nsentry
     .return('Method from D')
 .end
 

Modified: branches/nsentry2/t/oo/proxy.t
==============================================================================
--- branches/nsentry2/t/oo/proxy.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/oo/proxy.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -93,7 +93,7 @@
 .end
 
 .namespace ['Complex']
-.sub 'Complex' :method
+.sub 'Complex' :method :nsentry
     .return (self)
 .end
 

Modified: branches/nsentry2/t/op/calling.t
==============================================================================
--- branches/nsentry2/t/op/calling.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/op/calling.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -991,13 +991,13 @@
     f(o, "ok 4\n")
 .end
 .namespace ["Foo"]
-.sub bar :method
+.sub bar :method :nsentry
     .param string s
     print self
     print " "
     print s
 .end
-.sub baz :method
+.sub baz :method :nsentry
     .param string s
     print self
     print " "

Modified: branches/nsentry2/t/op/gc.t
==============================================================================
--- branches/nsentry2/t/op/gc.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/op/gc.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -182,7 +182,7 @@
     ok(1, "leaving do_inc")
 .end
 
-.sub __increment :method
+.sub 'increment' :vtable :method
     ok(1, "in __increment")
     sweep 1
 .end

Modified: branches/nsentry2/t/pmc/class.t
==============================================================================
--- branches/nsentry2/t/pmc/class.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/pmc/class.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -458,7 +458,7 @@
     is(result, 42, 'new() added method returns expected value')
 .end
 
-.sub add :method
+.sub add :method :nsentry
     $P0 = getattribute self, "x"
     $P1 = getattribute self, "y"
     $P2 = new ['Integer']

Modified: branches/nsentry2/t/pmc/freeze.t
==============================================================================
--- branches/nsentry2/t/pmc/freeze.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/pmc/freeze.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -765,7 +765,7 @@
 .end
 
 .namespace ['Conure']
-.sub __init :method
+.sub 'init' :method :vtable
     $P0 = new ['Integer']
     $P0 = 37
     setattribute self, 'temperature', $P0

Modified: branches/nsentry2/t/pmc/objects.t
==============================================================================
--- branches/nsentry2/t/pmc/objects.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/pmc/objects.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -1390,7 +1390,7 @@
 
 .namespace [ 'Foo41' ]
 
-.sub '__get_string' :method
+.sub 'get_string' :method :vtable
     .return('Hello world')
 .end
 

Modified: branches/nsentry2/t/pmc/pmcproxy.t
==============================================================================
--- branches/nsentry2/t/pmc/pmcproxy.t	Tue Sep 22 22:52:13 2009	(r41419)
+++ branches/nsentry2/t/pmc/pmcproxy.t	Tue Sep 22 22:54:57 2009	(r41420)
@@ -190,7 +190,7 @@
     is($P3, 42, "the magic overriding sub was called")
     ok(1, 'Called non-overridden method, which called overridden vtable method')
 .end
-.sub always42 :method
+.sub always42 :method :nsentry
     .param string what
     $P0 = new ['Integer']
     $P0 = 42


More information about the parrot-commits mailing list