Skip to content
This repository
branch: nqp_pct
Fetching contributors…

Cannot retrieve contributors at this time

file 55 lines (45 sloc) 1.215 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
# Copyright (C) 2004-2009, Parrot Foundation.

# all timings Athlon 800, gcc 2.95.2

# parrot SVN-HEAD
# perl 5.8.0
# python 2.3.3

# perl oo2.pl 4.0
# python oo2.py 2.9 (first time)
# python oo2.py 2.4

# parrot -R jit oo2.pasm -g -O3
# with reuse regsave mem 6.1
# anchor P1 6.5
# Dan's new object layout 4.9

# parrot -R jit oo2-prop.pasm 2.6

.namespace [ "Foo" ]
.sub 'main' :main
    newclass $P1, "Foo"
    addattribute $P1, ".i"
    addattribute $P1, ".j"

    $I10 = 0
    $I11 = 50000
loop:
    new $P3, "Foo"
    inc $I10
    if $I10 < $I11 goto loop

    new $P3, "Foo"
    getattribute $P2, $P3, ".i"
    print $P2
    print "\n"
.end

.sub 'init' :vtable
.include "interpinfo.pasm"
    interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
    $P10 = new 'Integer'
    $P10 = 10
    setattribute $P2, ".i", $P10
    $P10 = new 'Integer'
    $P10 = 20
    setattribute $P2, ".j", $P10
    .return ()
.end

# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
Something went wrong with that request. Please try again.