Author: coke
Date: Tue Jan 6 23:29:18 2009
New Revision: 35098
Modified:
trunk/runtime/parrot/library/PGE/Glob.pir
trunk/runtime/parrot/library/STM.pir
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:
Avoid the [DEPRECATED] find_global_p_s opcode
Modified: trunk/runtime/parrot/library/PGE/Glob.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Glob.pir (original)
+++ trunk/runtime/parrot/library/PGE/Glob.pir Tue Jan 6 23:29:18 2009
@@ -88,19 +88,19 @@
optable = new ['PGE';'OPTable']
store_global '$optable', optable
- $P0 = find_global 'glob_literal'
+ $P0 = get_global 'glob_literal'
optable.'newtok'('term:', 'precedence'=>'=', 'nows'=>1, 'parsed'=>$P0)
- $P0 = find_global 'glob_quest'
+ $P0 = get_global 'glob_quest'
optable.'newtok'('term:?', 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
- $P0 = find_global 'glob_star'
+ $P0 = get_global 'glob_star'
optable.'newtok'('term:*', 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
- $P0 = find_global 'glob_enum'
+ $P0 = get_global 'glob_enum'
optable.'newtok'('term:[', 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
- $P0 = find_global 'glob_alt'
+ $P0 = get_global 'glob_alt'
optable.'newtok'('term:{', 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
optable.'newtok'('infix:', 'looser'=>'term:', 'assoc'=>'list', 'nows'=>1,
'match'=>'PGE::Exp::Concat')
Modified: trunk/runtime/parrot/library/STM.pir
==============================================================================
--- trunk/runtime/parrot/library/STM.pir (original)
+++ trunk/runtime/parrot/library/STM.pir Tue Jan 6 23:29:18 2009
@@ -38,7 +38,7 @@
restart_tx:
.local pmc statuses
- statuses = find_global 'statuses'
+ statuses = get_global 'statuses'
tx_flags = bor tx_flags, STATUS_COMMIT
push statuses, tx_flags
@@ -47,7 +47,7 @@
the_result = new 'Undef'
.local pmc _thelper
- _thelper = find_global '_transaction_helper'
+ _thelper = get_global '_transaction_helper'
$P0 = newclosure _thelper
stm_start
@@ -61,10 +61,10 @@
#print $I0
#print "\n"
.local pmc ends
- ends = find_global 'ends'
+ ends = get_global 'ends'
$P0 = pop ends
.local int status
- statuses = find_global 'statuses'
+ statuses = get_global 'statuses'
status = pop statuses
status = band status, STATUS_MASK
if status == STATUS_COMMIT goto do_commit
@@ -124,14 +124,14 @@
closure = find_lex 'closure'
args = find_lex 'args'
the_cont = interpinfo .INTERPINFO_CURRENT_CONT
- ends = find_global 'ends'
+ ends = get_global 'ends'
push ends, the_cont
.tailcall closure(args :flat)
.end
.sub _end_tx
.local pmc ends
- ends = find_global 'ends'
+ ends = get_global 'ends'
.local pmc end
end = ends[-1]
$P0 = end() # workaround?
@@ -140,7 +140,7 @@
.sub _cur_status
.local pmc statuses
- statuses = find_global 'statuses'
+ statuses = get_global 'statuses'
$I0 = statuses
if $I0 == 0 goto none_such
$I0 = $I0 - 1
@@ -154,7 +154,7 @@
.sub _set_status
.param int new_status
.local pmc statuses
- statuses = find_global 'statuses'
+ statuses = get_global 'statuses'
$I0 = pop statuses
push statuses, new_status
.end
@@ -176,7 +176,7 @@
.local int this_status
.local pmc this_end
.local int i
- statuses = find_global 'statuses'
+ statuses = get_global 'statuses'
i = statuses
dec i
@@ -278,7 +278,7 @@
.param pmc args :slurpy
.local int status
- $P0 = find_global '_transaction'
+ $P0 = get_global '_transaction'
# print "STM::transaction("
# print closure
# print ", ...)\n"
Modified: trunk/t/op/calling.t
==============================================================================
--- trunk/t/op/calling.t (original)
+++ trunk/t/op/calling.t Tue Jan 6 23:29:18 2009
@@ -923,7 +923,7 @@
.sub main :main
.local pmc f
$I0 = 99
- f = find_global "foo"
+ f = get_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 Tue Jan 6 23:29:18 2009
@@ -97,7 +97,7 @@
code .= "returncc\n"
the_sub = my_compiler("_foo", code)
the_sub()
- the_sub = find_global "_foo"
+ the_sub = get_global "_foo"
the_sub()
.end
Modified: trunk/t/pmc/fixedpmcarray.t
==============================================================================
--- trunk/t/pmc/fixedpmcarray.t (original)
+++ trunk/t/pmc/fixedpmcarray.t Tue Jan 6 23:29:18 2009
@@ -305,14 +305,14 @@
compares = new 'Integer'
compares = 0
store_global "compares", compares
- cmp_fun = find_global "cmp_fun"
+ cmp_fun = get_global "cmp_fun"
sort_ar()
sort_ar(cmp_fun)
.end
.sub sort_ar
.param pmc cmp_fun :optional
.local pmc compares
- compares = find_global "compares"
+ compares = get_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 = find_global "compares"
+ compares = get_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 Tue Jan 6 23:29:18 2009
@@ -29,7 +29,7 @@
.sub 'test' :main
.local pmc divide
- divide = find_global "Integer_divide_Integer"
+ divide = get_global "Integer_divide_Integer"
add_multi "divide", "Integer,Integer,Integer", divide
$P0 = new 'Integer'
@@ -61,7 +61,7 @@
.sub _main
.local pmc add
- add = find_global "add"
+ add = get_global "add"
add_multi "add", "Integer,Integer,Integer", add
$P0 = new 'Integer'
@@ -93,7 +93,7 @@
.sub _main
.local pmc divide
- divide = find_global "Integer_divide_Integer"
+ divide = get_global "Integer_divide_Integer"
add_multi "divide", "Integer,Integer,Integer", divide
$P0 = new 'Integer'
@@ -121,7 +121,7 @@
.sub _main
.local pmc comp
- comp = find_global "Float_cmp_Integer"
+ comp = get_global "Float_cmp_Integer"
add_multi "cmp", "Float,Integer", comp
$P1 = new 'Float'
@@ -148,7 +148,7 @@
.sub _main
.local pmc comp
- comp = find_global "Float_cmp_Integer"
+ comp = get_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 = find_global "Float_cmp_Integer"
+ comp = get_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 = find_global "Integer_divide_Integer"
+ divide = get_global "Integer_divide_Integer"
add_multi "divide", "Integer,Integer,Integer", divide
\$P0 = new 'Integer'
Modified: trunk/t/pmc/object-meths.t
==============================================================================
--- trunk/t/pmc/object-meths.t (original)
+++ trunk/t/pmc/object-meths.t Tue Jan 6 23:29:18 2009
@@ -727,7 +727,7 @@
subclass cl, cl, "Bar"
o = new "Bar"
print o
- $P0 = find_global "ok2"
+ $P0 = get_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 Tue Jan 6 23:29:18 2009
@@ -1011,7 +1011,7 @@
o = Foo34()
is( o, 'Foo34', 'found global Foo34' )
- f = find_global "Foo34"
+ f = get_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 Tue Jan 6 23:29:18 2009
@@ -930,11 +930,11 @@
.sub main :main
"foo"()
print "ok\n"
- $P0 = find_global "new"
+ $P0 = get_global "new"
$I0 = defined $P0
print $I0
print "\n"
- $P0 = find_global "foo"
+ $P0 = get_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 Tue Jan 6 23:29:18 2009
@@ -82,7 +82,7 @@
.local pmc threadfunc
.local pmc thread
$I5 = 10
- threadfunc = find_global "foo"
+ threadfunc = get_global "foo"
thread = new 'ParrotThread'
thread.'run_clone'(threadfunc)
@@ -125,7 +125,7 @@
.local pmc threadfunc
.local pmc thread
$I5 = 10
- threadfunc = find_global "foo"
+ threadfunc = get_global "foo"
thread = new 'ParrotThread'
thread.'run_clone'(threadfunc)
@@ -171,7 +171,7 @@
$P6 = 'from '
print "ok 1\n"
- threadsub = find_global "foo"
+ threadsub = get_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 = find_global "foo"
+ threadsub = get_global "foo"
thread = new 'ParrotThread'
$I0 = thread
print 'start '
@@ -249,7 +249,7 @@
.const int MAX = 1000
.local pmc kid
.local pmc Adder
- Adder = find_global '_add'
+ Adder = get_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 = find_global '_foo'
+ foo = get_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 = find_global "_foo"
+ foo = get_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 = find_global '_foo'
+ foo = get_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 = find_global 'test4'
+ test4 = get_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 = find_global 'thread_func'
+ thread_func = get_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 = find_global 'test_num'
+ number = get_global 'test_num'
if what == expect goto okay
print "# got: "
print what
@@ -866,7 +866,7 @@
.end
.sub _check_sanity
- $P0 = find_global 'foo'
+ $P0 = get_global 'foo'
$P1 = get_hll_global [ 'Foo' ], 'foo'
is($P0, $P1)
.end
@@ -879,7 +879,7 @@
.sub check_sanity
_check_sanity()
- $P0 = find_global '_check_sanity'
+ $P0 = get_global '_check_sanity'
$P0()
$P0 = get_hll_global [ 'Foo' ], '_check_sanity'
$P0()
@@ -887,14 +887,14 @@
.sub _check_value
.param int value
- $P0 = find_global 'foo'
+ $P0 = get_global 'foo'
is($P0, value)
.end
.sub check_value
.param int value
_check_value(value)
- $P0 = find_global '_check_value'
+ $P0 = get_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 = find_global 'test'
+ thread_func = get_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 = find_global '_foo'
+ foo = get_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 Tue Jan 6 23:29:18 2009
@@ -73,8 +73,8 @@
a = 0
a = new 'STMRef', a
- _incr = find_global "incr"
- _waiter = find_global "waiter"
+ _incr = get_global "incr"
+ _waiter = get_global "waiter"
wThr = new 'ParrotThread'
wThr.'run_clone'(_waiter, a)
@@ -139,8 +139,8 @@
a = ""
a = new 'STMRef', a
- _incr = find_global "incr"
- _waiter = find_global "waiter"
+ _incr = get_global "incr"
+ _waiter = get_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 Tue Jan 6 23:29:18 2009
@@ -100,7 +100,7 @@
$P0 = new 'STMVar', $P0
values[1] = $P0
.local pmc _thread_main
- _thread_main = find_global 'do_choice'
+ _thread_main = get_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 = find_global '_wakeup_func'
+ real_sub = get_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 = find_global 'do_choice'
+ _thread_main = get_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 = find_global 'wakeup_func'
+ _wakeup_thread_main = get_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 = find_global '_wakeup_func'
+ real_sub = get_global '_wakeup_func'
transaction(real_sub, what)
.return (0)
.end
@@ -392,7 +392,7 @@
.param int blockp
$P0 = get_hll_global ['STM'], 'transaction'
- $P1 = find_global '_fetchHead'
+ $P1 = get_global '_fetchHead'
.tailcall $P0($P1, self, removep, blockp)
.end
@@ -447,7 +447,7 @@
.param int blockp
$P0 = get_hll_global ['STM'], 'transaction'
- $P1 = find_global '_addTail'
+ $P1 = get_global '_addTail'
$P2 = $P0($P1, self, what, blockp)
.return ($P2)
.end
@@ -550,8 +550,8 @@
$P0 = get_hll_global ['STMQueue'], '__onload'
$P0()
- _add = find_global "adder"
- _remove = find_global "remover"
+ _add = get_global "adder"
+ _remove = get_global "remover"
addThread = new 'ParrotThread'
removeThread = new 'ParrotThread'
@@ -605,7 +605,7 @@
queue = $P0.'new'('length' => SIZE)
$P0 = get_hll_global ['STM'], 'transaction'
- $P1 = find_global '_test'
+ $P1 = get_global '_test'
$P0($P1, queue)
print "ok\n"