develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33866 - trunk/compilers/pct/src/POST

From:
pmichaud
Date:
December 13, 2008 13:32
Subject:
[svn:parrot] r33866 - trunk/compilers/pct/src/POST
Message ID:
20081213213226.C88D4CBAC8@x12.develooper.com
Author: pmichaud
Date: Sat Dec 13 13:32:25 2008
New Revision: 33866

Modified:
   trunk/compilers/pct/src/POST/Compiler.pir
   trunk/compilers/pct/src/POST/Node.pir

Log:
[pct]:  Refactor handling of subid in POST nodes.


Modified: trunk/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/POST/Compiler.pir	(original)
+++ trunk/compilers/pct/src/POST/Compiler.pir	Sat Dec 13 13:32:25 2008
@@ -211,8 +211,7 @@
     $I0 = index pirflags, ':subid('
     if $I0 >= 0 goto pirflags_subid_done
     .local string subid
-    subid = code.'unique'()
-    node.'subid'(subid)
+    subid = node.'subid'()
     pirflags = concat pirflags, ' :subid("'
     pirflags .= subid
     pirflags .= '")'

Modified: trunk/compilers/pct/src/POST/Node.pir
==============================================================================
--- trunk/compilers/pct/src/POST/Node.pir	(original)
+++ trunk/compilers/pct/src/POST/Node.pir	Sat Dec 13 13:32:25 2008
@@ -197,6 +197,12 @@
 .sub 'subid' :method
     .param pmc value           :optional
     .param int has_value       :opt_flag
+    if has_value goto getset_value
+    $I0 = exists self['subid']
+    if $I0 goto getset_value
+    value = self.'unique'()
+    has_value = 1
+  getset_value:
     .tailcall self.'attr'('subid', value, has_value)
 .end
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About