~ubuntu-branches/ubuntu/precise/rakudo/precise

« back to all changes in this revision

Viewing changes to src/cheats/callmethod.pir

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghedini
  • Date: 2011-05-17 11:31:09 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517113109-rmfir654u1axbpt4
Tags: 0.1~2011.04-1
* New upstream release (Closes: #601862, #585762, #577502)
* New maintainer
* Switch to 3.0 (quilt) format
* Update dependencies (Closes: #584498)
* Update debian/copyright to lastest DEP5 revision
* Do not generate/install perl6 manpage (now done by the build system)
* Enable tests
* Bump Standards-Version to 3.9.2 (no changes needed)
* Do not install extra LICENSE files and duplicated docs
* Remove debian/clean (no more needed)
* Add Vcs-* fields in debian/control
* Rewrite (short) description
* Update upstream copyright years
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Invoke a method on a possibly foreign object.  If the object
 
2
# supports the requested method, we use it, otherwise we assume
 
3
# the object is foreign and try using the corresponding method
 
4
# from C<Any>.
 
5
 
 
6
.namespace []
 
7
.sub '!CALLMETHOD'
 
8
    .param string method
 
9
    .param pmc obj
 
10
    $I0 = can obj, method
 
11
    unless $I0 goto any_method
 
12
    .tailcall obj.method()
 
13
  any_method:
 
14
    .local pmc anyobj
 
15
    anyobj = get_global '$!ANY'
 
16
    unless null anyobj goto any_method_1
 
17
    anyobj = new ['Any']
 
18
    set_global '$!ANY', anyobj
 
19
  any_method_1:
 
20
    $P0 = find_method anyobj, method
 
21
    .tailcall obj.$P0()
 
22
.end