[svn:languages] r80 - in ecmascript/trunk/src: builtin classes

fperrad at svn.parrot.org fperrad at svn.parrot.org
Fri Jul 24 19:12:34 UTC 2009


Author: fperrad
Date: Fri Jul 24 19:12:33 2009
New Revision: 80
URL: https://trac.parrot.org/languages/changeset/80

Log:
[ECMAScript] use the opcode 'iter' instead of a instantiation of 'Iterator'

Modified:
   ecmascript/trunk/src/builtin/builtins.pir
   ecmascript/trunk/src/classes/Array.pir

Modified: ecmascript/trunk/src/builtin/builtins.pir
==============================================================================
--- ecmascript/trunk/src/builtin/builtins.pir	Fri Jul 24 19:06:23 2009	(r79)
+++ ecmascript/trunk/src/builtin/builtins.pir	Fri Jul 24 19:12:33 2009	(r80)
@@ -9,13 +9,13 @@
 
 .sub 'print'
     .param pmc args :slurpy
-    .local pmc iter
-    new iter, 'Iterator', args
-    unless iter goto end_print_loop
+    .local pmc it
+    it = iter args
+    unless it goto end_print_loop
   print_loop:
-    $P1 = shift iter
+    $P1 = shift it
     print $P1
-    unless iter goto end_print_loop
+    unless it goto end_print_loop
     print ' '
     goto print_loop
   end_print_loop:

Modified: ecmascript/trunk/src/classes/Array.pir
==============================================================================
--- ecmascript/trunk/src/classes/Array.pir	Fri Jul 24 19:06:23 2009	(r79)
+++ ecmascript/trunk/src/classes/Array.pir	Fri Jul 24 19:12:33 2009	(r80)
@@ -321,15 +321,15 @@
 
 .sub '' :vtable('get_string') :method
     $S0 = ''
-    .local pmc iter
-    iter = new 'Iterator', self
+    .local pmc it
+    it = iter self
     goto loop_start
     loop:
-    unless iter goto end
+    unless it goto end
     $S0 = concat $S0, ','
     loop_start:
-    $S1 = shift iter
-    $S2 = iter[$S1]
+    $S1 = shift it
+    $S2 = it[$S1]
     concat $S0, $S2
     goto loop
     end:


More information about the parrot-commits mailing list