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

[svn:parrot] r33623 - in trunk/t: op pmc stm

From:
coke
Date:
December 7, 2008 10:22
Subject:
[svn:parrot] r33623 - in trunk/t: op pmc stm
Message ID:
20081207182215.9246CCB9AF@x12.develooper.com
Author: coke
Date: Sun Dec  7 10:22:11 2008
New Revision: 33623

Modified:
   trunk/t/op/calling.t
   trunk/t/pmc/eval.t
   trunk/t/pmc/fixedpmcarray.t
   trunk/t/pmc/multidispatch.t
   trunk/t/pmc/object-meths.t
   trunk/t/pmc/objects.t
   trunk/t/pmc/sub.t
   trunk/t/pmc/threads.t
   trunk/t/stm/basic_mt.t
   trunk/t/stm/runtime.t

Log:
The 'global' syntax in PIR is [DEPRECATED]. replace its usage with explicit ops.
(Which are also deprecated, one thing at a time.)


Modified: trunk/t/op/calling.t
==============================================================================
--- trunk/t/op/calling.t	(original)
+++ trunk/t/op/calling.t	Sun Dec  7 10:22:11 2008
@@ -923,7 +923,7 @@
 .sub main :main
     .local pmc f
     $I0 = 99
-    f = global "foo"
+    f = find_global "foo"
     .begin_call
     .call f
     .get_result   $P0 :optional

Modified: trunk/t/pmc/eval.t
==============================================================================
--- trunk/t/pmc/eval.t	(original)
+++ trunk/t/pmc/eval.t	Sun Dec  7 10:22:11 2008
@@ -97,7 +97,7 @@
     code .= "returncc\n"
     the_sub = my_compiler("_foo", code)
     the_sub()
-    the_sub = global "_foo"
+    the_sub = find_global "_foo"
     the_sub()
 .end
 

Modified: trunk/t/pmc/fixedpmcarray.t
==============================================================================
--- trunk/t/pmc/fixedpmcarray.t	(original)
+++ trunk/t/pmc/fixedpmcarray.t	Sun Dec  7 10:22:11 2008
@@ -304,15 +304,15 @@
      bounds 1
      compares = new 'Integer'
      compares = 0
-     global "compares" = compares
-    cmp_fun = global "cmp_fun"
+     store_global "compares", compares
+    cmp_fun = find_global "cmp_fun"
      sort_ar()
      sort_ar(cmp_fun)
 .end
 .sub sort_ar
     .param pmc cmp_fun :optional
     .local pmc compares
-    compares = global "compares"
+    compares = find_global "compares"
     compares = 0
     .local pmc ar
     new ar, 'FixedPMCArray'
@@ -345,7 +345,7 @@
     .param pmc b
     $I0 = cmp a, b
     .local pmc compares
-    compares = global "compares"
+    compares = find_global "compares"
     inc compares
     .begin_return
     .set_return $I0

Modified: trunk/t/pmc/multidispatch.t
==============================================================================
--- trunk/t/pmc/multidispatch.t	(original)
+++ trunk/t/pmc/multidispatch.t	Sun Dec  7 10:22:11 2008
@@ -29,7 +29,7 @@
 
 .sub 'test' :main
     .local pmc divide
-    divide = global "Integer_divide_Integer"
+    divide = find_global "Integer_divide_Integer"
     add_multi "divide", "Integer,Integer,Integer", divide
 
     $P0 = new 'Integer'
@@ -61,7 +61,7 @@
 
 .sub _main
     .local pmc add
-    add = global "add"
+    add = find_global "add"
     add_multi "add", "Integer,Integer,Integer", add
 
     $P0 = new 'Integer'
@@ -93,7 +93,7 @@
 
 .sub _main
     .local pmc divide
-    divide = global "Integer_divide_Integer"
+    divide = find_global "Integer_divide_Integer"
     add_multi "divide", "Integer,Integer,Integer", divide
 
     $P0 = new 'Integer'
@@ -121,7 +121,7 @@
 
 .sub _main
     .local pmc comp
-    comp = global "Float_cmp_Integer"
+    comp = find_global "Float_cmp_Integer"
     add_multi "cmp", "Float,Integer", comp
 
     $P1 = new 'Float'
@@ -148,7 +148,7 @@
 
 .sub _main
     .local pmc comp
-    comp = global "Float_cmp_Integer"
+    comp = find_global "Float_cmp_Integer"
     add_multi "cmp_num", "Float,Integer", comp
     $P0 = find_multi "cmp_num", "Float,Integer"
     if_null $P0, nok
@@ -176,7 +176,7 @@
 
 .sub _main
     .local pmc comp
-    comp = global "Float_cmp_Integer"
+    comp = find_global "Float_cmp_Integer"
     add_multi "cmp_num", "Float,Integer", comp
     $P0 = find_multi "cmp_num", "Float,Integer"
     if_null $P0, nok
@@ -224,7 +224,7 @@
 .sub _main
     .local pmc divide
     load_bytecode "$temp_pir"
-    divide = global "Integer_divide_Integer"
+    divide = find_global "Integer_divide_Integer"
     add_multi "divide", "Integer,Integer,Integer", divide
 
     \$P0 = new 'Integer'
@@ -335,7 +335,7 @@
     ## push m, s
     ## s = get_global "Bar", "foo"
     ## push m, s
-    ## global "foo" = m
+    ## store_global "foo", m
     print "calling foo(f, b)\n"
     foo(f, b)
     print "calling foo(b, f)\n"

Modified: trunk/t/pmc/object-meths.t
==============================================================================
--- trunk/t/pmc/object-meths.t	(original)
+++ trunk/t/pmc/object-meths.t	Sun Dec  7 10:22:11 2008
@@ -727,7 +727,7 @@
     subclass cl, cl, "Bar"
     o = new "Bar"
     print o
-    $P0 = global "ok2"
+    $P0 = find_global "ok2"
     cl.'add_method'('get_string', $P0, 'vtable' => 1)
     print o
 .end

Modified: trunk/t/pmc/objects.t
==============================================================================
--- trunk/t/pmc/objects.t	(original)
+++ trunk/t/pmc/objects.t	Sun Dec  7 10:22:11 2008
@@ -1011,7 +1011,7 @@
     o = Foo34()
     is( o, 'Foo34', 'found global Foo34' )
 
-    f = global "Foo34"
+    f = find_global "Foo34"
     o = f()
     is( o, 'Foo34', 'found global Foo34 explicitly' )
 

Modified: trunk/t/pmc/sub.t
==============================================================================
--- trunk/t/pmc/sub.t	(original)
+++ trunk/t/pmc/sub.t	Sun Dec  7 10:22:11 2008
@@ -930,11 +930,11 @@
 .sub main :main
     "foo"()
     print "ok\n"
-    $P0 = global "new"
+    $P0 = find_global "new"
     $I0 = defined $P0
     print $I0
     print "\n"
-    $P0 = global "foo"
+    $P0 = find_global "foo"
     unless null $P0 goto foo
     print "nofoo\n"
   foo:

Modified: trunk/t/pmc/threads.t
==============================================================================
--- trunk/t/pmc/threads.t	(original)
+++ trunk/t/pmc/threads.t	Sun Dec  7 10:22:11 2008
@@ -82,7 +82,7 @@
     .local pmc threadfunc
     .local pmc thread
     $I5 = 10
-    threadfunc = global "foo"
+    threadfunc = find_global "foo"
     thread = new 'ParrotThread'
     thread.'run_clone'(threadfunc)
 
@@ -125,7 +125,7 @@
     .local pmc threadfunc
     .local pmc thread
     $I5 = 10
-    threadfunc = global "foo"
+    threadfunc = find_global "foo"
     thread = new 'ParrotThread'
     thread.'run_clone'(threadfunc)
 
@@ -171,7 +171,7 @@
     $P6 = 'from '
 
     print "ok 1\n"
-    threadsub = global "foo"
+    threadsub = find_global "foo"
     thread = new 'ParrotThread'
     thread.'run_clone'(threadsub, $P6)
     sleep 1 # to let the thread run
@@ -214,7 +214,7 @@
     .local pmc threadsub
     .local pmc thread
     bounds 1    # assert slow core -S and -g are fine too
-    threadsub = global "foo"
+    threadsub = find_global "foo"
     thread = new 'ParrotThread'
     $I0 = thread
     print 'start '
@@ -249,7 +249,7 @@
     .const int MAX = 1000
     .local pmc kid
     .local pmc Adder
-    Adder = global '_add'
+    Adder = find_global '_add'
     kid = new 'ParrotThread'
     .local pmc from
     from = new 'Integer'
@@ -302,7 +302,7 @@
     .local pmc foo
     .local pmc queue
     .local pmc thread
-    foo = global '_foo'
+    foo = find_global '_foo'
     queue = new 'TQueue' # flag for when the thread is done
     thread = new 'ParrotThread'
     thread.'run_clone'(foo, queue)
@@ -329,7 +329,7 @@
 pir_output_is( <<'CODE', <<'OUTPUT', "share a PMC" );
 .sub main :main
     .local pmc foo
-    foo = global "_foo"
+    foo = find_global "_foo"
     .local pmc to_share
     to_share = new 'Integer'
     .local pmc shared_ref
@@ -380,7 +380,7 @@
     .local pmc thread
     thread = new 'ParrotThread'
     .local pmc foo
-    foo = global '_foo'
+    foo = find_global '_foo'
     thread.'run_clone'(foo, queue)
     thread.'join'()
     print "done main\n"
@@ -467,7 +467,7 @@
     test3()
     .local pmc test4
     errorsoff .PARROT_ERRORS_GLOBALS_FLAG
-    test4 = global 'test4'
+    test4 = find_global 'test4'
     if null test4 goto okay
     print "not "
 okay:
@@ -488,7 +488,7 @@
     .local pmc thread
     thread = new 'ParrotThread'
     .local pmc thread_func
-    thread_func = global 'thread_func'
+    thread_func = find_global 'thread_func'
     $I0 = .PARROT_CLONE_CODE
     thread.'run'($I0, thread_func, test2)
     thread.'join'()
@@ -831,7 +831,7 @@
     .param pmc what
     .param pmc expect
     .local pmc number
-    number = global 'test_num'
+    number = find_global 'test_num'
     if what == expect goto okay
     print "# got:      "
     print what
@@ -866,7 +866,7 @@
 .end
 
 .sub _check_sanity
-    $P0 = global 'foo'
+    $P0 = find_global 'foo'
     $P1 = get_hll_global [ 'Foo' ], 'foo'
     is($P0, $P1)
 .end
@@ -879,7 +879,7 @@
 
 .sub check_sanity
     _check_sanity()
-    $P0 = global '_check_sanity'
+    $P0 = find_global '_check_sanity'
     $P0()
     $P0 = get_hll_global [ 'Foo' ], '_check_sanity'
     $P0()
@@ -887,14 +887,14 @@
 
 .sub _check_value
     .param int value
-    $P0 = global 'foo'
+    $P0 = find_global 'foo'
     is($P0, value)
 .end
 
 .sub check_value
     .param int value
     _check_value(value)
-    $P0 = global '_check_value'
+    $P0 = find_global '_check_value'
     $P0(value)
     $P0 = get_hll_global [ 'Foo' ], '_check_value'
     $P0(value)
@@ -1006,7 +1006,7 @@
     passed = 15
 
     .local pmc thread_func
-    thread_func = global 'test'
+    thread_func = find_global 'test'
     print "in thread:\n"
     thread.'run'(flags, thread_func, passed)
     thread.'join'()
@@ -1048,7 +1048,7 @@
     .local pmc foo
 
     thread = new 'ParrotThread'
-    foo = global '_foo'
+    foo = find_global '_foo'
     thread.'run_clone'(foo, queue)
     thread.'join'()
     print "done main\n"

Modified: trunk/t/stm/basic_mt.t
==============================================================================
--- trunk/t/stm/basic_mt.t	(original)
+++ trunk/t/stm/basic_mt.t	Sun Dec  7 10:22:11 2008
@@ -73,8 +73,8 @@
     a = 0
     a = new 'STMRef', a
 
-    _incr = global "incr"
-    _waiter = global "waiter"
+    _incr = find_global "incr"
+    _waiter = find_global "waiter"
 
     wThr = new 'ParrotThread'
     wThr.'run_clone'(_waiter, a)
@@ -139,8 +139,8 @@
     a = ""
     a = new 'STMRef', a
 
-    _incr = global "incr"
-    _waiter = global "waiter"
+    _incr = find_global "incr"
+    _waiter = find_global "waiter"
 
     wThr = new 'ParrotThread'
     wThr.'run_clone'(_waiter, a)

Modified: trunk/t/stm/runtime.t
==============================================================================
--- trunk/t/stm/runtime.t	(original)
+++ trunk/t/stm/runtime.t	Sun Dec  7 10:22:11 2008
@@ -100,7 +100,7 @@
     $P0 = new 'STMVar', $P0
     values[1] = $P0
     .local pmc _thread_main
-    _thread_main = global 'do_choice'
+    _thread_main = find_global 'do_choice'
 
     $I0 = _thread_main(values)
     $I1 = _thread_main(values)
@@ -141,7 +141,7 @@
     .local pmc transaction
     .local pmc real_sub
     transaction = get_hll_global ['STM'], 'transaction'
-    real_sub = global '_wakeup_func'
+    real_sub = find_global '_wakeup_func'
     transaction(real_sub, values)
     .return (0)
 .end
@@ -170,12 +170,12 @@
     $P0 = new 'STMVar', $P0
     values[1] = $P0
     .local pmc _thread_main
-    _thread_main = global 'do_choice'
+    _thread_main = find_global 'do_choice'
     thread_one.'run_clone'(_thread_main, values)
     thread_two.'run_clone'(_thread_main, values)
     thread_three.'run_clone'(_thread_main, values)
     .local pmc _wakeup_thread_main
-    _wakeup_thread_main = global 'wakeup_func'
+    _wakeup_thread_main = find_global 'wakeup_func'
     wakeup_thread.'run_clone'(_wakeup_thread_main, values)
     $I0 = thread_one.'join'()
     $I1 = thread_two.'join'()
@@ -288,7 +288,7 @@
     .local pmc transaction
     .local pmc real_sub
     transaction = get_hll_global ['STM'], 'transaction'
-    real_sub = global '_wakeup_func'
+    real_sub = find_global '_wakeup_func'
     transaction(real_sub, what)
     .return (0)
 .end
@@ -392,7 +392,7 @@
     .param int blockp
 
     $P0 = get_hll_global ['STM'], 'transaction'
-    $P1 = global '_fetchHead'
+    $P1 = find_global '_fetchHead'
     .tailcall $P0($P1, self, removep, blockp)
 .end
 
@@ -447,7 +447,7 @@
     .param int blockp
 
     $P0 = get_hll_global ['STM'], 'transaction'
-    $P1 = global '_addTail'
+    $P1 = find_global '_addTail'
     $P2 = $P0($P1, self, what, blockp)
     .return ($P2)
 .end
@@ -550,8 +550,8 @@
     $P0 = get_hll_global ['STMQueue'], '__onload'
     $P0()
 
-    _add = global "adder"
-    _remove = global "remover"
+    _add = find_global "adder"
+    _remove = find_global "remover"
 
     addThread = new 'ParrotThread'
     removeThread = new 'ParrotThread'
@@ -605,7 +605,7 @@
     queue = $P0.'new'('length' => SIZE)
 
     $P0 = get_hll_global ['STM'], 'transaction'
-    $P1 = global '_test'
+    $P1 = find_global '_test'
     $P0($P1, queue)
 
     print "ok\n"



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