diff -uNr Harmony.orig/build/patches/common/LOG4CXX/include/log4cxx/helpers/unicodehelper.h Harmony/build/patches/common/LOG4CXX/include/log4cxx/helpers/unicodehelper.h --- Harmony.orig/build/patches/common/LOG4CXX/include/log4cxx/helpers/unicodehelper.h 1970-01-01 03:00:00.000000000 +0300 +++ Harmony/build/patches/common/LOG4CXX/include/log4cxx/helpers/unicodehelper.h 2006-05-05 14:38:28.000000000 +0400 @@ -0,0 +1,123 @@ +/* + * Copyright 2003,2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _LOG4CXX_HELPERS_UNICODEHELPER_H +#define _LOG4CXX_HELPERS_UNICODEHELPER_H + +#include +#include + +namespace log4cxx { + namespace helpers { + /** + * UnicodeHelper provides static methods for encoding and decoding + * UTF-8, UTF-16 and wchar_t from UCS-4 values. + * + */ + class UnicodeHelper { + private: + /** + * Inaccessible constructor. + */ + UnicodeHelper() { + } + + public: + /** + * Decodes next character from a sequence of UTF-8 bytes. + * @param src start of character, will be modified to point at next character. + * @param srcEnd end of sequence. + * @return scalar value (UCS-4) or 0xFFFF if invalid sequence. + */ + static unsigned int decodeUTF8(const char*& src, + const char* srcEnd); + + + /** + * Encodes a character using UTF-8. + * @param ch UCS-4 value. + * @param dst buffer to receive UTF-8 encoding (must be at least 8 bytes) + * @return number of bytes needed to represent character + */ + static int encodeUTF8(unsigned int ch, char* dst); + + /** + * Encodes a character using UTF-16BE. + * @param ch UCS-4 value. + * @param dst buffer to receive UTF-16BE encoding (must be at least 4 bytes) + * @return number of bytes needed to represent character + */ + static int encodeUTF16BE(unsigned int ch, char* dst); + + /** + * Encodes a character using UTF-16LE. + * @param ch UCS-4 value. + * @param dst buffer to receive UTF-16BE encoding (must be at least 4 bytes) + * @return number of bytes needed to represent character + */ + static int encodeUTF16LE(unsigned int ch, char* dst); + + +#if LOG4CXX_HAS_WCHAR_T + /** + * Decodes next character from a sequence of wchar_t values. + * @param src start of character, will be modified to point at next character. + * @param srcEnd end of sequence. + * @return scalar value (UCS-4) or 0xFFFF if invalid sequence. + */ + static unsigned int decodeWide(const wchar_t*& src, const wchar_t* srcEnd); + + + /** + * Encodes a character to wchar_t. + * @param ch UCS-4 value. + * @param dst buffer to receive wchar_t (must be at least 2 wchar_t) + * @return number of wchar_t needed to represent character + */ + static int encodeWide(unsigned int ch, wchar_t* str); + + /** + * Determines the number of UTF-8 bytes required to express + * the wchar_t value. + * @param ch wchar_t value + * @return number of bytes required. + */ + static int lengthUTF8(wchar_t ch); + +#endif + + /** + * Decodes next character from a LogString. + * @param in string from which the character is extracted. + * @param iter iterator addressing start of character, will be + * advanced to next character if successful. + * @return scalar value (UCS-4) or 0xFFFF if invalid sequence. + */ + static unsigned int decode(const LogString& in, + LogString::const_iterator& iter); + + /** + * Encodes a UCS-4 value to logchar. + * @param ch UCS-4 value. + * @param dst buffer to receive logchar encoding (must be at least 8) + * @return number of logchar needed to represent character + */ + static int encode(unsigned int ch, logchar* dst); + + }; + } +} +#endif diff -uNr Harmony.orig/build/patches/common/LOG4CXX/include/log4cxx/xml/domconfigurator.h Harmony/build/patches/common/LOG4CXX/include/log4cxx/xml/domconfigurator.h --- Harmony.orig/build/patches/common/LOG4CXX/include/log4cxx/xml/domconfigurator.h 1970-01-01 03:00:00.000000000 +0300 +++ Harmony/build/patches/common/LOG4CXX/include/log4cxx/xml/domconfigurator.h 2006-05-05 14:36:44.000000000 +0400 @@ -0,0 +1,260 @@ +/* + * Copyright 2003-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _LOG4CXX_XML_DOM_CONFIGURATOR_H +#define _LOG4CXX_XML_DOM_CONFIGURATOR_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace log4cxx +{ + class File; + + namespace spi + { + class LoggerRepository; + typedef helpers::ObjectPtrT LoggerRepositoryPtr; + + class Filter; + typedef helpers::ObjectPtrT FilterPtr; + + class AppenderAttachable; + typedef helpers::ObjectPtrT AppenderAttachablePtr; + + class OptionHandler; + typedef helpers::ObjectPtrT OptionHandlerPtr; + } + + namespace helpers + { + class XMLDOMDocument; + typedef helpers::ObjectPtrT XMLDOMDocumentPtr; + + class XMLDOMElement; + typedef helpers::ObjectPtrT XMLDOMElementPtr; + } + + namespace config + { + class PropertySetter; + } + + namespace rolling + { + class RollingPolicy; + typedef helpers::ObjectPtrT RollingPolicyPtr; + + class TriggeringPolicy; + typedef helpers::ObjectPtrT TriggeringPolicyPtr; + } + + + + namespace xml + { + class AppenderMap + { + public: + AppenderPtr get(const LogString& appenderName); + void put(const LogString& appenderName, AppenderPtr appender); + + protected: + std::map map; + }; + + /** + Use this class to initialize the log4cxx environment using a DOM tree. + +

Sometimes it is useful to see how log4cxx is reading configuration + files. You can enable log4cxx internal logging by setting the + debug attribute in the + log4cxx element. As in +

+                      <log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
+                      ...
+                      </log4j:configuration>
+              
+ +

There are sample XML files included in the package. + */ + class LOG4CXX_EXPORT DOMConfigurator : + virtual public spi::Configurator, + virtual public helpers::ObjectImpl + { + protected: + /** + Used internally to parse appenders by IDREF name. + */ + AppenderPtr findAppenderByName(helpers::XMLDOMDocumentPtr doc, + const LogString& appenderName); + + /** + Used internally to parse appenders by IDREF element. + */ + AppenderPtr findAppenderByReference( + helpers::XMLDOMElementPtr appenderRef); + + /** + Used internally to parse an appender element. + */ + AppenderPtr parseAppender(helpers::XMLDOMElementPtr appenderElement); + + /** + Used internally to parse an {@link spi::ErrorHandler ErrorHandler } element. + */ + void parseErrorHandler(helpers::XMLDOMElementPtr element, AppenderPtr appender); + + /** + Used internally to parse a filter element. + */ + void parseFilters(helpers::XMLDOMElementPtr element, + std::vector& filters); + + /** + Used internally to parse a logger element. + */ + void parseLogger(helpers::XMLDOMElementPtr loggerElement); + + /** + Used internally to parse the logger factory element. + */ + void parseLoggerFactory(helpers::XMLDOMElementPtr factoryElement); + + /** + Used internally to parse the logger factory element. + */ + log4cxx::rolling::TriggeringPolicyPtr parseTriggeringPolicy(helpers::XMLDOMElementPtr factoryElement); + + /** + Used internally to parse the logger factory element. + */ + log4cxx::rolling::RollingPolicyPtr parseRollingPolicy(helpers::XMLDOMElementPtr factoryElement); + + /** + Used internally to parse the roor category element. + */ + void parseRoot(helpers::XMLDOMElementPtr rootElement); + + /** + Used internally to parse the children of a category element. + */ + void parseChildrenOfLoggerElement(helpers::XMLDOMElementPtr catElement, + LoggerPtr logger, bool isRoot); + + /** + Used internally to parse a layout element. + */ + LayoutPtr parseLayout(helpers::XMLDOMElementPtr layout_element); + + /** + Used internally to parse a level element. + */ + void parseLevel(helpers::XMLDOMElementPtr element, + LoggerPtr logger, bool isRoot); + + void setParameter(helpers::XMLDOMElementPtr elem, + config::PropertySetter& propSetter); + + /** + Used internally to configure the log4cxx framework by parsing a DOM + tree of XML elements based on log4j.dtd. + + */ + void parse(helpers::XMLDOMElementPtr element); + + public: + DOMConfigurator(); + + DECLARE_LOG4CXX_OBJECT(DOMConfigurator) + BEGIN_LOG4CXX_CAST_MAP() + LOG4CXX_CAST_ENTRY(spi::Configurator) + END_LOG4CXX_CAST_MAP() + + DOMConfigurator(log4cxx::helpers::Pool& p); + + /** + A static version of #doConfigure. + */ + static void configure(const std::string& filename); +#if LOG4CXX_HAS_WCHAR_T + static void configure(const std::wstring& filename); +#endif + /** + Like #configureAndWatch(const String& configFilename, long delay) + except that the default delay as defined by + helpers::FileWatchdog#DEFAULT_DELAY is used. + @param configFilename A log4j configuration file in XML format. + */ + static void configureAndWatch(const std::string& configFilename); +#if LOG4CXX_HAS_WCHAR_T + static void configureAndWatch(const std::wstring& configFilename); +#endif + /** + Read the configuration file configFilename if it + exists. Moreover, a thread will be created that will periodically + check if configFilename has been created or + modified. The period is determined by the delay + argument. If a change or file creation is detected, then + configFilename is read to configure log4cxx. + + @param configFilename A log4j configuration file in XML format. + @param delay The delay in milliseconds to wait between each check. + */ + static void configureAndWatch(const std::string& configFilename, + long delay); +#if LOG4CXX_HAS_WCHAR_T + static void configureAndWatch(const std::wstring& configFilename, + long delay); +#endif + + /** + Interpret the XML file pointed by filename and set up + log4cxx accordingly. +

The configuration is done relative to the hierarchy parameter. + @param filename The file to parse. + @param repository The hierarchy to operation upon. + */ + void doConfigure(const File& filename, + spi::LoggerRepositoryPtr& repository); + + protected: + LogString subst(const LogString& value); + + protected: + void * appenderBag; + + helpers::Properties props; + spi::LoggerRepositoryPtr repository; + spi::LoggerFactoryPtr loggerFactory; + + private: + // prevent assignment or copy statements + DOMConfigurator(const DOMConfigurator&); + DOMConfigurator& operator=(const DOMConfigurator&); + }; + } // namespace xml +} // namespace log4cxx + +#endif // _LOG4CXX_XML_DOM_CONFIGURATOR_H diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/CodeGenIntfc.h Harmony/vm/jitrino/src/codegenerator/CodeGenIntfc.h --- Harmony.orig/vm/jitrino/src/codegenerator/CodeGenIntfc.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/CodeGenIntfc.h 2006-05-05 18:12:21.297988800 +0400 @@ -175,6 +175,7 @@ class InstructionCallback { public: + virtual ~InstructionCallback() {} virtual void opndMaybeGlobal(CG_OpndHandle* opnd) = 0; // tau generating instructions @@ -468,8 +469,10 @@ // class VarCodeSelector { public: + virtual ~VarCodeSelector() {} class Callback { public: + virtual ~Callback() {} virtual uint32 defVar(Type* varType,bool isAddressTaken,bool isPinned) = 0; virtual void setManagedPointerBase(uint32 managedPtrVarNum, uint32 baseVarNum) = 0; }; @@ -481,6 +484,7 @@ // class BlockCodeSelector { public: + virtual ~BlockCodeSelector() {} virtual void genCode(InstructionCallback&) = 0; }; @@ -489,8 +493,10 @@ // class CFGCodeSelector { public: + virtual ~CFGCodeSelector() {} class Callback { public: + virtual ~Callback() {} enum BlockKind {Prolog, InnerBlock, Epilog}; virtual uint32 genDispatchNode(uint32 numInEdges,uint32 numOutEdges,double cnt) = 0; virtual uint32 genBlock(uint32 numInEdges,uint32 numOutEdges, BlockKind blockKind, @@ -518,9 +524,11 @@ // class MethodCodeSelector { public: + virtual ~MethodCodeSelector() {} MethodCodeSelector() {} class Callback { public: + virtual ~Callback() {} virtual void genVars(uint32 numLocals,VarCodeSelector&) = 0; virtual void setMethodDesc(MethodDesc * desc) = 0; virtual void genCFG(uint32 numNodes,CFGCodeSelector&,bool useProfile) = 0; @@ -531,6 +539,7 @@ class CodeGenerator { public: + virtual ~CodeGenerator() {} virtual bool genCode(MethodCodeSelector&) = 0; static void readFlagsFromCommandLine(CompilationContext* cs, bool ia32Cg); static void showFlagsFromCommandLine(bool ia32Cg); @@ -538,12 +547,14 @@ class CodeGeneratorFactory { public: + virtual ~CodeGeneratorFactory() {} virtual CodeGenerator* getCodeGenerator(MemoryManager &mm, CompilationInterface& compInterface) = 0; }; class RuntimeInterface { public: + virtual ~RuntimeInterface() {} virtual void unwindStack(MethodDesc* methodDesc, ::JitFrameContext* context, bool isFirst) = 0; virtual void getGCRootSet(MethodDesc* methodDesc, GCInterface* gcInterface, diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CFG.h Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CFG.h --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CFG.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CFG.h 2006-05-05 18:12:21.297988800 +0400 @@ -39,6 +39,7 @@ class DispatchNode; class BasicBlock; class Inst; + class CFG; typedef double ProbValue; typedef double ExecCntValue; @@ -266,6 +267,7 @@ }; //--------------------------------------------------------------------------------------------- + virtual ~Node() {} /** Returns the ID of the node */ uint32 getId()const {return id;} /** Returns the kind of the node representing its class */ @@ -372,6 +374,7 @@ class DispatchNode : public Node { public: + virtual ~DispatchNode() {} /** Auxiliary method, returns true if the catch edges are sorted */ bool catchEdgesAreSorted()const; @@ -399,6 +402,7 @@ protected: UnwindNode(CFG * cfg, uint32 id, ExecCntValue cnt = UnknownExecCnt) :Node(cfg, id, cnt) {setKind(Kind_UnwindNode); } + virtual ~UnwindNode() {} //--------------------------------------------------------------------------------------------- friend class CFG; }; @@ -412,6 +416,7 @@ protected: ExitNode(CFG * cfg, uint32 id, ExecCntValue cnt = UnknownExecCnt) :Node(cfg, id, cnt) {setKind(Kind_ExitNode); } + virtual ~ExitNode() {} //--------------------------------------------------------------------------------------------- friend class CFG; }; @@ -547,7 +552,7 @@ void verify(); //--------------------------------------------------------------------------------------------- protected: - BasicBlock::BasicBlock(CFG * cfg, uint32 id, ExecCntValue cnt) + BasicBlock(CFG * cfg, uint32 id, ExecCntValue cnt) : Node(cfg, id, cnt), layoutSucc(NULL), codeOffset(0), codeSize(0), fallThroughEdge(0), directBranchEdge(0) {setKind(Kind_BasicBlock); } diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CallingConvention.h Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CallingConvention.h --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CallingConvention.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CallingConvention.h 2006-05-05 18:12:21.297988800 +0400 @@ -48,6 +48,7 @@ class CallingConvention { public: + virtual ~CallingConvention() {} //-------------------------------------------------------------- struct OpndInfo @@ -103,7 +104,7 @@ class STDCALLCallingConvention: public CallingConvention { public: - + virtual ~STDCALLCallingConvention() {} virtual void getOpndInfo(ArgKind kind, uint32 argCount, OpndInfo * infos)const; virtual uint32 getCalleeSavedRegs(OpndKind regKind)const; virtual bool calleeRestoresStack()const{ return true; } @@ -119,6 +120,7 @@ class DRLCallingConvention: public STDCALLCallingConvention { public: + virtual ~DRLCallingConvention() {} virtual bool pushLastToFirst()const{ return false; } }; @@ -131,6 +133,7 @@ class CDECLCallingConvention: public STDCALLCallingConvention { public: + virtual ~CDECLCallingConvention() {} virtual bool calleeRestoresStack()const{ return false; } }; diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.cpp Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.cpp --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.cpp 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.cpp 2006-05-05 18:12:21.328032000 +0400 @@ -352,7 +352,7 @@ } else if (!strcmp(params, "topdown")) { type = Linearizer::TOPDOWN; } else if (!strcmp(params, "mixed")) { - type = irManager.hasLoops() ? Linearizer::BOTTOM_UP : type = Linearizer::TOPDOWN; + type = irManager.hasLoops() ? Linearizer::BOTTOM_UP : Linearizer::TOPDOWN; } else if (!strcmp(params, "topological")) { type = Linearizer::TOPOLOGICAL; } else { diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.h Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.h --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32CodeLayout.h 2006-05-05 18:12:21.338046400 +0400 @@ -40,6 +40,7 @@ */ class Linearizer { public: + virtual ~Linearizer() {} enum LinearizerType { TOPOLOGICAL, TOPDOWN, BOTTOM_UP}; static void doLayout(LinearizerType t, IRManager* irManager); static bool hasValidLayout(IRManager* irm); @@ -88,6 +89,7 @@ friend class Linearizer; protected: TopologicalLayout(IRManager* irManager) : Linearizer(irManager){}; + virtual ~TopologicalLayout() {} void linearizeCfgImpl(); }; diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp Harmony/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp 2006-05-05 18:12:21.378104000 +0400 @@ -27,11 +27,11 @@ const Encoder::OpcodeGroupDescription Encoder::dummyOpcodeGroupDescription; const Encoder::MemOpndConstraints Encoder::memOpndConstraints[16]= { - { + {{ Constraint(OpndKind_GPReg, OpndSize_32), Constraint(OpndKind_GPReg, OpndSize_32), Constraint(OpndKind_Imm, OpndSize_32), - Constraint(OpndKind_Imm, OpndSize_32) }, + Constraint(OpndKind_Imm, OpndSize_32) }}, // others contain null constraints, to be fixed later }; diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h Harmony/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h 2006-05-05 18:12:21.398132800 +0400 @@ -182,14 +182,14 @@ Type * getType()const{ return type; } /** returns the constraint of the specified kind sk */ - Constraint Opnd::getConstraint(ConstraintKind ck)const + Constraint getConstraint(ConstraintKind ck)const { if (ck==ConstraintKind_Current) return constraints[ConstraintKind_Location].isNull()?constraints[ConstraintKind_Calculated]:constraints[ConstraintKind_Location]; return ck==ConstraintKind_Size?Constraint(OpndKind_Any, constraints[ConstraintKind_Initial].getSize()):constraints[ck]; } - Constraint Opnd::getConstraint(ConstraintKind ck, OpndSize size)const + Constraint getConstraint(ConstraintKind ck, OpndSize size)const { Constraint c=getConstraint(ck); return size==OpndSize_Any?c:c.getAliasConstraint(size); } /** returns true if the operand CAN BE assigned to a location defined by constraint @@ -291,7 +291,7 @@ private: //------------------------------------------------------------------------- - Opnd::Opnd(uint32 _id, Type * t, Constraint c) + Opnd(uint32 _id, Type * t, Constraint c) :id(_id), firstId(_id), type(t), memOpndKind(MemOpndKind_Null), baseReg(RegName_Null) { constraints[ConstraintKind_Initial]=constraints[ConstraintKind_Calculated]=c; } @@ -709,6 +709,8 @@ typedef uint32 iterator; inline Opnds(const Inst * inst, uint32 r) { + rolesToCheck = 0; + roles = NULL; opnds = inst->getOpnds(); if (r & Inst::OpndRole_InstLevel) { @@ -728,7 +730,7 @@ roles = inst->getOpndRoles(); rolesToCheck = r; startIndex = next(startIndex - 1); - }else roles = NULL; + } }else{ instEndIndex = inst->opndCount; endIndex = instEndIndex + (instEndIndex<<2); diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp Harmony/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp 2006-05-05 18:12:21.398132800 +0400 @@ -26,6 +26,7 @@ #include "Ia32CodeGenerator.h" #include "Ia32Printer.h" #include +#include #ifdef PLATFORM_POSIX #define _isnan isnan diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h Harmony/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h 2006-05-05 18:12:21.398132800 +0400 @@ -314,7 +314,7 @@ Opnd * simpleOp_I8(Mnemonic mn, Type * dstType, Opnd * src1, Opnd * src2); Opnd * simpleOp_I4(Mnemonic mn, Type * dstType, Opnd * src1, Opnd * src2); - Opnd * InstCodeSelector::fpOp(Mnemonic mn, Type * dstType, Opnd * src1, Opnd * src2); + Opnd * fpOp(Mnemonic mn, Type * dstType, Opnd * src1, Opnd * src2); Opnd * createResultOpnd(Type * dstType); diff -uNr Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32Printer.h Harmony/vm/jitrino/src/codegenerator/ia32/Ia32Printer.h --- Harmony.orig/vm/jitrino/src/codegenerator/ia32/Ia32Printer.h 2006-03-28 18:33:18.000000000 +0400 +++ Harmony/vm/jitrino/src/codegenerator/ia32/Ia32Printer.h 2006-05-05 18:12:21.418161600 +0400 @@ -182,7 +182,7 @@ static void printOpndRoles(::std::ostream& os, uint32 roles) { IRPrinter p; p.setStream(os); p.printOpndRoles(roles); } - void IRPrinter::printOpndName(const Opnd * opnd); + void printOpndName(const Opnd * opnd); static void printOpndName(::std::ostream& os, const Opnd * opnd) { IRPrinter p; p.setStream(os); p.printOpndName(opnd); } @@ -254,7 +254,7 @@ IRInstConstraintPrinter(const IRManager * irm=0, const char * _title=0) :IRPrinter(irm, _title){} - virtual void IRInstConstraintPrinter::printOpnd(const Inst * inst, uint32 opndIdx, bool isLiveBefore=false, bool isLiveAfter=false); + virtual void printOpnd(const Inst * inst, uint32 opndIdx, bool isLiveBefore=false, bool isLiveAfter=false); }; //======================================================================================== diff -uNr Harmony.orig/vm/jitrino/src/optimizer/CSEHash.h Harmony/vm/jitrino/src/optimizer/CSEHash.h --- Harmony.orig/vm/jitrino/src/optimizer/CSEHash.h 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/CSEHash.h 2006-05-05 18:12:21.458219200 +0400 @@ -155,6 +155,7 @@ public: CSEHashTable(MemoryManager& mm) : numCSE(0), hashTable(mm, CSE_HASH_TABLE_SIZE) {} + virtual ~CSEHashTable() {} void kill() {hashTable.removeAll();} virtual Inst* lookupKey(CSEHashKey* key) { return lookupKeyBase(key); } @@ -210,6 +211,7 @@ class ScopedCSEHashTable : public CSEHashTable { public: + virtual ~ScopedCSEHashTable() {} ScopedCSEHashTable(MemoryManager& mm, ScopedCSEHashTable* outerScope) : CSEHashTable(mm), _outerScope(outerScope) { } diff -uNr Harmony.orig/vm/jitrino/src/optimizer/FlowGraph.h Harmony/vm/jitrino/src/optimizer/FlowGraph.h --- Harmony.orig/vm/jitrino/src/optimizer/FlowGraph.h 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/FlowGraph.h 2006-05-05 18:12:21.478248000 +0400 @@ -166,6 +166,7 @@ class ProfileAnnotator : public ControlFlowNode::Annotator { public: + virtual ~ProfileAnnotator() {} void annotateNode(::std::ostream& os, ControlFlowNode* _node) { CFGNode* node = (CFGNode*) _node; os << "[Freq=" << ::std::setprecision(4) << node->getFreq(); diff -uNr Harmony.orig/vm/jitrino/src/optimizer/IRBuilder.cpp Harmony/vm/jitrino/src/optimizer/IRBuilder.cpp --- Harmony.orig/vm/jitrino/src/optimizer/IRBuilder.cpp 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/IRBuilder.cpp 2006-05-05 18:12:21.488262400 +0400 @@ -1075,13 +1075,13 @@ tauTypesChecked = propagateCopy(tauTypesChecked); } if (irBuilderFlags.doSimplify) { - Opnd *dst = dst = simplifier.simplifyTauVirtualCall(methodDesc, - returnType, - tauNullCheckedFirstArg, - tauTypesChecked, - numArgs, - args, - inlineInfoBuilder); + Opnd *dst = simplifier.simplifyTauVirtualCall(methodDesc, + returnType, + tauNullCheckedFirstArg, + tauTypesChecked, + numArgs, + args, + inlineInfoBuilder); if (dst) return dst; } diff -uNr Harmony.orig/vm/jitrino/src/optimizer/Inst.h Harmony/vm/jitrino/src/optimizer/Inst.h --- Harmony.orig/vm/jitrino/src/optimizer/Inst.h 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/Inst.h 2006-05-05 18:12:21.488262400 +0400 @@ -82,6 +82,7 @@ // class InstFormatVisitor { public: + virtual ~InstFormatVisitor() {} virtual void accept(Inst*) = 0; virtual void accept(BranchInst*) = 0; virtual void accept(CallInst*) = 0; @@ -112,6 +113,7 @@ class Inst : private Dlink { public: + virtual ~Inst() {} // modified Dlink methods void unlink() { Dlink::unlink(); @@ -1563,6 +1565,7 @@ class InstOptimizer { public: + virtual ~InstOptimizer() {} // returns 0 or an optimized version of inst; virtual Inst* optimizeInst(Inst* inst) { diff -uNr Harmony.orig/vm/jitrino/src/optimizer/Opnd.h Harmony/vm/jitrino/src/optimizer/Opnd.h --- Harmony.orig/vm/jitrino/src/optimizer/Opnd.h 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/Opnd.h 2006-05-05 18:12:21.518305600 +0400 @@ -48,6 +48,7 @@ class OpndBase { // rename to Opnd public: + virtual ~OpndBase() {} uint32 getId() const {return id;} Type* getType() const {return type;} void setType(Type *t) {type = t;} @@ -104,6 +105,7 @@ class Opnd : public OpndBase { public: + virtual ~Opnd() {} void setIsGlobal(bool val) {isGlobalFlag = val;} bool isGlobal() const {return isGlobalFlag;} // @@ -126,6 +128,7 @@ class SsaOpnd : public Opnd { public: + virtual ~SsaOpnd() {} virtual bool isSsaOpnd() const {return true;} protected: friend class OpndManager; @@ -136,6 +139,7 @@ class SsaTmpOpnd : public SsaOpnd { public: + virtual ~SsaTmpOpnd() {} virtual bool isSsaTmpOpnd() const {return true;} private: friend class OpndManager; @@ -144,6 +148,7 @@ class PiOpnd : public SsaOpnd { public: + virtual ~PiOpnd() {} virtual bool isSsaTmpOpnd() const {return false;}; virtual bool isPiOpnd() const {return true;}; const Opnd *getOrg() const { return orgOpnd; }; @@ -162,6 +167,7 @@ class VarOpnd : public Opnd { public: + virtual ~VarOpnd() {} virtual bool isVarOpnd() const {return true;} bool isAddrTaken() const {return isAddrTakenFlag;} void setAddrTaken() {isAddrTakenFlag = true;} @@ -216,6 +222,7 @@ // class SsaVarOpnd : public SsaOpnd { public: + virtual ~SsaVarOpnd() {} virtual bool isSsaVarOpnd() const {return true;} VarOpnd* getVar() {return var;} // @@ -305,6 +312,7 @@ public: OpndRenameTable(MemoryManager& mm, uint32 size = 16, bool renameSSA = false): HashTable(mm,size) {renameSsaOpnd = renameSSA;} + virtual ~OpndRenameTable() {} Opnd *getMapping(Opnd *from) {return lookup(from); } void setMapping(Opnd *from, Opnd *to) { diff -uNr Harmony.orig/vm/jitrino/src/optimizer/abcd/abcdbounds.h Harmony/vm/jitrino/src/optimizer/abcd/abcdbounds.h --- Harmony.orig/vm/jitrino/src/optimizer/abcd/abcdbounds.h 2006-03-28 18:33:24.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/abcd/abcdbounds.h 2006-05-05 18:12:21.428176000 +0400 @@ -537,6 +537,7 @@ return (nega == a); }; +#if 0 template inline bool mul_overflowed(inttype prod, inttype a, inttype b) { // let's just be really conservative. @@ -552,6 +553,7 @@ else return false; }; +#endif } //namespace Jitrino diff -uNr Harmony.orig/vm/jitrino/src/optimizer/abcd/abcdsolver.h Harmony/vm/jitrino/src/optimizer/abcd/abcdsolver.h --- Harmony.orig/vm/jitrino/src/optimizer/abcd/abcdsolver.h 2006-03-28 18:33:24.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/abcd/abcdsolver.h 2006-05-05 18:12:21.428176000 +0400 @@ -191,12 +191,12 @@ // by considering either var1 or var2, depending on derefVar1 // if (!checkVar1), var2 should have been fully dereferenced // and checked first.; sets noneApply=true if none apply - ProofLattice AbcdSolver::proveForSpecialCases(const VarBound &var1, - const VarBound &var2, - ConstBound c, - bool checkVar1, - bool &noneApply, - AbcdReasons *why); // if non-null and proven true, reasons why + ProofLattice proveForSpecialCases(const VarBound &var1, + const VarBound &var2, + ConstBound c, + bool checkVar1, + bool &noneApply, + AbcdReasons *why); // if non-null and proven true, reasons why void tryToEliminate(Inst *); // solve for an instruction; void tryToFoldBranch(Inst *); void tryToFoldCompare(Inst *); diff -uNr Harmony.orig/vm/jitrino/src/optimizer/aliasanalyzer.h Harmony/vm/jitrino/src/optimizer/aliasanalyzer.h --- Harmony.orig/vm/jitrino/src/optimizer/aliasanalyzer.h 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/aliasanalyzer.h 2006-05-05 18:12:21.438190400 +0400 @@ -34,6 +34,7 @@ class AliasAnalyzer { public: + virtual ~AliasAnalyzer() {} /** * Return false if op1 and op2 cannot point to same location in memory. * Both op1 and op2 must be reference or pointer typed. The method will @@ -52,6 +53,7 @@ class TypeAliasAnalyzer : public AliasAnalyzer { public: + virtual ~TypeAliasAnalyzer() {} bool mayAlias(Opnd* op1, Opnd* op2); bool mayAlias(Type* t1, Type* t2); diff -uNr Harmony.orig/vm/jitrino/src/optimizer/constantfolder.cpp Harmony/vm/jitrino/src/optimizer/constantfolder.cpp --- Harmony.orig/vm/jitrino/src/optimizer/constantfolder.cpp 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/constantfolder.cpp 2006-05-05 18:12:21.458219200 +0400 @@ -26,6 +26,7 @@ #define CAST(a, b) ((a)b) #include +#include /* * The constant folding optimization is described in [S.Muchnick. Advanced Compiler @@ -37,7 +38,7 @@ using namespace std; -inline int isfinite(double s) { +inline int isFinite(double s) { return finite(s); } @@ -51,7 +52,7 @@ // isnan(double s) is declared in float.h #else -inline int isfinite(double s) { +inline int isFinite(double s) { return _finite(s); } @@ -92,7 +93,7 @@ inline tointtype float2int(fromfloattype f) { if (isnan(f)) return (tointtype) 0; - if (isfinite(f) && + if (isFinite(f) && (((fromfloattype(minint(0))) < f) && (f < fromfloattype(maxint(0))))) return (tointtype) f; // both C++ and Java truncate @@ -104,7 +105,7 @@ inline tointtype float2uint(fromfloattype s) { if (isnan(s) || (s < 0.0)) return (tointtype) 0; - if (isfinite(s) && (s < maxuintasfloat(0))) + if (isFinite(s) && (s < maxuintasfloat(0))) return (tointtype) s; return maxuint(0); } diff -uNr Harmony.orig/vm/jitrino/src/optimizer/dataflow.h Harmony/vm/jitrino/src/optimizer/dataflow.h --- Harmony.orig/vm/jitrino/src/optimizer/dataflow.h 2006-03-28 18:33:22.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/dataflow.h 2006-05-05 18:12:21.478248000 +0400 @@ -38,6 +38,7 @@ template class DataflowTF { public: + virtual ~DataflowTF() {} // returns true if changed virtual bool apply(const DataflowValue &in, DataflowValue &out) = 0; }; @@ -45,6 +46,7 @@ template class DataflowInstance { public: + virtual ~DataflowInstance() {} typedef DataflowValue ValueType; virtual DataflowTF *getNodeBehavior(CFGNode *node) = 0; virtual DataflowValue getEntryValue() = 0; diff -uNr Harmony.orig/vm/jitrino/src/optimizer/multiplybyconstant.cpp Harmony/vm/jitrino/src/optimizer/multiplybyconstant.cpp --- Harmony.orig/vm/jitrino/src/optimizer/multiplybyconstant.cpp 2006-03-28 18:33:24.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/multiplybyconstant.cpp 2006-05-05 18:12:21.508291200 +0400 @@ -52,6 +52,7 @@ #include "CompilationContext.h" #include +#include #include "Stl.h" #include "simplifier.h" @@ -63,14 +64,8 @@ namespace Jitrino { #ifdef PLATFORM_POSIX -inline bool isfinite(double s) { - return (finite(s) != 0); -} // isnan(double s) is declared in float.h #else -inline bool isfinite(double s) { - return (_finite(s) != 0); -} inline bool isnan(double s) { return (_isnan(s) != 0); } diff -uNr Harmony.orig/vm/jitrino/src/optimizer/reassociate.h Harmony/vm/jitrino/src/optimizer/reassociate.h --- Harmony.orig/vm/jitrino/src/optimizer/reassociate.h 2006-03-28 18:33:24.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/reassociate.h 2006-05-05 18:12:21.538334400 +0400 @@ -61,6 +61,8 @@ DEFINE_OPTPASS(LateDepthReassociationPass) +class Simplifier; + // // Try to re-associate expressions to either // - reduce expression height diff -uNr Harmony.orig/vm/jitrino/src/optimizer/simplifier.cpp Harmony/vm/jitrino/src/optimizer/simplifier.cpp --- Harmony.orig/vm/jitrino/src/optimizer/simplifier.cpp 2006-03-28 18:33:24.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/simplifier.cpp 2006-05-05 18:12:21.548348800 +0400 @@ -38,6 +38,7 @@ #include "CompilationContext.h" #include +#include namespace Jitrino { /* @@ -48,12 +49,12 @@ */ #ifdef PLATFORM_POSIX -inline bool isfinite(double s) { +inline bool isFinite(double s) { return (finite(s) != 0); } // isnan(double s) is declared in float.h #else -inline bool isfinite(double s) { +inline bool isFinite(double s) { return (_finite(s) != 0); } inline bool isnan(double s) { @@ -3050,7 +3051,7 @@ case Type::Single: // single { float s = value.s; - if (!isfinite((double)s)) { + if (!isFinite((double)s)) { alwaysThrows = true; return genTauUnsafe()->getDst(); } @@ -3059,7 +3060,7 @@ case Type::Double: { double d = value.d; - if (!isfinite(d)) { + if (!isFinite(d)) { alwaysThrows = true; return genTauUnsafe()->getDst(); } diff -uNr Harmony.orig/vm/jitrino/src/optimizer/simplifier.h Harmony/vm/jitrino/src/optimizer/simplifier.h --- Harmony.orig/vm/jitrino/src/optimizer/simplifier.h 2006-03-28 18:33:24.000000000 +0400 +++ Harmony/vm/jitrino/src/optimizer/simplifier.h 2006-05-05 18:12:21.568377600 +0400 @@ -1079,17 +1079,17 @@ // re-association machinery friend class Reassociate; Opnd* - Simplifier::simplifyAddViaReassociation2(Type* type, Opnd* src1, Opnd* src2); + simplifyAddViaReassociation2(Type* type, Opnd* src1, Opnd* src2); Opnd* - Simplifier::simplifyNegViaReassociation2(Type* type, Opnd* src1); + simplifyNegViaReassociation2(Type* type, Opnd* src1); Opnd* - Simplifier::simplifySubViaReassociation2(Type* type, Opnd* src1, Opnd *src2); + simplifySubViaReassociation2(Type* type, Opnd* src1, Opnd *src2); Opnd* - Simplifier::simplifyMulViaReassociation2(Type* type, Opnd* src1, Opnd* src2); + simplifyMulViaReassociation2(Type* type, Opnd* src1, Opnd* src2); Opnd* - Simplifier::simplifyAddOffsetViaReassociation(Opnd* uncompBase, Opnd *offset); + simplifyAddOffsetViaReassociation(Opnd* uncompBase, Opnd *offset); Opnd* - Simplifier::simplifyAddOffsetPlusHeapbaseViaReassociation(Opnd *compBase, + simplifyAddOffsetPlusHeapbaseViaReassociation(Opnd *compBase, Opnd *offsetPlusHeapbase); Reassociate *theReassociate; }; diff -uNr Harmony.orig/vm/jitrino/src/shared/BitSet.h Harmony/vm/jitrino/src/shared/BitSet.h --- Harmony.orig/vm/jitrino/src/shared/BitSet.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/BitSet.h 2006-05-05 18:12:21.568377600 +0400 @@ -187,6 +187,7 @@ class BitSet::Visitor { public: + virtual ~Visitor() {} virtual void visit(uint32 elem) = 0; }; @@ -194,7 +195,8 @@ class BitSet::Printer : public BitSet::Visitor { public: Printer(::std::ostream & _os) : os(_os) {} - void visit(uint32 i) { os << " " << (int) i;} + virtual ~Printer() {} + void visit(uint32 i) { os << " " << (int) i;} private: ::std::ostream & os; }; diff -uNr Harmony.orig/vm/jitrino/src/shared/Category.h Harmony/vm/jitrino/src/shared/Category.h --- Harmony.orig/vm/jitrino/src/shared/Category.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/Category.h 2006-05-05 18:12:21.598420800 +0400 @@ -68,6 +68,7 @@ const LogLevel LogDefaultThreshold = LogNone; +class Category; /** * A stream-like class for logging output. @@ -77,26 +78,8 @@ friend class Category; public: template - CategoryStream& operator<<(const T& value) { - // Should be compile-time NOP if first test fails. - if(level >= LogStaticThreshold) { - if(cat->isLogDynamicEnabled(level)) { - cat->out() << value; - } - } - return *this; - } - - CategoryStream& operator << (::std::ostream& (*f)(::std::ostream&)) - { - // Should be compile-time NOP if first test fails. - if(level >= LogStaticThreshold) { - if(cat->isLogDynamicEnabled(level)) { - f(cat->out()); - } - } - return *this; - } + inline CategoryStream& operator<<(const T& value); + inline CategoryStream& operator << (::std::ostream& (*f)(::std::ostream&)); private: CategoryStream() {} @@ -212,6 +195,32 @@ }; + +template +template +CategoryStream& +CategoryStream::operator<<(const T& value) { + // Should be compile-time NOP if first test fails. + if(level >= LogStaticThreshold) { + if(cat->isLogDynamicEnabled(level)) { + cat->out() << value; + } + } + return *this; +} + +template +CategoryStream& +CategoryStream::operator << (::std::ostream& (*f)(::std::ostream&)) { + // Should be compile-time NOP if first test fails. + if(level >= LogStaticThreshold) { + if(cat->isLogDynamicEnabled(level)) { + f(cat->out()); + } + } + return *this; +} + } //namespace Jitrino #endif // _CATEGORY_H_ diff -uNr Harmony.orig/vm/jitrino/src/shared/ControlFlowGraph.h Harmony/vm/jitrino/src/shared/ControlFlowGraph.h --- Harmony.orig/vm/jitrino/src/shared/ControlFlowGraph.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/ControlFlowGraph.h 2006-05-05 18:12:21.598420800 +0400 @@ -166,6 +166,7 @@ class Annotator { public: + virtual ~Annotator() {} virtual void annotateNode(::std::ostream& os, Node* node) = 0; }; diff -uNr Harmony.orig/vm/jitrino/src/shared/Counter.h Harmony/vm/jitrino/src/shared/Counter.h --- Harmony.orig/vm/jitrino/src/shared/Counter.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/Counter.h 2006-05-05 18:12:21.608435200 +0400 @@ -26,7 +26,17 @@ namespace Jitrino { -class CountWriter; +class CountWriter +{ +public: + + virtual ~CountWriter () {} + + virtual void write (const char* key, const char* value) = 0; + virtual void write (const char* key, int value) = 0; + virtual void write (const char* key, unsigned int value) = 0; + virtual void write (const char* key, double value) = 0; +}; class CounterBase @@ -65,18 +75,6 @@ }; -class CountWriter -{ -public: - - virtual ~CountWriter () {} - - virtual void write (const char* key, const char* value) = 0; - virtual void write (const char* key, int value) = 0; - virtual void write (const char* key, unsigned int value) = 0; - virtual void write (const char* key, double value) = 0; -}; - } //namespace Jitrino diff -uNr Harmony.orig/vm/jitrino/src/shared/Graph.h Harmony/vm/jitrino/src/shared/Graph.h --- Harmony.orig/vm/jitrino/src/shared/Graph.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/Graph.h 2006-05-05 18:12:21.608435200 +0400 @@ -49,7 +49,8 @@ class Edge { public: - Edge() : predNode(NULL), succNode(NULL), nextPredEdge(NULL), nextSuccEdge(NULL) {} + Edge() : predNode(NULL), succNode(NULL), nextPredEdge(NULL), nextSuccEdge(NULL) {} + virtual ~Edge() {} Node* getPredNode() {return predNode; } Node* getSuccNode() {return succNode; } Edge* getNextPredEdge() {return nextPredEdge; } @@ -83,7 +84,8 @@ class Node : public Dlink { public: - Node(): traversalNum(0), dfnum(INVALID_DFN), succs(NULL), preds(NULL) {} + Node(): traversalNum(0), dfnum(INVALID_DFN), succs(NULL), preds(NULL) {} + virtual ~Node() {} // // true if there is any edge to a successor node. bool hasEdge(Node* succNode); diff -uNr Harmony.orig/vm/jitrino/src/shared/HashTable.h Harmony/vm/jitrino/src/shared/HashTable.h --- Harmony.orig/vm/jitrino/src/shared/HashTable.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/HashTable.h 2006-05-05 18:12:21.628464000 +0400 @@ -60,6 +60,7 @@ : memManager(mm), table(t), tableSize(size) { removeAll(); } + virtual ~HashTableImpl() {} void* lookup(void* key) const { HashTableLink* entry = lookupEntry(key); if (entry == NULL) @@ -198,6 +199,7 @@ class KeyLinkHashTable : HashTableImpl { public: KeyLinkHashTable(MemoryManager& mm,uint32 size) : HashTableImpl(mm,size) {} + virtual ~KeyLinkHashTable() {} void* lookup(KEY* key) const {return HashTableImpl::lookup(key);} void insert(KEY* key,void* value) {HashTableImpl::insert(key,value);} void remove(KEY* key) {HashTableImpl::remove(key);} @@ -244,7 +246,7 @@ if (freeList == NULL) { // get last guy at the end of mru list link = (Link*)mruList.getPrev()->getElem(); - remove(&link->key); + FixedKeyLinkHashTable::remove(&link->key); } assert(freeList != NULL); link = freeList; @@ -301,6 +303,7 @@ public: DoubleKeyHashTable(MemoryManager& mm,uint32 size) : KeyLinkHashTable(mm,size) {} + virtual ~DoubleKeyHashTable() {} void* lookup(void* key1,void* key2) const { DoublePtrKey key(key1,key2); return KeyLinkHashTable::lookup(&key); diff -uNr Harmony.orig/vm/jitrino/src/shared/InlineInfo.h Harmony/vm/jitrino/src/shared/InlineInfo.h --- Harmony.orig/vm/jitrino/src/shared/InlineInfo.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/InlineInfo.h 2006-05-05 18:12:21.648492800 +0400 @@ -129,6 +129,7 @@ InlineInfoBuilder(InlineInfoBuilder* parentBuilder) : parent(parentBuilder) {} + virtual ~InlineInfoBuilder() {} void setParentBuilder(InlineInfoBuilder* builder) { parent = builder; } diff -uNr Harmony.orig/vm/jitrino/src/shared/Stl.h Harmony/vm/jitrino/src/shared/Stl.h --- Harmony.orig/vm/jitrino/src/shared/Stl.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/Stl.h 2006-05-05 18:12:21.648492800 +0400 @@ -41,7 +41,11 @@ #include #include +#if (defined __GNUC__) && ((__GNUC__ >= 3 && __GNUC_MINOR__ > 3) || __GNUC__ > 3) +#include +#else #include +#endif #else @@ -218,7 +222,7 @@ StlVectorSet(Allocator const& a) : Vector(a) {} StlVectorSet(Allocator const& a, size_type n, const T& x = T()) : Vector(n, x, a) {} StlVectorSet(const Vector & a) : Vector(a) { - sort(begin(), end()); + sort(StlVectorSet::begin(), StlVectorSet::end()); } StlVectorSet& operator=(const Vector & a) { Vector::operator=(a); return *this; }; StlVectorSet& operator=(const StlVectorSet & a) { @@ -242,8 +246,8 @@ } } void insert(iterator i1, iterator i2) { - Vector::insert(end(), i1, i2); - ::std::sort(begin(), end()); + Vector::insert(StlVectorSet::end(), i1, i2); + ::std::sort(StlVectorSet::begin(), StlVectorSet::end()); } size_type erase(const T& x) { ::std::pair found= equal_range(x); @@ -264,31 +268,31 @@ else return 0; } const_iterator lower_bound(const T& x) const { - return ::std::lower_bound(begin(), end(), x); + return ::std::lower_bound(StlVectorSet::begin(), StlVectorSet::end(), x); } iterator lower_bound(const T& x) { - return ::std::lower_bound(begin(), end(), x); + return ::std::lower_bound(StlVectorSet::begin(), StlVectorSet::end(), x); } const_iterator upper_bound(const T& x) const { - return ::std::upper_bound(begin(), end(), x); + return ::std::upper_bound(StlVectorSet::begin(), StlVectorSet::end(), x); } iterator upper_bound(const T& x) { - return ::std::upper_bound(begin(), end(), x); + return ::std::upper_bound(StlVectorSet::begin(), StlVectorSet::end(), x); } ::std::pair equal_range(const T& x) const { - return ::std::equal_range(begin(), end(), x); + return ::std::equal_range(StlVectorSet::begin(), StlVectorSet::end(), x); } ::std::pair equal_range(const T& x) { - return ::std::equal_range(begin(), end(), x); + return ::std::equal_range(StlVectorSet::begin(), StlVectorSet::end(), x); } const_iterator find(const T& x) const { ::std::pair found= equal_range(x); - if (found.first == found.second) return end(); + if (found.first == found.second) return StlVectorSet::end(); else return found.first; } iterator find(const T& x) { ::std::pair found= equal_range(x); - if (found.first == found.second) return end(); + if (found.first == found.second) return StlVectorSet::end(); else return found.first; } bool has(const T& x) const { @@ -312,8 +316,8 @@ StlBoolVector(Allocator const& a, size_type n, bool x = false) : Vector(n, x, a) {} // Automatically resize as needed. - bool getBit(size_type n) { if(n < size()) return at(n); else return false; } - bool setBit(size_type n, bool value=true) { if(n >= size()) resize(n+1); bool old = at(n); at(n) = value; return old; } + bool getBit(size_type n) { if(n < StlBoolVector::size()) return at(n); else return false; } + bool setBit(size_type n, bool value=true) { if(n >= StlBoolVector::size()) resize(n+1); bool old = at(n); at(n) = value; return old; } }; typedef StlBoolVector<> StlBitVector; @@ -339,7 +343,7 @@ StlSet(Allocator const& a) : Set(Traits(), a) {} StlSet(Traits const& t, Allocator const& a) : Set(t, a) {} - bool has(const KeyT& k) const { return (find(k) != end()); }; + bool has(const KeyT& k) const { return (find(k) != StlSet::end()); }; }; /** @@ -353,7 +357,7 @@ StlMultiSet(Allocator const& a) : MultiSet(Traits(), a) {} StlMultiSet(Traits const& t, Allocator const& a) : MultiSet(t, a) {} - bool has(const KeyT& k) const { return (find(k) != end()); }; + bool has(const KeyT& k) const { return (find(k) != StlMultiSet::end()); }; }; /** @@ -367,7 +371,7 @@ StlMap(Allocator const& a) : Map(Traits(), a) {} StlMap(Traits const& t, Allocator const& a) : Map(t, a) {} - bool has(const KeyT& k) const { return (find(k) != end()); }; + bool has(const KeyT& k) const { return (find(k) != StlMap::end()); }; }; /** @@ -381,7 +385,7 @@ StlMultiMap(Allocator const& a) : MultiMap(Traits(), a) {} StlMultiMap(Traits const& t, Allocator const& a) : MultiMap(t, a) {} - bool has(const KeyT& k) const { return (find(k) != end()); }; + bool has(const KeyT& k) const { return (find(k) != StlMultiMap::end()); }; }; /** @@ -424,7 +428,7 @@ StlHashSet(Allocator const& a) : HashSet(HashCompareFun(), a) {} StlHashSet(Allocator const& a, size_type n) : HashSet(HashCompareFun(), a) {} - bool has(const T& k) const { return (find(k) != end()); }; + bool has(const T& k) const { return (find(k) != StlHashSet::end()); }; }; #else template, class Allocator = StlMMAllocator > @@ -455,7 +459,7 @@ StlHashMultiSet(Allocator const& a) : HashMultiSet(HashCompareFun(), a) {} StlHashMultiSet(Allocator const& a, size_type n) : HashMultiSet(HashCompareFun(), a) {} - bool has(const T& k) const { return (find(k) != end()); }; + bool has(const T& k) const { return (find(k) != StlHashMultiSet::end()); }; }; #else template, class Allocator = StlMMAllocator > @@ -486,7 +490,7 @@ StlHashMap(Allocator const& a) : HashMap(HashCompareFun(), a) {} StlHashMap(Allocator const& a, size_type n) : HashMap(HashCompareFun(), a) {} - bool has(const KeyT& k) const { return (find(k) != end()); }; + bool has(const KeyT& k) const { return (find(k) != StlHashMap::end()); }; }; #else @@ -518,7 +522,7 @@ StlHashMultiMap(Allocator const& a) : HashMultiMap(HashCompareFun(), a) {} StlHashMultiMap(Allocator const& a, size_type n) : HashMultiMap(HashCompareFun(), a) {} - bool has(const KeyT& k) const { return (find(k) != end()); }; + bool has(const KeyT& k) const { return (find(k) != StlHashMultiMap::end()); }; }; #else template, class Allocator = StlMMAllocator > diff -uNr Harmony.orig/vm/jitrino/src/shared/Tree.h Harmony/vm/jitrino/src/shared/Tree.h --- Harmony.orig/vm/jitrino/src/shared/Tree.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/Tree.h 2006-05-05 18:12:21.648492800 +0400 @@ -40,6 +40,8 @@ child = chd; } + virtual ~TreeNode() {} + virtual void print(::std::ostream& os) { os << "T"; } virtual void printTag(::std::ostream& os) { print(os); } @@ -148,7 +150,7 @@ Tree(): root(NULL) {} TreeNode* getRoot() {return root;} - virtual void Tree::printDotFile(MethodDesc& mh, char *suffix) { + virtual void printDotFile(MethodDesc& mh, char *suffix) { if (root == NULL) return; PrintDotFile::printDotFile(mh,suffix); } diff -uNr Harmony.orig/vm/jitrino/src/shared/Type.h Harmony/vm/jitrino/src/shared/Type.h --- Harmony.orig/vm/jitrino/src/shared/Type.h 2006-03-28 18:33:36.000000000 +0400 +++ Harmony/vm/jitrino/src/shared/Type.h 2006-05-05 18:12:21.658507200 +0400 @@ -147,6 +147,7 @@ InavlidTag = NumTypeTags }; Type(Tag t) : tag(t), id(++nextTypeId) {} + virtual ~Type() {} const Tag tag; bool isBuiltinValue() {return isBuiltinValue(tag); } bool isNumeric() {return isNumeric(tag); } @@ -369,6 +370,7 @@ PtrType(Type* t,bool isManagedPtr,ValueName array=NULL, ValueName index=NULL) : Type(isManagedPtr ? ManagedPtr : UnmanagedPtr), pointedToType(t), array(array), index(index) {} PtrType* asPtrType() { return this; } + virtual ~PtrType() {} Type* getPointedToType() {return pointedToType;} ValueName getArrayName() { return array; } ValueName getIndexName() { return index; } @@ -383,6 +385,7 @@ public: FunctionPtrType(bool isCompressed=false) : Type(isCompressed ? CompressedMethodPtr : MethodPtr) { } FunctionPtrType* asFunctionPtrType() { return this; } + virtual ~FunctionPtrType() {} virtual uint32 getNumParams() = 0; virtual Type* getParamType(uint32) = 0; virtual Type* getReturnType() = 0; @@ -393,6 +396,7 @@ public: MethodPtrType(MethodDesc* md, TypeManager& tm, bool isCompressed=false, ValueName obj=NULL) : FunctionPtrType(isCompressed), methodDesc(md), methodSig(md->getMethodSig()), typeManager(tm), object(obj) {} + virtual ~MethodPtrType() {} MethodPtrType* asMethodPtrType() { return this; } uint32 getNumParams() { return methodSig->getNumParams(); } Type* getParamType(uint32 i); @@ -412,6 +416,7 @@ public: VTablePtrType(Type* t, bool isCompressed=false) : Type(isCompressed? CompressedVTablePtr : VTablePtr), baseType(t) {} + virtual ~VTablePtrType() {} Type* getBaseType() {return baseType;} virtual void print(::std::ostream& os); private: @@ -429,6 +434,7 @@ public: NamedType(Tag t, void* td, TypeManager& tm) : Type(t), vmTypeHandle(td), typeManager(tm) {} + virtual ~NamedType() {} NamedType* asNamedType() { return this; } bool needsInitialization(); @@ -452,11 +458,13 @@ class ValueType : public Type { public: ValueType(Tag t) : Type(t) {} + virtual ~ValueType() {} }; class UserValueType : public NamedType { public: UserValueType(void* td,TypeManager& tm) : NamedType(Value,td,tm) {} + virtual ~UserValueType() {} virtual const char* getName(); virtual const char* getNameQualifier(); // @@ -626,6 +634,7 @@ class TypeManager { public: TypeManager(MemoryManager& mm); + virtual ~TypeManager() {} void init(CompilationInterface &compInt); void init(); MemoryManager& getMemManager() {return memManager;} diff -uNr Harmony.orig/vm/jitrino/src/translator/ByteCodeParser.h Harmony/vm/jitrino/src/translator/ByteCodeParser.h --- Harmony.orig/vm/jitrino/src/translator/ByteCodeParser.h 2006-03-28 18:36:46.000000000 +0400 +++ Harmony/vm/jitrino/src/translator/ByteCodeParser.h 2006-05-05 18:12:21.658507200 +0400 @@ -30,6 +30,7 @@ class ByteCodeParserCallback { public: + virtual ~ByteCodeParserCallback() {} // parses one byte code starting at given offset, // updates nextOffset to point at next byte code, // returns false if parsing should stop diff -uNr Harmony.orig/vm/jitrino/src/translator/ExceptionInfo.h Harmony/vm/jitrino/src/translator/ExceptionInfo.h --- Harmony.orig/vm/jitrino/src/translator/ExceptionInfo.h 2006-03-28 18:36:46.000000000 +0400 +++ Harmony/vm/jitrino/src/translator/ExceptionInfo.h 2006-05-05 18:12:21.658507200 +0400 @@ -29,6 +29,7 @@ class ExceptionInfo { public: + virtual ~ExceptionInfo() {} uint32 getId() {return id;} uint32 getBeginOffset(){return beginOffset;} uint32 getEndOffset() {return endOffset;} @@ -65,6 +66,7 @@ uint32 endOffset, ExceptionInfo* _tryBlock) : ExceptionInfo(id,beginOffset,endOffset), tryBlock(_tryBlock) {} + virtual ~Handler() {} uint32 getTryRegionId() {return tryBlock->getId();} ExceptionInfo* getTryBlock() {return tryBlock;} private: @@ -81,6 +83,7 @@ uint32 endOffset, CatchBlock* tryBlock, Type* excType); + virtual ~CatchHandler() {} Type* getExceptionType() {return exceptionType;} uint32 getExceptionOrder() {return order; } @@ -101,6 +104,7 @@ uint32 endOffset, uint32 exceptionIndex) : ExceptionInfo(id,beginOffset,endOffset), handlers(NULL), excTableIndex(exceptionIndex) {} + virtual ~CatchBlock() {} bool isCatchBlock() {return true;} uint32 getExcTableIndex() { return excTableIndex; } void addHandler(CatchHandler* handler) { diff -uNr Harmony.orig/vm/jitrino/src/translator/TranslatorIntfc.h Harmony/vm/jitrino/src/translator/TranslatorIntfc.h --- Harmony.orig/vm/jitrino/src/translator/TranslatorIntfc.h 2006-03-28 18:36:46.000000000 +0400 +++ Harmony/vm/jitrino/src/translator/TranslatorIntfc.h 2006-05-05 18:12:21.668521600 +0400 @@ -64,6 +64,8 @@ class TranslatorIntfc { public: + + virtual ~TranslatorIntfc() {} // all TranslatorIntfc::flags fields are initialized by readTranslatorCommandLineParams() static void readFlagsFromCommandLine(CompilationContext* cs, bool ia32Cg); diff -uNr Harmony.orig/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp Harmony/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp --- Harmony.orig/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp 2006-03-28 18:36:46.000000000 +0400 +++ Harmony/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp 2006-05-05 18:12:21.658507200 +0400 @@ -1123,6 +1123,9 @@ void JavaLabelPrepass::new_(uint32 constPoolIndex) { StateInfo::SlotInfo slot; + slot.slotFlags = 0; + slot.varNumber = 0; + slot.jsrLabelOffset = 0; StateInfo::setNonNull(&slot); StateInfo::setExactType(&slot); Type* nType = resolveTypeNew(constPoolIndex); @@ -1162,6 +1165,10 @@ void JavaLabelPrepass::anewarray(uint32 constPoolIndex) { popAndCheck(int32Type); StateInfo::SlotInfo slot; + slot.slotFlags = 0; + slot.varNumber = 0; + slot.jsrLabelOffset = 0; + StateInfo::setNonNull(&slot); StateInfo::setExactType(&slot); Type* type = resolveType(constPoolIndex); diff -uNr Harmony.orig/vm/jitrino/src/translator/java/JavaLabelPrepass.h Harmony/vm/jitrino/src/translator/java/JavaLabelPrepass.h --- Harmony.orig/vm/jitrino/src/translator/java/JavaLabelPrepass.h 2006-03-28 18:36:46.000000000 +0400 +++ Harmony/vm/jitrino/src/translator/java/JavaLabelPrepass.h 2006-05-05 18:12:21.668521600 +0400 @@ -128,6 +128,7 @@ uint16 slotFlags; SlotVar *vars; uint32 jsrLabelOffset; + SlotInfo() : type(0), varNumber(0), slotFlags(0), vars(0), jsrLabelOffset(0) {} }; // remove all slots containing returnAddress for RET instruction with jsrNexOffset == offset @@ -272,7 +273,7 @@ StateInfo* getStateInfo() { return &stateInfo; } StateTable* getStateTable() { return stateTable; } - static JavaLabelPrepass::JavaVarType JavaLabelPrepass::getJavaType(Type *type) { + static JavaVarType getJavaType(Type *type) { assert(type); switch(type->tag) { case Type::Boolean: case Type::Char: diff -uNr Harmony.orig/vm/jitrino/src/vm/VMInterface.h Harmony/vm/jitrino/src/vm/VMInterface.h --- Harmony.orig/vm/jitrino/src/vm/VMInterface.h 2006-03-28 18:36:48.000000000 +0400 +++ Harmony/vm/jitrino/src/vm/VMInterface.h 2006-05-05 18:12:21.678536000 +0400 @@ -56,6 +56,8 @@ class ExceptionCallback { public: + + virtual ~ExceptionCallback() {} virtual void catchBlock(uint32 tryOffset, uint32 tryLength, uint32 handlerOffset, @@ -81,6 +83,7 @@ // class MethodSignatureDesc { public: + virtual ~MethodSignatureDesc() {} virtual uint32 getNumParams() = 0; virtual Type** getParamTypes() = 0; virtual Type* getParamType(uint32 paramIndex) = 0; @@ -89,6 +92,7 @@ class TypeMemberDesc { public: + virtual ~TypeMemberDesc() {} virtual const char* getName() = 0; virtual const char* getSignatureString() = 0; virtual void printFullName(::std::ostream& os) = 0; @@ -100,6 +104,7 @@ class FieldDesc : public TypeMemberDesc { public: + virtual ~FieldDesc() {} // // this field is constant after it is initialized // can only be mutated by constructor (instance fields) or @@ -120,6 +125,7 @@ class MethodDesc : public TypeMemberDesc { public: + virtual ~MethodDesc() {} virtual bool isNative() = 0; virtual bool isSynchronized() = 0; virtual bool isNoInlining() = 0; @@ -206,6 +212,7 @@ class ClassHierarchyIterator { public: + virtual ~ClassHierarchyIterator() {} virtual bool isValid() = 0; // true if iterator is valid virtual bool hasNext() = 0; // true if iterator is not done virtual ObjectType* getNext() = 0; // return next class in iterator and advance iterator @@ -213,6 +220,7 @@ class ClassHierarchyMethodIterator { public: + virtual ~ClassHierarchyMethodIterator() {} virtual bool hasNext() = 0; // true if iterator is not done virtual MethodDesc* getNext() = 0; // return next class in iterator and advance iterator }; @@ -220,6 +228,7 @@ class CompilationInterface { public: + virtual ~CompilationInterface() {} virtual TypeManager& getTypeManager() = 0; // // returns the method to compile @@ -541,6 +550,7 @@ class DataInterface { public: + virtual ~DataInterface() {} // // returns true if instance fields that are references are compressed // @@ -554,6 +564,7 @@ class GCInterface { public: + virtual ~GCInterface() {} virtual void enumerateRootReference(void** reference) = 0; virtual void enumerateCompressedRootReference(uint32* reference) = 0; virtual void enumerateRootManagedReference(void** slotReference, int slotOffset) = 0; @@ -565,11 +576,13 @@ class BinaryRewritingInterface { public: + virtual ~BinaryRewritingInterface() {} virtual void rewriteCodeBlock(Byte* codeBlock, Byte* newCode, size_t length) = 0; }; class Compiler { public: + virtual ~Compiler() {} // // Return true if the method has been successfully compiled, // false - otherwise @@ -596,7 +609,7 @@ class ProfilingInterface { public: - virtual ~ProfilingInterface(){}; + virtual ~ProfilingInterface() {} virtual MethodProfile* getMethodProfile(MemoryManager& mm, ProfileType type, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const = 0; virtual bool hasMethodProfile(ProfileType type, MethodDesc& md, JITProfilingRole role=JITProfilingRole_USE) const = 0; diff -uNr Harmony.orig/vm/jitrino/src/vm/drl/DrlVMInterface.h Harmony/vm/jitrino/src/vm/drl/DrlVMInterface.h --- Harmony.orig/vm/jitrino/src/vm/drl/DrlVMInterface.h 2006-03-28 18:36:52.000000000 +0400 +++ Harmony/vm/jitrino/src/vm/drl/DrlVMInterface.h 2006-05-05 18:12:21.668521600 +0400 @@ -148,6 +148,7 @@ case VM_DATA_TYPE_F4: return getSingleType(); case VM_DATA_TYPE_BOOLEAN: return getBooleanType(); case VM_DATA_TYPE_CHAR: return getCharType(); + default: assert(0); } return NULL; } diff -uNr Harmony.orig/vm/vmcore/src/class_support/Class_File_Loader.cpp Harmony/vm/vmcore/src/class_support/Class_File_Loader.cpp --- Harmony.orig/vm/vmcore/src/class_support/Class_File_Loader.cpp 2006-03-28 18:49:58.000000000 +0400 +++ Harmony/vm/vmcore/src/class_support/Class_File_Loader.cpp 2006-05-05 18:12:21.678536000 +0400 @@ -530,14 +530,19 @@ bool Handler::parse(Const_Pool* cp, unsigned cp_size, unsigned code_length, ByteReader &cfs) { - if(!cfs.parse_u2_be((uint16*)&_start_pc)) + uint16 start = 0; + if(!cfs.parse_u2_be(&start)) return false; + _start_pc = (unsigned) start; + if (_start_pc >= code_length) return false; - if (!cfs.parse_u2_be((uint16 *)&_end_pc)) + uint16 end; + if (!cfs.parse_u2_be(&end)) return false; + _end_pc = (unsigned) end; if (_end_pc > code_length) return false; @@ -545,8 +550,10 @@ if (_start_pc >= _end_pc) return false; - if (!cfs.parse_u2_be((uint16 *)&_handler_pc)) + uint16 handler; + if (!cfs.parse_u2_be(&handler)) return false; + _handler_pc = (unsigned) handler; if (_handler_pc >= code_length) return false;