methodPrinter.hpp

Go to the documentation of this file.
00001 /* Copyright 1994, 1995 LongView Technologies L.L.C. $Revision: 1.42 $ */
00002 /* Copyright (c) 2006, Sun Microsystems, Inc.
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 
00006 following conditions are met:
00007 
00008     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 
00010           disclaimer in the documentation and/or other materials provided with the distribution.
00011     * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived 
00012           from this software without specific prior written permission.
00013 
00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 
00015 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
00016 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00017 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00018 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
00019 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00020 
00021 
00022 */
00023 
00024 // MethodPrinter dumps, on the console, all byte-codes of a method.
00025 // In addition blocks contained in the method are dumped at the
00026 // byte code pushing the block context.
00027 // Usage:
00028 //   MethodPrinterClosure blk(output);
00029 //   MethodIterator mi(method, &blk);
00030 
00031 class MethodPrinterClosure: public MethodClosure {
00032  private:
00033    outputStream*  st;
00034    void MethodPrinterClosure::print_sendtype(Bytecodes::SendType type);
00035    void show(char* str);
00036    void indent();
00037  public:
00038   MethodPrinterClosure(outputStream* stream = NULL);
00039   void if_node(IfNode* node);
00040   void cond_node(CondNode* node);
00041   void while_node(WhileNode* node);
00042   void primitive_call_node(PrimitiveCallNode* node);
00043   void dll_call_node(DLLCallNode* node);
00044 
00045   void allocate_temporaries(int nofTemps);
00046   void push_self();
00047   void push_tos();
00048   void push_literal(oop obj);
00049   void push_argument(int no);
00050   void push_temporary(int no);
00051   void push_temporary(int no, int context);
00052   void push_instVar(int offset);
00053   void push_instVar_name(symbolOop name);
00054   void push_classVar(associationOop assoc);
00055   void push_classVar_name(symbolOop name);
00056 
00057   void push_global(associationOop obj);
00058   void store_temporary(int no);
00059   void store_temporary(int no, int context);
00060   void store_instVar(int offset);
00061   void store_instVar_name(symbolOop name);
00062   void store_classVar(associationOop assoc);
00063   void store_classVar_name(symbolOop name);
00064 
00065   void store_global(associationOop obj);
00066   void pop();
00067   void normal_send(InterpretedIC* ic);
00068   void self_send  (InterpretedIC* ic);
00069   void super_send (InterpretedIC* ic);
00070   void double_equal();
00071   void double_not_equal();
00072   void method_return(int nofArgs);
00073   void nonlocal_return(int nofArgs);
00074   void allocate_closure(AllocationType type, int nofArgs, methodOop meth);
00075   void allocate_context(int nofTemps, bool forMethod);
00076   void set_self_via_context();
00077   void copy_self_into_context();
00078   void copy_argument_into_context(int argNo, int no);
00079   void zap_scope();
00080   void predict_prim_call(primitive_desc* pdesc, int failure_start);
00081   void float_allocate(int nofFloatTemps, int nofFloatExprs);
00082   void float_floatify(Floats::Function f, int tof);
00083   void float_move(int tof, int from);
00084   void float_set(int tof, doubleOop value);
00085   void float_nullary(Floats::Function f, int tof);
00086   void float_unary(Floats::Function f, int tof);
00087   void float_binary(Floats::Function f, int tof);
00088   void float_unaryToOop(Floats::Function f, int tof);
00089   void float_binaryToOop(Floats::Function f, int tof);
00090 };

Generated on Mon Oct 9 13:37:15 2006 for Strongtalk VM by  doxygen 1.4.7