Author: allison Date: Wed Oct 17 12:33:17 2007 New Revision: 22180 Modified: trunk/docs/pdds/pdd15_objects.pod trunk/docs/pdds/pdd17_pmc.pod
Changes in other areas also in this revision: Added: trunk/include/parrot/oo.h - copied unchanged from r22176, /branches/pdd15oo/include/parrot/oo.h trunk/include/parrot/oo_private.h - copied unchanged from r22176, /branches/pdd15oo/include/parrot/oo_private.h trunk/src/oo.c - copied unchanged from r22176, /branches/pdd15oo/src/oo.c trunk/t/oo/isa.t - copied unchanged from r22176, /branches/pdd15oo/t/oo/isa.t trunk/t/oo/methods.t - copied unchanged from r22176, /branches/pdd15oo/t/oo/methods.t trunk/t/oo/proxy.t - copied unchanged from r22176, /branches/pdd15oo/t/oo/proxy.t trunk/t/oo/subclass.t - copied unchanged from r22176, /branches/pdd15oo/t/oo/subclass.t Removed: trunk/src/pmc/classobject.h trunk/t/pdd15oo/calling.t trunk/t/pdd15oo/gc.t trunk/t/pdd15oo/mmd.t trunk/t/pdd15oo/object-meths.t trunk/t/pdd15oo/object-mro.t trunk/t/pdd15oo/objects.t trunk/t/pdd15oo/spill.t trunk/t/pdd15oo/tail.t Modified: trunk/MANIFEST trunk/apps/p3/p3p.html trunk/compilers/imcc/imcc.l trunk/compilers/imcc/imclexer.c trunk/compilers/imcc/imcparser.c trunk/compilers/imcc/imcparser.h trunk/compilers/past-pm/PAST/Node.pir trunk/compilers/pct/src/HLLCompiler.pir trunk/compilers/pge/PGE/Exp.pir trunk/compilers/pge/PGE/Match.pir trunk/compilers/pge/PGE/OPTable.pir trunk/compilers/pge/PGE/P5Regex.pir trunk/compilers/pge/PGE/P6Regex.pir trunk/compilers/pge/PGE/Perl6Regex.pir trunk/compilers/pge/PGE/Regex.pir trunk/compilers/tge/TGE.pir trunk/config/gen/core_pmcs.pm trunk/config/gen/makefiles/root.in trunk/docs/book/ch04_pir_subroutines.pod trunk/docs/compiler_faq.pod trunk/docs/imcc/calling_conventions.pod trunk/examples/benchmarks/oo1.pasm trunk/examples/benchmarks/oo2.pasm trunk/examples/benchmarks/oo3.pasm trunk/examples/benchmarks/oo4.pasm trunk/examples/benchmarks/oo5.pir trunk/examples/benchmarks/oo6.pir trunk/examples/benchmarks/oofib.pir trunk/examples/io/httpd2.pir trunk/examples/japh/japh4.pasm trunk/examples/japh/japh5.pasm trunk/examples/japh/japh6.pasm trunk/examples/pge/simple.pir trunk/examples/pir/sudoku.pir trunk/examples/sdl/anim_image.pir trunk/examples/sdl/anim_image_dblbuf.pir trunk/examples/sdl/blue_font.pir trunk/examples/sdl/blue_rect.pir trunk/examples/sdl/bounce_parrot_logo.pir trunk/examples/sdl/lcd/clock.pir trunk/examples/sdl/mandel.pir trunk/examples/sdl/minesweeper/eventhandler.pir trunk/examples/sdl/minesweeper/field.pir trunk/examples/sdl/minesweeper/mines.pir trunk/examples/sdl/move_parrot_logo.pir trunk/examples/sdl/raw_pixels.pir trunk/examples/sdl/tetris/app.pir trunk/examples/sdl/tetris/block.pir trunk/examples/sdl/tetris/blockdata.pir trunk/examples/sdl/tetris/blocks.pir trunk/examples/sdl/tetris/board.pir trunk/examples/sdl/tetris/boarddata.pir trunk/examples/sdl/tetris/eventhandler.pir trunk/examples/sdl/tetris/tetris.pir trunk/examples/streams/Bytes.pir trunk/examples/streams/Combiner.pir trunk/examples/streams/Coroutine.pir trunk/examples/streams/FileLines.pir trunk/examples/streams/Filter.pir trunk/examples/streams/Include.pir trunk/examples/streams/Lines.pir trunk/examples/streams/ParrotIO.pir trunk/examples/streams/Replay.pir trunk/examples/streams/SubCounter.pir trunk/examples/streams/SubHello.pir trunk/examples/streams/Writer.pir trunk/include/parrot/objects.h trunk/include/parrot/parrot.h trunk/include/parrot/pmc.h trunk/languages/WMLScript/t/pmc/boolean.t trunk/languages/WMLScript/t/pmc/float.t trunk/languages/WMLScript/t/pmc/integer.t trunk/languages/WMLScript/t/pmc/invalid.t trunk/languages/WMLScript/t/pmc/string.t trunk/languages/c99/src/CPP_PASTNodes.pir trunk/languages/c99/src/CPP_PGE2AST.pir trunk/languages/cardinal/cardinal.pir trunk/languages/cardinal/src/AST2OST.pir trunk/languages/cardinal/src/OST2PIR.pir trunk/languages/cardinal/src/PAST.pir trunk/languages/cardinal/src/PGE2AST.pir trunk/languages/dotnet/src/method.pir trunk/languages/dotnet/src/translator.pir trunk/languages/forth/forth.pir trunk/languages/lua/t/pmc/boolean.t trunk/languages/lua/t/pmc/closure.t trunk/languages/lua/t/pmc/function.t trunk/languages/lua/t/pmc/nil.t trunk/languages/lua/t/pmc/number.t trunk/languages/lua/t/pmc/string.t trunk/languages/lua/t/pmc/table.t trunk/languages/lua/t/pmc/thread.t trunk/languages/lua/t/pmc/userdata.t trunk/languages/perl5/t/sparse_perlarray.t trunk/languages/pheme/lib/PhemeSymbols.pir trunk/lib/Parrot/Pmc2c/PMC/Object.pm trunk/lib/Parrot/Pmc2c/PMC/delegate.pm trunk/lib/Parrot/Pmc2c/PMCEmitter.pm trunk/lib/Parrot/Test.pm trunk/runtime/parrot/library/Data/Dumper.pir trunk/runtime/parrot/library/Data/Dumper/Base.pir trunk/runtime/parrot/library/Data/Dumper/Default.pir trunk/runtime/parrot/library/Data/Replace.pir trunk/runtime/parrot/library/File/Spec.pir trunk/runtime/parrot/library/File/Spec/Unix.pir trunk/runtime/parrot/library/File/Spec/Win32.pir trunk/runtime/parrot/library/Getopt/Obj.pir trunk/runtime/parrot/library/HTTP/Daemon.pir trunk/runtime/parrot/library/Iter.pir trunk/runtime/parrot/library/PGE/Dumper.pir trunk/runtime/parrot/library/PGE/Hs.pir trunk/runtime/parrot/library/Parrot/Coroutine.pir trunk/runtime/parrot/library/Pg.pir trunk/runtime/parrot/library/SDL.pir trunk/runtime/parrot/library/SDL/App.pir trunk/runtime/parrot/library/SDL/Button.pir trunk/runtime/parrot/library/SDL/Color.pir trunk/runtime/parrot/library/SDL/Constants.pir trunk/runtime/parrot/library/SDL/Event.pir trunk/runtime/parrot/library/SDL/EventHandler.pir trunk/runtime/parrot/library/SDL/Font.pir trunk/runtime/parrot/library/SDL/Image.pir trunk/runtime/parrot/library/SDL/LCD.pir trunk/runtime/parrot/library/SDL/Rect.pir trunk/runtime/parrot/library/SDL/Sprite.pir trunk/runtime/parrot/library/SDL/StopWatch.pir trunk/runtime/parrot/library/SDL/Surface.pir trunk/runtime/parrot/library/Stream/Base.pir trunk/runtime/parrot/library/Stream/Combiner.pir trunk/runtime/parrot/library/Stream/Coroutine.pir trunk/runtime/parrot/library/Stream/Filter.pir trunk/runtime/parrot/library/Stream/Lines.pir trunk/runtime/parrot/library/Stream/ParrotIO.pir trunk/runtime/parrot/library/Stream/Replay.pir trunk/runtime/parrot/library/Stream/Sub.pir trunk/runtime/parrot/library/Stream/Writer.pir trunk/runtime/parrot/library/Test/Builder.pir trunk/runtime/parrot/library/Test/Builder/Test.pir trunk/runtime/parrot/library/Test/Builder/Tester.pir trunk/runtime/parrot/library/Test/More.pir trunk/runtime/parrot/library/dumper.pir trunk/src/dynpmc/main.pasm trunk/src/gc/dod.c trunk/src/global_setup.c trunk/src/inter_create.c trunk/src/inter_misc.c trunk/src/mmd.c trunk/src/objects.c trunk/src/ops/experimental.ops trunk/src/ops/object.ops trunk/src/ops/ops.num trunk/src/ops/pmc.ops trunk/src/ops/set.ops trunk/src/packfile.c trunk/src/pmc.c trunk/src/pmc/capture.pmc trunk/src/pmc/class.pmc trunk/src/pmc/default.pmc trunk/src/pmc/delegate.pmc trunk/src/pmc/fixedpmcarray.pmc trunk/src/pmc/integer.pmc trunk/src/pmc/namespace.pmc trunk/src/pmc/object.pmc trunk/src/pmc/parrotclass.pmc trunk/src/pmc/pmcproxy.pmc trunk/src/pmc/resizablepmcarray.pmc trunk/src/pmc/role.pmc trunk/src/pmc/super.pmc trunk/src/pmc/unmanagedstruct.pmc trunk/src/pmc_freeze.c trunk/src/thread.c trunk/t/compilers/imcc/reg/spill.t trunk/t/compilers/imcc/syn/objects.t trunk/t/compilers/imcc/syn/tail.t trunk/t/compilers/pge/06-grammar.t trunk/t/compilers/pge/p6regex/01-regex.t trunk/t/compilers/tge/grammar.t trunk/t/compilers/tge/parser.t trunk/t/distro/file_metadata.t trunk/t/dynpmc/foo.t trunk/t/dynpmc/gdbmhash.t trunk/t/dynpmc/rational.t trunk/t/examples/streams.t trunk/t/library/File_Spec.t trunk/t/library/coroutine.t trunk/t/library/dumper.t trunk/t/library/streams.t trunk/t/library/test_builder_tester.t trunk/t/library/test_more.t trunk/t/oo/new.t trunk/t/oo/ops.t trunk/t/op/calling.t trunk/t/op/cmp-nonbranch.t trunk/t/op/gc.t trunk/t/op/string.t trunk/t/pdd15oo/dumper.t trunk/t/pdd15oo/exception.t trunk/t/pdd15oo/freeze.t trunk/t/pdd15oo/grammar.t trunk/t/pdd15oo/llqueue.t trunk/t/pdd15oo/namespace.t trunk/t/pdd15oo/parrotobject.t trunk/t/pdd15oo/queue.t trunk/t/pdd15oo/ro.t trunk/t/pdd15oo/runtime.t trunk/t/pdd15oo/string.t trunk/t/pdd15oo/sub.t trunk/t/pdd15oo/test_more.t trunk/t/pdd15oo/threads.t trunk/t/pmc/capture.t trunk/t/pmc/delegate.t trunk/t/pmc/freeze.t trunk/t/pmc/mmd.t trunk/t/pmc/namespace.t trunk/t/pmc/object-meths.t trunk/t/pmc/object-mro.t trunk/t/pmc/objects.t trunk/t/pmc/pmc.t trunk/t/pmc/resizablepmcarray.t trunk/t/pmc/sub.t trunk/t/pmc/threads.t trunk/t/stm/queue.t trunk/t/stm/runtime.t trunk/vtable.tbl Log: [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk. Modified: trunk/docs/pdds/pdd15_objects.pod ============================================================================== --- trunk/docs/pdds/pdd15_objects.pod (original) +++ trunk/docs/pdds/pdd15_objects.pod Wed Oct 17 12:33:17 2007 @@ -346,11 +346,16 @@ automatically make it a method of the class, you have to call add_method too. -=item isa(class *) +=item isa(pmc *) -Returns true or false if the class passed in as a parameter is in the -inheritance hierarchy of the object. {{This should also support type -names and namespace names as a parameter, not just class objects.}} +Returns true or false if the class object, namespace object, key, or +string name PMC passed in as a parameter is a class in the inheritance +hierarchy of the object. + +=item isa_str(string *) + +Returns true or false if the string passed in as a parameter is a +class in the inheritance hierarchy of the object. =item can(string *) @@ -641,11 +646,23 @@ =item get_attr(STRING*) -Returns the attribute with the fully qualified name for the object. +Returns the attribute with the string name for the object. + +=item get_attr_keyed(PMC*, STRING*) -=item set_attr(STRING*, PMC *) +Returns the attribute with the string name for the object. Lookup is on +the attribute store of a particular parent of the object's class, +identified by a classname, namespace, or key PMC. -Set the attribute with the fully qualified name for the object. +=item set_attr(STRING*, PMC*) + +Set the attribute with the string name for the object. + +=item set_attr_keyed(PMC*, STRING*, PMC*) + +Set the attribute with the string name for the object. The value is set +in the attribute store of a particular parent of the object's class, +identified by a classname, namespace, or key PMC. =item get_class @@ -929,7 +946,7 @@ key $P3 for the parent class. If the attribute doesn't exist, it will throw an exception. If the attribute -exists, but the value hasn't been set, it will return an C<Undef> PMC. +exists, but the value hasn't been set, it will return a null PMC. =item setattribute @@ -945,43 +962,52 @@ =item callmethod - callmethod - callmethod $S1 + callmethod $P1, $S1, $P2 + +Call the method specified in the attribute $S1 using $P1 as the invocant and +using the continuation passed in $P2. If you need to create a new continuation +use C<callmethodcc>. + + callmethod $P1, $P2, $P3 + +Call the method specified in the Sub object $P2 using $P1 as the invocant and +using the continuation passed in $P3. If you need to create a new continuation +use C<callmethodcc>. -Call a method. If the method name is provided in $S1, we find the PMC -for the named method and put it in the sub/method slot. If no name is -provided we assume that all the calling conventions have already been -set up and the method PMC is already in the proper place. =item callmethodcc - callmethodcc - callmethodcc $S1 + callmethodcc $P1, $S1 + callmethodcc $P1, $P2 + +Call the method specified in the attribute $S1, or in the Sub object $P2, using +$P1 as the invocant for method lookup and generate a new return continuation. -Make a method call, automatically generating a return continuation. If a -method name is passed in we look up the method PMC for the object and -put it in the method slot. If a method name isn't provided then we -assume that things are already properly set up. +Throws a Method_Not_Found_Exception for a non-existent method. =item callmethodsupercc - callmethodsupercc $S1 + callmethodsupercc $P1, $S1 + callmethodsupercc $P1, $P2 -Make a method call, automatically generating a return continuation. A variant -of C<callmethodcc> that skips over the current class when searching for the -method, and only looks in the parent classes. PIR may provide some syntactic -sugar for this. +Call the method specified in the attribute $S1, or in the Sub object $P2, using +$P1 as the invocant for method lookup and generate a new return continuation. +This is a variant of C<callmethodcc> that skips over the current class when +searching for the method, and only looks in the parent classes. PIR may +provide some syntactical sugar for this. =item callmethodnextcc - callmethodnextcc $S1 + callmethodnextcc $P1, $S1 + callmethodnextcc $P1, $P2 -Make a method call, automatically generating a return continuation. A variant -of C<callmethodcc> that picks up an existing C<find_method> search where it -left off for the current call. {{ Note: this depends on find_method being -resumable, and on the context of a particular method including a pointer to the -find_method call that found it. Neither may be feasible. }} PIR may provide -some syntactic sugar for this. +Call the method specified in the attribute $S1, or in the Sub object $P2, +using $P1 as the invocant for method lookup and generate a new return +continuation. A variant of C<callmethodcc> that picks up an existing +C<find_method> search where it left off for the current call. {{ Note: this +depends on find_method being resumable, and on the context of a particular +method including a pointer to the find_method call that found it. Neither may +be feasible. }} PIR may provide some syntactic sugar for this. =item newclass @@ -993,7 +1019,12 @@ =item subclass + $P1 = subclass $S2 + $P1 = subclass $P2 + $P1 = subclass $S2, $S3 $P1 = subclass $P2, $S3 + $P1 = subclass $S2, $P3 + $P1 = subclass $P2, $P3 Create a new class, named $S3, which has $P2 as its immediate parent. $P2 may be either another high-level class based on the Class PMC, or it may be a @@ -1012,6 +1043,18 @@ in that namespace object. A key looks for the class in the namespace identified by the multilevel key relative to the currently selected HLL. +If the class doesn't exist, it returns a null PMC. + +=item typeof + + $S1 = typeof $P2 + $P1 = typeof $P2 + +Lookup the type of the instance object in $P2. Return the string name if the +destination is a string register or variable. If the destination is a PMC +register or variable, return the class object for an instance of a high-level +class, or the class proxy object for an instance of a low-level PMC. + =item new $P1 = new $S2 Modified: trunk/docs/pdds/pdd17_pmc.pod ============================================================================== --- trunk/docs/pdds/pdd17_pmc.pod (original) +++ trunk/docs/pdds/pdd17_pmc.pod Wed Oct 17 12:33:17 2007 @@ -433,7 +433,7 @@ In C code, the first parameter to any vtable routine is the current interpreter. The second parameter is the PMC itself. -The following list details each of the vtable methods, their prototypes, and +The following list details each of the vtable functions, their prototypes, and their behavior. =head3 Core Vtable Functions