You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by mc...@apache.org on 2008/05/22 15:34:09 UTC
svn commit: r659108 [15/19] - in /harmony/enhanced/drlvm/trunk/vm: em/src/
gc_gen/src/common/ gc_gen/src/mark_compact/ gc_gen/src/mark_sweep/
gc_gen/src/semi_space/ gc_gen/src/trace_forward/ include/open/
interpreter/src/ jitrino/src/codegenerator/ jit...
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryAttribute.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryAttribute.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryAttribute.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryAttribute.h Thu May 22 06:33:38 2008
@@ -138,10 +138,10 @@
// This might be useful if tags become non sequential, e.g., bit positions
// so that we can encode multiple tag usage for managed pointers in CLI.
//
- static uint32 getNumTagIds() {return NumTags;}
- static uint32 getTagId(Tag tag) {return tag;}
- uint32 getTagId() const {return getTagId(tag);}
- static Tag mapIdToTag(uint32 _id) {return (Tag)_id;}
+ static U_32 getNumTagIds() {return NumTags;}
+ static U_32 getTagId(Tag tag) {return tag;}
+ U_32 getTagId() const {return getTagId(tag);}
+ static Tag mapIdToTag(U_32 _id) {return (Tag)_id;}
//
// Checks if memory context is exact
//
@@ -184,7 +184,7 @@
//
// Get various ids
//
- uint32 getStackOffset() const {
+ U_32 getStackOffset() const {
assert(getIdKind() == StackId);
return id.stackOffset;
}
@@ -196,7 +196,7 @@
assert(getIdKind() == MethodId);
return id.methodDesc;
}
- uint32 getProfileCounterId() const {
+ U_32 getProfileCounterId() const {
assert(getIdKind() == CounterId);
return id.counterId;
}
@@ -222,7 +222,7 @@
bool maybeTypeAliased;
};
private:
- Context(Tag t, uint32 _size = 0)
+ Context(Tag t, U_32 _size = 0)
: tag(t), size((uint8)_size) {
id.all = UnknownMemoryContextId;
assert(_size <= 0xff);
@@ -240,17 +240,17 @@
return info[tag].idKind;
}
bool hasUnknownId() const {return id.all == UnknownMemoryContextId;}
- uint32 getId() const;
+ U_32 getId() const;
void printId(::std::ostream& os) const;
//
// Fields
//
Tag tag : 8;
union IdUnion {
- uint32 stackOffset;
+ U_32 stackOffset;
FieldDesc * fieldDesc;
MethodDesc * methodDesc;
- uint32 counterId;
+ U_32 counterId;
uint64 all;
} id;
uint8 size; // size of accessed memory in bytes; used for stack locations
@@ -318,7 +318,7 @@
//
// Get memory context for accessing stack memory of given size at given offset
//
- MemoryAttribute::Context getStackContext(uint32 offset, uint32 size) {
+ MemoryAttribute::Context getStackContext(U_32 offset, U_32 size) {
assert(size <= 0xff);
MemoryAttribute::Context c(MemoryAttribute::Context::StackLocation,
(uint8)size);
@@ -330,7 +330,7 @@
// This is IPF specific as incoming arguments are in the previous frame
// and their stack offset is not known till the final register allocation.
//
- MemoryAttribute::Context getStackIncomingArgContext(uint32 offset) {
+ MemoryAttribute::Context getStackIncomingArgContext(U_32 offset) {
MemoryAttribute::Context c(MemoryAttribute::Context::StackIncomingArg);
c.id.stackOffset = offset;
return c;
@@ -356,7 +356,7 @@
MemoryAttribute::Context getJitConstantContext() {
return MemoryAttribute::Context(MemoryAttribute::Context::JitConstant);
}
- MemoryAttribute::Context getProfileCounterContext(uint32 counterId) {
+ MemoryAttribute::Context getProfileCounterContext(U_32 counterId) {
MemoryAttribute::Context c(MemoryAttribute::Context::ProfileCounter);
c.id.counterId = counterId;
return c;
@@ -365,8 +365,8 @@
// Returns a memory context at (offset, size) from the given context
//
MemoryAttribute::Context findContextAtOffset(MemoryAttribute::Context& mc,
- uint32 _offset,
- uint32 _size) {
+ U_32 _offset,
+ U_32 _size) {
MemoryAttribute::Context context(mc);
if (context.tag == MemoryAttribute::Context::StackLocation ||
context.tag == MemoryAttribute::Context::StackIncomingArg) {
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/MemoryManager.cpp Thu May 22 06:33:38 2008
@@ -69,7 +69,7 @@
static ::std::ostream& traceStream = ::std::cerr;
#endif
-static const uint32 mm_default_next_arena_size = 4096-ARENA_HEADER_SIZE;
+static const U_32 mm_default_next_arena_size = 4096-ARENA_HEADER_SIZE;
MemoryManager::MemoryManager(const char* name)
{
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Tree.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Tree.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Tree.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Tree.h Thu May 22 06:33:38 2008
@@ -37,7 +37,7 @@
class TreeNode {
friend class Tree;
public:
- TreeNode() : child(NULL), siblings(NULL), parent(NULL), preNum((uint32) -1), postNum((uint32) -1) {}
+ TreeNode() : child(NULL), siblings(NULL), parent(NULL), preNum((U_32) -1), postNum((U_32) -1) {}
void addChild(TreeNode* chd) {
chd->parent = this;
chd->siblings = child;
@@ -115,21 +115,21 @@
if(siblings) siblings->printIndentedNode(os, indentstr);
}
- uint32 getHeight() const {
- uint32 i = 0;
+ U_32 getHeight() const {
+ U_32 i = 0;
if(child != NULL) {
i = child->getHeight();
for (TreeNode *siblings = child->siblings; siblings!=NULL; siblings = siblings->siblings) {
- uint32 j = siblings->getHeight();
+ U_32 j = siblings->getHeight();
if(j > i) i = j;
}
}
return i + 1;
}
- uint32 getCount() const {
- uint32 i = 1;
+ U_32 getCount() const {
+ U_32 i = 1;
if(child != NULL)
i += child->getCount();
if(siblings != NULL)
@@ -138,12 +138,12 @@
}
//return number of parents
- uint32 getDepth() const {
+ U_32 getDepth() const {
return parent != NULL ? parent->getDepth() + 1 : 0;
}
- uint32 getPreNum() const { return preNum; }
- uint32 getPostNum() const { return postNum; }
+ U_32 getPreNum() const { return preNum; }
+ U_32 getPostNum() const { return postNum; }
// Return true if this is a proper ancestor of n.
bool isAncestorOf(TreeNode* n) {
@@ -154,8 +154,8 @@
TreeNode* child;
TreeNode* siblings;
TreeNode* parent;
- uint32 preNum;
- uint32 postNum;
+ U_32 preNum;
+ U_32 postNum;
};
@@ -182,8 +182,8 @@
root->printIndentedNode(os, indentstr);
}
- uint32 getHeight() const { return root==NULL ? 0 : root->getHeight(); }
- uint32 getCount() const { return root == NULL ? 0: root->getCount(); }
+ U_32 getHeight() const { return root==NULL ? 0 : root->getHeight(); }
+ U_32 getCount() const { return root == NULL ? 0: root->getCount(); }
// Return true if n1 is a proper ancestor of n2.
bool isAncestor(const TreeNode* n1, const TreeNode* n2) const {
@@ -192,13 +192,13 @@
protected:
void computeOrder() {
- uint32 preNum = 0;
- uint32 postNum = 0;
+ U_32 preNum = 0;
+ U_32 postNum = 0;
computeNodeOrder(root, preNum, postNum);
assert(preNum == postNum);
}
- void computeNodeOrder(TreeNode* node, uint32& preNum, uint32& postNum) {
+ void computeNodeOrder(TreeNode* node, U_32& preNum, U_32& postNum) {
node->preNum = preNum++;
if(node->child != NULL)
computeNodeOrder(node->child,preNum,postNum);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp Thu May 22 06:33:38 2008
@@ -29,7 +29,7 @@
namespace Jitrino {
-uint32 Type::nextTypeId = 1;
+U_32 Type::nextTypeId = 1;
bool Type::mayAlias(TypeManager* typeManager, Type* t1, Type* t2)
{
@@ -222,7 +222,7 @@
return isSubTypeOf(vnt->getUnderlyingType(), type2);
}
case Type::ArrayLength:
- // Subtype of itself and int32
+ // Subtype of itself and I_32
return type2==getInt32Type();
case Type::ArrayElementType:
// Subtype of the declared array element type
@@ -533,7 +533,7 @@
}
UnresolvedMethodPtrType*
-TypeManager::getUnresolvedMethodPtrType(ObjectType* enclosingClass, uint32 cpIndex, MethodSignature* sig) {
+TypeManager::getUnresolvedMethodPtrType(ObjectType* enclosingClass, U_32 cpIndex, MethodSignature* sig) {
PtrHashTable<UnresolvedMethodPtrType>* methodsPerClass = unresMethodPtrTypes.lookup(enclosingClass);
if (!methodsPerClass) {
methodsPerClass = new (memManager) PtrHashTable<UnresolvedMethodPtrType>(memManager, 32);
@@ -800,7 +800,7 @@
//
// Returns size of the object
//
-uint32
+U_32
ObjectType::getObjectSize() {
assert(!isUnresolvedObject());
return VMInterface::getObjectSize(vmTypeHandle);
@@ -834,7 +834,7 @@
//
// for array types, returns byte offset of the first element of the array
//
-uint32
+U_32
ArrayType::getArrayElemOffset() {
bool isUnboxed = elemType->isValueType();
if (elemType->isUnresolvedType()) {
@@ -848,7 +848,7 @@
//
// for array types, returns byte offset of the array's length field
//
-uint32
+U_32
ArrayType::getArrayLengthOffset() {
return VMInterface::getArrayLengthOffset();
}
@@ -905,12 +905,12 @@
case IntPtr: s = "intptr"; break;
case Int8: s = "int8"; break;
case Int16: s = "int16"; break;
- case Int32: s = "int32"; break;
+ case Int32: s = "I_32"; break;
case Int64: s = "int64"; break;
case UIntPtr: s = "uintptr"; break;
case UInt8: s = "uint8"; break;
case UInt16: s = "uint16"; break;
- case UInt32: s = "uint32"; break;
+ case UInt32: s = "U_32"; break;
case UInt64: s = "uint64"; break;
case Single: s = "single"; break;
case Double: s = "double"; break;
@@ -987,7 +987,7 @@
pointedToType->print(os);
}
-Type* MethodPtrType::getParamType(uint32 i)
+Type* MethodPtrType::getParamType(U_32 i)
{
return (i==0 && object ? typeManager.getSingletonType(object) : methodDesc->getParamType(i));
}
@@ -1288,15 +1288,15 @@
DECL_TAG_ITEM(NumTypeTags, "XXXX"),
};
-static const uint32 type_tag_names_count = sizeof(type_tag_names)/sizeof(type_tag_names[0]);
+static const U_32 type_tag_names_count = sizeof(type_tag_names)/sizeof(type_tag_names[0]);
#ifdef _DEBUG
static inline void checkArray() {
static bool doArrayCheck = true;
if( !doArrayCheck ) return;
doArrayCheck = false;
- for( uint32 i=0; i<type_tag_names_count; i++ ) {
- assert( (uint32)(type_tag_names[i].tag) == i );
+ for( U_32 i=0; i<type_tag_names_count; i++ ) {
+ assert( (U_32)(type_tag_names[i].tag) == i );
}
}
#else
@@ -1306,7 +1306,7 @@
Type::Tag Type::str2tag(const char * tagname) {
checkArray();
- for( uint32 i=0; i<type_tag_names_count; i++ ) {
+ for( U_32 i=0; i<type_tag_names_count; i++ ) {
if( 0 == strcmpi(type_tag_names[i].name, tagname) ) {
return (Tag)i; // the map is ordered, thus '[i].tag == tag'
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h Thu May 22 06:33:38 2008
@@ -367,7 +367,7 @@
// The two types are pointer types, could their values be the same (i.e. point to the same locations)?
static bool mayAliasPtr(Type*, Type*);
- uint32 getId() { return id; }
+ U_32 getId() { return id; }
// This is for switching integer types depending on the size
#ifdef POINTER64
@@ -388,7 +388,7 @@
protected:
virtual bool _isFinalClass() {return false;}
- static uint32 genNextTypeId() {
+ static U_32 genNextTypeId() {
// this operation can be unsafe until types are cached only per compilation session
// and every compilation session is performed in a single thread
UNSAFE_REGION_START
@@ -398,8 +398,8 @@
}
private:
- const uint32 id;
- static uint32 nextTypeId;
+ const U_32 id;
+ static U_32 nextTypeId;
};
///////////////////////////////////////////////////////////////////////////////
@@ -431,8 +431,8 @@
virtual ~FunctionPtrType() {}
FunctionPtrType* asFunctionPtrType() { return this; }
- virtual uint32 getNumParams() = 0;
- virtual Type* getParamType(uint32) = 0;
+ virtual U_32 getNumParams() = 0;
+ virtual Type* getParamType(U_32) = 0;
virtual Type* getReturnType() = 0;
virtual bool isInstance() = 0;
};
@@ -444,8 +444,8 @@
virtual ~MethodPtrType() {}
MethodPtrType* asMethodPtrType() { return this; }
- uint32 getNumParams() { return methodDesc->getNumParams(); }
- Type* getParamType(uint32 i);
+ U_32 getNumParams() { return methodDesc->getNumParams(); }
+ Type* getParamType(U_32 i);
Type* getReturnType() { return methodDesc->getReturnType(); }
bool isInstance() { return methodDesc->isInstance(); }
virtual MethodDesc* getMethodDesc() {return methodDesc;}
@@ -460,8 +460,8 @@
class UnresolvedMethodPtrType : public MethodPtrType {
public:
- UnresolvedMethodPtrType(ObjectType* _enclosingClass, uint32 _cpIndex, TypeManager& tm,
- uint32 _nParams, Type** _paramTypes, Type* _returnType, const char* _signatureStr,
+ UnresolvedMethodPtrType(ObjectType* _enclosingClass, U_32 _cpIndex, TypeManager& tm,
+ U_32 _nParams, Type** _paramTypes, Type* _returnType, const char* _signatureStr,
bool isCompressed=false, ValueName obj=NULL)
: MethodPtrType(NULL, tm, isCompressed, obj),
enclosingClass(_enclosingClass), cpIndex(_cpIndex),
@@ -471,8 +471,8 @@
virtual ~UnresolvedMethodPtrType() {}
UnresolvedMethodPtrType* asUnresolvedMethodPtrType() { return this; }
- uint32 getNumParams() {return nParams;}
- Type* getParamType(uint32 n){ assert(n<nParams); return paramTypes[n];}
+ U_32 getNumParams() {return nParams;}
+ Type* getParamType(U_32 n){ assert(n<nParams); return paramTypes[n];}
Type* getReturnType() {return returnType;}
bool isInstance() { assert(0); return false;}
virtual MethodDesc* getMethodDesc() {assert(0); return NULL;}
@@ -482,9 +482,9 @@
private:
void initSignature();
ObjectType* enclosingClass;
- uint32 cpIndex;
+ U_32 cpIndex;
- uint32 nParams;
+ U_32 nParams;
Type** paramTypes;
Type* returnType;
const char* signatureStr;
@@ -551,8 +551,8 @@
//
// returns size & alignment of the un-boxed value
//
- virtual uint32 getUnboxedSize(){assert(0); return 0;}
- //virtual uint32 getUnboxedAlignment();
+ virtual U_32 getUnboxedSize(){assert(0); return 0;}
+ //virtual U_32 getUnboxedAlignment();
void print(::std::ostream& os);
protected:
UserValueType(Tag t,void* td,TypeManager& tm) : NamedType(t,td,tm) {}
@@ -606,13 +606,13 @@
//
// Returns size of the object
//
- uint32 getObjectSize();
+ U_32 getObjectSize();
//
// for boxed value types, returns byte offset of the un-boxed value
//
virtual bool isUnresolvedArray() const {return false;}
- uint32 getUnboxedOffset();
+ U_32 getUnboxedOffset();
bool isInterface();
bool isAbstract();
virtual void print(::std::ostream& os);
@@ -631,11 +631,11 @@
//
// for array types, returns byte offset of the first element of the array
//
- uint32 getArrayElemOffset();
+ U_32 getArrayElemOffset();
//
// for array types, returns byte offset of the array's length field
//
- uint32 getArrayLengthOffset();
+ U_32 getArrayLengthOffset();
virtual void print(::std::ostream& os);
protected:
virtual bool _isFinalClass() {
@@ -751,7 +751,7 @@
MethodPtrType* getMethodPtrType(MethodDesc* methodDesc);
- UnresolvedMethodPtrType* getUnresolvedMethodPtrType(ObjectType* enclosingClass, uint32 cpIndex, MethodSignature* sig);
+ UnresolvedMethodPtrType* getUnresolvedMethodPtrType(ObjectType* enclosingClass, U_32 cpIndex, MethodSignature* sig);
MethodPtrType* getMethodPtrObjType(ValueName obj, MethodDesc* methodDesc);
@@ -866,7 +866,7 @@
MethodSignature(){}
virtual ~MethodSignature(){}
- virtual uint32 getNumParams() const = 0;
+ virtual U_32 getNumParams() const = 0;
virtual Type** getParamTypes() const = 0;
virtual Type* getRetType() const = 0;
virtual const char* getSignatureString() const = 0;
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/unionfind.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/unionfind.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/unionfind.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/unionfind.h Thu May 22 06:33:38 2008
@@ -31,7 +31,7 @@
UnionFind &operator=(const UnionFind &other) { assert(0); return *this; };
public:
UnionFind *parent;
- uint32 rank;
+ U_32 rank;
UnionFind() : parent(0), rank(1) { parent = this; };
void link(UnionFind *other) {
assert(other);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ByteCodeParser.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ByteCodeParser.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ByteCodeParser.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ByteCodeParser.h Thu May 22 06:33:38 2008
@@ -36,7 +36,7 @@
// parses one byte code starting at given offset,
// updates nextOffset to point at next byte code,
// returns false if parsing should stop
- virtual bool parseByteCode(const uint8* byteCodes,uint32 byteCodeOffset) = 0;
+ virtual bool parseByteCode(const uint8* byteCodes,U_32 byteCodeOffset) = 0;
// called before the parsing starts
virtual void parseInit() = 0;
// called after the parsing ends, but not if an error occurs
@@ -46,9 +46,9 @@
virtual bool skipParsing() {return false;};
// called when an error occurs during the byte code parsing
virtual void parseError() = 0;
- uint32 getNextOffset() {return nextOffset;}
+ U_32 getNextOffset() {return nextOffset;}
protected:
- uint32 nextOffset;
+ U_32 nextOffset;
};
class ByteCodeParser {
@@ -56,7 +56,7 @@
//
// creates a new ByteCodeParser
//
- ByteCodeParser(const uint8* bc, uint32 length) {
+ ByteCodeParser(const uint8* bc, U_32 length) {
byteCodes = bc; byteCodeLength = length; byteCodeOffset = 0;
}
//
@@ -78,22 +78,22 @@
// Export these values to implement translator optimizations
const uint8* getByteCodes() {return byteCodes;}
- uint32 getByteCodeLength() {return byteCodeLength;}
+ U_32 getByteCodeLength() {return byteCodeLength;}
private:
const uint8* byteCodes;
- uint32 byteCodeLength;
- uint32 byteCodeOffset;
+ U_32 byteCodeLength;
+ U_32 byteCodeOffset;
};
//
// byte code parsing utilities
//
-#define readU4Le(bytes) (((uint32)(bytes)[3]<<24) | ((uint32)(bytes)[2]<<16) | \
- ((uint32)(bytes)[1]<<8) | (bytes)[0])
+#define readU4Le(bytes) (((U_32)(bytes)[3]<<24) | ((U_32)(bytes)[2]<<16) | \
+ ((U_32)(bytes)[1]<<8) | (bytes)[0])
-#define readU4Be(bytes) (((uint32)(bytes)[0]<<24) | ((uint32)(bytes)[1]<<16) | \
- ((uint32)(bytes)[2]<<8) | (bytes)[3])
+#define readU4Be(bytes) (((U_32)(bytes)[0]<<24) | ((U_32)(bytes)[1]<<16) | \
+ ((U_32)(bytes)[2]<<8) | (bytes)[3])
inline int8 si8(const uint8* bcp) {return ((int8*)bcp)[0];}
inline uint8 su8(const uint8* bcp) {return bcp[0];}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ExceptionInfo.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ExceptionInfo.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ExceptionInfo.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/ExceptionInfo.h Thu May 22 06:33:38 2008
@@ -28,11 +28,11 @@
public:
virtual ~ExceptionInfo() {}
- uint32 getId() {return id;}
- uint32 getBeginOffset(){return beginOffset;}
- uint32 getEndOffset() {return endOffset;}
- void setEndOffset(uint32 offset) { endOffset = offset; }
- bool equals(uint32 begin,uint32 end) {
+ U_32 getId() {return id;}
+ U_32 getBeginOffset(){return beginOffset;}
+ U_32 getEndOffset() {return endOffset;}
+ void setEndOffset(U_32 offset) { endOffset = offset; }
+ bool equals(U_32 begin,U_32 end) {
return (begin == beginOffset && end == endOffset);
}
ExceptionInfo* getNextExceptionInfoAtOffset() {return nextExceptionAtOffset;}
@@ -43,55 +43,55 @@
void setLabelInst(LabelInst *lab) { label = lab; }
LabelInst *getLabelInst() { return label; }
protected:
- ExceptionInfo(uint32 _id,
- uint32 _beginOffset,
- uint32 _endOffset)
+ ExceptionInfo(U_32 _id,
+ U_32 _beginOffset,
+ U_32 _endOffset)
: id(_id), beginOffset(_beginOffset), endOffset(_endOffset),
nextExceptionAtOffset(NULL), label(NULL)
{}
private:
- uint32 id;
- uint32 beginOffset;
- uint32 endOffset;
+ U_32 id;
+ U_32 beginOffset;
+ U_32 endOffset;
ExceptionInfo* nextExceptionAtOffset;
LabelInst* label;
};
class CatchHandler : public ExceptionInfo {
public:
- CatchHandler(uint32 id,
- uint32 beginOffset,
- uint32 endOffset,
+ CatchHandler(U_32 id,
+ U_32 beginOffset,
+ U_32 endOffset,
Type* excType)
: ExceptionInfo(id, beginOffset, endOffset),
exceptionType(excType), nextHandler(NULL), order(0) {}
virtual ~CatchHandler() {}
Type* getExceptionType() {return exceptionType;}
- uint32 getExceptionOrder() {return order; }
+ U_32 getExceptionOrder() {return order; }
CatchHandler* getNextHandler() {return nextHandler; }
void setNextHandler(CatchHandler* n) {nextHandler=n; }
- void setOrder(uint32 ord) {order = ord; }
+ void setOrder(U_32 ord) {order = ord; }
bool isCatchHandler() {return true; }
private:
Type* exceptionType;
CatchHandler* nextHandler;
- uint32 order;
+ U_32 order;
};
class CatchBlock : public ExceptionInfo {
public:
- CatchBlock(uint32 id,
- uint32 beginOffset,
- uint32 endOffset,
- uint32 exceptionIndex)
+ CatchBlock(U_32 id,
+ U_32 beginOffset,
+ U_32 endOffset,
+ U_32 exceptionIndex)
: ExceptionInfo(id,beginOffset,endOffset), handlers(NULL), excTableIndex(exceptionIndex) {}
virtual ~CatchBlock() {}
bool isCatchBlock() {return true;}
- uint32 getExcTableIndex() { return excTableIndex; }
+ U_32 getExcTableIndex() { return excTableIndex; }
void addHandler(CatchHandler* handler) {
- uint32 order = 0;
+ U_32 order = 0;
if (handlers == NULL) {
handlers = handler;
} else {
@@ -106,18 +106,18 @@
handler->setOrder(order);
}
- bool hasOffset(uint32 offset)
+ bool hasOffset(U_32 offset)
{
return (getBeginOffset() <= offset) && (offset < getEndOffset());
}
- bool offsetSplits(uint32 offset)
+ bool offsetSplits(U_32 offset)
{
return (getBeginOffset() < offset) && (offset + 1 < getEndOffset());
}
CatchHandler* getHandlers() {return handlers;}
private:
CatchHandler* handlers;
- uint32 excTableIndex;
+ U_32 excTableIndex;
};
} //namespace Jitrino
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp Thu May 22 06:33:38 2008
@@ -135,7 +135,7 @@
}
-OpndStack::OpndStack(MemoryManager& memManager,uint32 slots)
+OpndStack::OpndStack(MemoryManager& memManager,U_32 slots)
: maxSlots(slots)
{
opnds = new (memManager) Opnd*[maxSlots];
@@ -149,29 +149,29 @@
StackOpndAlive = 0x10, // to get rid of phi nodes in the translator
StackOpndSaved = 0x20 // to get rid of phi nodes in the translator
};
-static bool isNonNull(uint32 flags) {
+static bool isNonNull(U_32 flags) {
return (flags & IsNonNull) != 0;
}
-static bool isExactType(uint32 flags) {
+static bool isExactType(U_32 flags) {
return (flags & IsExactType) != 0;
}
-static uint32 setNonNull(uint32 flags,bool val) {
+static U_32 setNonNull(U_32 flags,bool val) {
return (val ? (flags | IsNonNull) : (flags & ~IsNonNull));
}
-static uint32 setExactType(uint32 flags,bool val){
+static U_32 setExactType(U_32 flags,bool val){
return (val ? (flags | IsExactType) : (flags & ~IsExactType));
}
-static bool isStackOpndAlive(uint32 flags) {
+static bool isStackOpndAlive(U_32 flags) {
return (flags & StackOpndAlive) != 0;
}
-static bool isStackOpndSaved(uint32 flags) {
+static bool isStackOpndSaved(U_32 flags) {
return (flags & StackOpndSaved) != 0;
}
-static uint32 setStackOpndAlive(uint32 flags,bool val) {
+static U_32 setStackOpndAlive(U_32 flags,bool val) {
return (val ? (flags | StackOpndAlive) : (flags & ~StackOpndAlive));
}
-static uint32 setStackOpndSaved(uint32 flags,bool val) {
+static U_32 setStackOpndSaved(U_32 flags,bool val) {
return (val ? (flags | StackOpndSaved) : (flags & ~StackOpndSaved));
}
@@ -217,7 +217,7 @@
//
// use the properties in Opnd
//
- uint32 props = opnd->getProperties();
+ U_32 props = opnd->getProperties();
opnd->setProperties(setNonNull(props,val));
return;
}
@@ -229,7 +229,7 @@
//
// use the properties in Opnd
//
- uint32 props = opnd->getProperties();
+ U_32 props = opnd->getProperties();
opnd->setProperties(setExactType(props,val));
return;
}
@@ -240,7 +240,7 @@
//
// use the properties in Opnd
//
- uint32 props = opnd->getProperties();
+ U_32 props = opnd->getProperties();
opnd->setProperties(setStackOpndAlive(props,val));
return;
}
@@ -250,7 +250,7 @@
//
// use the properties in Opnd
//
- uint32 props = opnd->getProperties();
+ U_32 props = opnd->getProperties();
opnd->setProperties(setStackOpndSaved(props,val));
return;
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.h Thu May 22 06:33:38 2008
@@ -85,14 +85,14 @@
class OpndStack {
public:
- OpndStack(MemoryManager& memManager,uint32 slots);
+ OpndStack(MemoryManager& memManager,U_32 slots);
bool isEmpty() {
return tos == 0;
}
bool isFull() {
return tos == maxSlots;
}
- uint32 getNumElems() {
+ U_32 getNumElems() {
return tos;
}
Opnd* top() {
@@ -117,7 +117,7 @@
opnds[tos++] = opnd;
return true;
}
- Opnd* getElem(uint32 i) {
+ Opnd* getElem(U_32 i) {
if (i >= tos) {
assert(0);
return NULL;
@@ -131,8 +131,8 @@
//
// private fields
//
- const uint32 maxSlots;
- uint32 tos;
+ const U_32 maxSlots;
+ U_32 tos;
Opnd** opnds;
};
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.cpp Thu May 22 06:33:38 2008
@@ -292,10 +292,10 @@
uint16 su16(const uint8* bcp) {
return (((uint16)(bcp)[0] << 8)| bcp[1]);
}
-int32 si32(const uint8* bcp) {
- return (((uint32)(bcp)[0] << 24) |
- ((uint32)(bcp)[1] << 16) |
- ((uint32)(bcp)[2] << 8) |
+I_32 si32(const uint8* bcp) {
+ return (((U_32)(bcp)[0] << 24) |
+ ((U_32)(bcp)[1] << 16) |
+ ((U_32)(bcp)[2] << 8) |
bcp[3]);
}
uint64 si64(const uint8* bcp) {
@@ -313,13 +313,13 @@
//
//
bool
-JavaByteCodeParserCallback::parseByteCode(const uint8* byteCodes,uint32 off) {
+JavaByteCodeParserCallback::parseByteCode(const uint8* byteCodes,U_32 off) {
bool linearPassEnd = false;
currentOffset = off;
const uint8* bcp = byteCodes + off;
// find length of the byte code instruction
- uint32 len = 0;
+ U_32 len = 0;
const uint8 opcode = *bcp;
assert (opcode <= 0xc9);
if (Log::isEnabled()) {
@@ -636,7 +636,7 @@
if (labelStack != NULL) {
JavaLookupSwitchTargetsIter switchIter2(bcp,off);
while (switchIter2.hasNext()) {
- uint32 key;
+ U_32 key;
labelStack->push((uint8*)byteCodes + switchIter2.getNextTarget(&key));
}
labelStack->push((uint8*)byteCodes + switchIter2.getDefaultTarget());
@@ -737,7 +737,7 @@
}
// get next label by popping label stack
while (!labelStack->isEmpty()) {
- nextOffset = (uint32) (labelStack->pop() - byteCodes);
+ nextOffset = (U_32) (labelStack->pop() - byteCodes);
if (!visited->getBit(nextOffset)) {
return true;
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeParser.h Thu May 22 06:33:38 2008
@@ -39,7 +39,7 @@
//
int16 si16(const uint8* bcp);
uint16 su16(const uint8* bcp);
-int32 si32(const uint8* bcp);
+I_32 si32(const uint8* bcp);
uint64 si64(const uint8* bcp);
class JavaSwitchTargetsIter;
@@ -57,7 +57,7 @@
labelStack = NULL;
noNeedToParse = false;
}
- JavaByteCodeParserCallback(MemoryManager& memManager,uint32 byteCodeLength)
+ JavaByteCodeParserCallback(MemoryManager& memManager,U_32 byteCodeLength)
: isLinearPass(false)
{
currentOffset = 0;
@@ -69,11 +69,11 @@
labelStack = new (memManager) Queue<uint8>(memManager);
noNeedToParse = false;
}
- bool parseByteCode(const uint8* byteCodes,uint32 byteCodeOffset);
+ bool parseByteCode(const uint8* byteCodes,U_32 byteCodeOffset);
BitSet* getVisited() { return visited; }
protected:
// the current byte codes offset
- uint32 currentOffset;
+ U_32 currentOffset;
const bool isLinearPass;
bool linearPassDone;
BitSet* visited;
@@ -85,18 +85,18 @@
bool noNeedToParse;
// called before each byte code to indicate the next byte code's offset
- virtual void offset(uint32 offset) = 0;
- virtual void offset_done(uint32 offset) = 0;
+ virtual void offset(U_32 offset) = 0;
+ virtual void offset_done(U_32 offset) = 0;
virtual void nop() = 0;
virtual void aconst_null() = 0;
- virtual void iconst(int32) = 0;
+ virtual void iconst(I_32) = 0;
virtual void lconst(int64) = 0;
virtual void fconst(float) = 0;
virtual void dconst(double) = 0;
virtual void bipush(int8) = 0;
virtual void sipush(int16) = 0;
- virtual void ldc(uint32) = 0;
- virtual void ldc2(uint32) = 0;
+ virtual void ldc(U_32) = 0;
+ virtual void ldc2(U_32) = 0;
virtual void iload(uint16 varIndex) = 0;
virtual void lload(uint16 varIndex) = 0;
virtual void fload(uint16 varIndex) = 0;
@@ -110,11 +110,11 @@
virtual void baload() = 0;
virtual void caload() = 0;
virtual void saload() = 0;
- virtual void istore(uint16 varIndex,uint32 off) = 0;
- virtual void lstore(uint16 varIndex,uint32 off) = 0;
- virtual void fstore(uint16 varIndex,uint32 off) = 0;
- virtual void dstore(uint16 varIndex,uint32 off) = 0;
- virtual void astore(uint16 varIndex,uint32 off) = 0;
+ virtual void istore(uint16 varIndex,U_32 off) = 0;
+ virtual void lstore(uint16 varIndex,U_32 off) = 0;
+ virtual void fstore(uint16 varIndex,U_32 off) = 0;
+ virtual void dstore(uint16 varIndex,U_32 off) = 0;
+ virtual void astore(uint16 varIndex,U_32 off) = 0;
virtual void iastore() = 0;
virtual void lastore() = 0;
virtual void fastore() = 0;
@@ -168,7 +168,7 @@
virtual void lor() = 0;
virtual void ixor() = 0;
virtual void lxor() = 0;
- virtual void iinc(uint16 varIndex,int32 amount) = 0;
+ virtual void iinc(uint16 varIndex,I_32 amount) = 0;
virtual void i2l() = 0;
virtual void i2f() = 0;
virtual void i2d() = 0;
@@ -189,51 +189,51 @@
virtual void fcmpg() = 0;
virtual void dcmpl() = 0;
virtual void dcmpg() = 0;
- virtual void ifeq(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void ifne(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void iflt(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void ifge(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void ifgt(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void ifle(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_icmpeq(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_icmpne(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_icmplt(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_icmpge(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_icmpgt(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_icmple(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_acmpeq(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void if_acmpne(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void goto_(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void jsr(uint32 offset, uint32 nextOffset) = 0;
+ virtual void ifeq(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void ifne(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void iflt(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void ifge(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void ifgt(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void ifle(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_icmpeq(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_icmpne(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_icmplt(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_icmpge(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_icmpgt(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_icmple(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_acmpeq(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void if_acmpne(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void goto_(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void jsr(U_32 offset, U_32 nextOffset) = 0;
virtual void ret(uint16 varIndex, const uint8* byteCodes) = 0;
virtual void tableswitch(JavaSwitchTargetsIter*) = 0;
virtual void lookupswitch(JavaLookupSwitchTargetsIter*) = 0;
- virtual void ireturn(uint32 off) = 0;
- virtual void lreturn(uint32 off) = 0;
- virtual void freturn(uint32 off) = 0;
- virtual void dreturn(uint32 off) = 0;
- virtual void areturn(uint32 off) = 0;
- virtual void return_(uint32 off) = 0;
- virtual void getstatic(uint32 constPoolIndex) = 0;
- virtual void putstatic(uint32 constPoolIndex) = 0;
- virtual void getfield(uint32 constPoolIndex) = 0;
- virtual void putfield(uint32 constPoolIndex) = 0;
- virtual void invokevirtual(uint32 constPoolIndex) = 0;
- virtual void invokespecial(uint32 constPoolIndex) = 0;
- virtual void invokestatic(uint32 constPoolIndex) = 0;
- virtual void invokeinterface(uint32 constPoolIndex,uint32 count) = 0;
- virtual void new_(uint32 constPoolIndex) = 0;
+ virtual void ireturn(U_32 off) = 0;
+ virtual void lreturn(U_32 off) = 0;
+ virtual void freturn(U_32 off) = 0;
+ virtual void dreturn(U_32 off) = 0;
+ virtual void areturn(U_32 off) = 0;
+ virtual void return_(U_32 off) = 0;
+ virtual void getstatic(U_32 constPoolIndex) = 0;
+ virtual void putstatic(U_32 constPoolIndex) = 0;
+ virtual void getfield(U_32 constPoolIndex) = 0;
+ virtual void putfield(U_32 constPoolIndex) = 0;
+ virtual void invokevirtual(U_32 constPoolIndex) = 0;
+ virtual void invokespecial(U_32 constPoolIndex) = 0;
+ virtual void invokestatic(U_32 constPoolIndex) = 0;
+ virtual void invokeinterface(U_32 constPoolIndex,U_32 count) = 0;
+ virtual void new_(U_32 constPoolIndex) = 0;
virtual void newarray(uint8 type) = 0;
- virtual void anewarray(uint32 constPoolIndex) = 0;
+ virtual void anewarray(U_32 constPoolIndex) = 0;
virtual void arraylength() = 0;
virtual void athrow() = 0;
- virtual void checkcast(uint32 constPoolIndex) = 0;
- virtual int instanceof(const uint8* bcp, uint32 constPoolIndex, uint32 off) = 0;
+ virtual void checkcast(U_32 constPoolIndex) = 0;
+ virtual int instanceof(const uint8* bcp, U_32 constPoolIndex, U_32 off) = 0;
virtual void monitorenter() = 0;
virtual void monitorexit() = 0;
- virtual void multianewarray(uint32 constPoolIndex,uint8 dimensions) = 0;
- virtual void ifnull(uint32 targetOffset,uint32 nextOffset) = 0;
- virtual void ifnonnull(uint32 targetOffset,uint32 nextOffset) = 0;
+ virtual void multianewarray(U_32 constPoolIndex,uint8 dimensions) = 0;
+ virtual void ifnull(U_32 targetOffset,U_32 nextOffset) = 0;
+ virtual void ifnonnull(U_32 targetOffset,U_32 nextOffset) = 0;
virtual bool skipParsing() {return noNeedToParse;}
@@ -242,79 +242,79 @@
class JavaSwitchTargetsIter {
public:
- JavaSwitchTargetsIter(const uint8* bcp,uint32 off) {
+ JavaSwitchTargetsIter(const uint8* bcp,U_32 off) {
// skip over padding
switchOffset = off;
- uint32 offset = ((off+4)&~3)-off;
+ U_32 offset = ((off+4)&~3)-off;
// read in the default target
defaultTarget = readU4Be(bcp+offset);
lowValue = readU4Be(bcp+offset+4);
highValue = readU4Be(bcp+offset+8);
numTargets = highValue - lowValue + 1;
nextTarget = bcp+offset+12;
- length = ((uint32)(nextTarget-bcp)) + (numTargets * 4);
+ length = ((U_32)(nextTarget-bcp)) + (numTargets * 4);
nextByteCode = bcp + length;
}
bool hasNext() {
return (nextTarget < nextByteCode);
}
- uint32 getNextTarget() {
+ U_32 getNextTarget() {
if (hasNext() == false)
return 0;
- int32 target = readU4Be(nextTarget);
+ I_32 target = readU4Be(nextTarget);
nextTarget += 4;
return target+switchOffset;
}
- uint32 getNumTargets() {return numTargets;}
- uint32 getLength() {return length;}
- uint32 getDefaultTarget() {return defaultTarget+switchOffset;}
- uint32 getHighValue() {return highValue;}
- uint32 getLowValue() {return lowValue;}
+ U_32 getNumTargets() {return numTargets;}
+ U_32 getLength() {return length;}
+ U_32 getDefaultTarget() {return defaultTarget+switchOffset;}
+ U_32 getHighValue() {return highValue;}
+ U_32 getLowValue() {return lowValue;}
private:
const uint8* nextByteCode;
const uint8* nextTarget;
- uint32 switchOffset;
- uint32 numTargets;
- uint32 length;
- int32 defaultTarget;
- uint32 highValue;
- uint32 lowValue;
+ U_32 switchOffset;
+ U_32 numTargets;
+ U_32 length;
+ I_32 defaultTarget;
+ U_32 highValue;
+ U_32 lowValue;
};
class JavaLookupSwitchTargetsIter {
public:
- JavaLookupSwitchTargetsIter(const uint8* bcp,uint32 off) {
+ JavaLookupSwitchTargetsIter(const uint8* bcp,U_32 off) {
// skip over padding
lookupOffset = off;
- uint32 offset = ((off+4)&~3)-off;
+ U_32 offset = ((off+4)&~3)-off;
// read in the default target
defaultTarget = readU4Be(bcp+offset);
numTargets = readU4Be(bcp+offset+4);
nextTarget = bcp+offset+8;
- length = ((uint32)(nextTarget-bcp)) + (numTargets * 8);
+ length = ((U_32)(nextTarget-bcp)) + (numTargets * 8);
nextByteCode = bcp + length;
}
bool hasNext() {
return (nextTarget < nextByteCode);
}
- uint32 getNextTarget(uint32* key) {
+ U_32 getNextTarget(U_32* key) {
if (hasNext() == false)
return 0;
*key = readU4Be(nextTarget);
- int32 target = readU4Be(nextTarget+4);
+ I_32 target = readU4Be(nextTarget+4);
nextTarget += 8;
return target+lookupOffset;
}
- uint32 getNumTargets() {return numTargets;}
- uint32 getLength() {return length;}
- uint32 getDefaultTarget() {return defaultTarget+lookupOffset;}
+ U_32 getNumTargets() {return numTargets;}
+ U_32 getLength() {return length;}
+ U_32 getDefaultTarget() {return defaultTarget+lookupOffset;}
private:
const uint8* nextByteCode;
const uint8* nextTarget;
- uint32 lookupOffset;
- uint32 numTargets;
- uint32 length;
- int32 defaultTarget;
+ U_32 lookupOffset;
+ U_32 numTargets;
+ U_32 length;
+ I_32 defaultTarget;
};
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp Thu May 22 06:33:38 2008
@@ -146,7 +146,7 @@
//
// load actual parameters into formal parameters
//
- for (uint32 i=0,j=0; i<numArgs; i++,j++) {
+ for (U_32 i=0,j=0; i<numArgs; i++,j++) {
//
// for Java this is the same as a local var!
//
@@ -238,7 +238,7 @@
numVars = methodToCompile.getNumVars();
numStackVars = prepass.getStateTable()->getMaxStackOverflow()-numVars;
stateInfo = &prepass.stateInfo;
- for (uint32 k=0; k < numVars+numStackVars; k++) {
+ for (U_32 k=0; k < numVars+numStackVars; k++) {
struct StateInfo::SlotInfo *slot = &stateInfo->stack[k];
slot->type = NULL;
slot->slotFlags = 0;
@@ -278,7 +278,7 @@
// push the operand
//
Opnd*
-JavaByteCodeTranslator::getVarOpndLdVar(JavaLabelPrepass::JavaVarType javaType,uint32 index) {
+JavaByteCodeTranslator::getVarOpndLdVar(JavaLabelPrepass::JavaVarType javaType,U_32 index) {
if (index >= numVars+numStackVars)
// error: invalid local variable id
invalid();
@@ -292,7 +292,7 @@
VarOpnd*
JavaByteCodeTranslator::getVarOpndStVar(JavaLabelPrepass::JavaVarType javaType,
- uint32 index,
+ U_32 index,
Opnd* opnd) {
if (index >= numVars+numStackVars)
// error: invalid local variable id
@@ -377,14 +377,14 @@
//-----------------------------------------------------------------------------
const char*
-JavaByteCodeTranslator::methodSignatureString(uint32 cpIndex) {
+JavaByteCodeTranslator::methodSignatureString(U_32 cpIndex) {
return compilationInterface.getSignatureString(&methodToCompile,cpIndex);
}
-uint32
-JavaByteCodeTranslator::labelId(uint32 offset) {
- uint32 labelId = prepass.getLabelId(offset);
- if (labelId == (uint32) -1)
+U_32
+JavaByteCodeTranslator::labelId(U_32 offset) {
+ U_32 labelId = prepass.getLabelId(offset);
+ if (labelId == (U_32) -1)
jitrino_assert(0);
return labelId;
}
@@ -406,7 +406,7 @@
}
void
-JavaByteCodeTranslator::offset(uint32 offset) {
+JavaByteCodeTranslator::offset(U_32 offset) {
// set bc offset in ir builder
irBuilder.setBcOffset(offset);
@@ -432,7 +432,7 @@
stateInfo->stack[i] = state->stack[i];
assert(stateInfo != NULL);
Type* handlerExceptionType = NULL;
- uint32 lblId = getNextLabelId();
+ U_32 lblId = getNextLabelId();
LabelInst* labelInst = getLabel(lblId);
::std::vector<LabelInst*> catchLabels;
@@ -518,7 +518,7 @@
//
// Load var operands where current basic block begins
//
- for (uint32 k=numVars; k < (uint32)stateInfo->stackDepth; k++) {
+ for (U_32 k=numVars; k < (U_32)stateInfo->stackDepth; k++) {
if(Log::isEnabled()) {
Log::out() << "STACK ";StateInfo::print(stateInfo->stack[k], Log::out());Log::out() << ::std::endl;
}
@@ -531,7 +531,7 @@
}
void
-JavaByteCodeTranslator::offset_done(uint32 offset) {
+JavaByteCodeTranslator::offset_done(U_32 offset) {
if (prepass.isSubroutineEntry(offset) ) {
jsrEntryOffsets[offset] = irBuilder.getLastGeneratedInst();
}
@@ -545,7 +545,7 @@
{
OffsetToInstMap::const_iterator ret_i, ret_e;
for (ret_i = retOffsets.begin(), ret_e = retOffsets.end(); ret_i != ret_e; ++ret_i) {
- uint32 ret_offset = ret_i->first;
+ U_32 ret_offset = ret_i->first;
Inst* ret_inst = ret_i->second;
JavaLabelPrepass::RetToSubEntryMap* ret_to_entry_map = prepass.getRetToSubEntryMapPtr();
JavaLabelPrepass::RetToSubEntryMap::const_iterator sub_i = ret_to_entry_map->find(ret_offset);
@@ -553,7 +553,7 @@
// jsr target should be found for each ret inst
//
assert(sub_i != ret_to_entry_map->end());
- uint32 entry_offset = sub_i->second;
+ U_32 entry_offset = sub_i->second;
OffsetToInstMap::const_iterator entry_inst_i = jsrEntryOffsets.find(entry_offset);
assert(entry_inst_i != jsrEntryOffsets.end());
Inst* entry_inst = entry_inst_i->second;
@@ -577,7 +577,7 @@
pushOpnd(irBuilder.genLdNull());
}
void
-JavaByteCodeTranslator::iconst(int32 val) {
+JavaByteCodeTranslator::iconst(I_32 val) {
pushOpnd(irBuilder.genLdConstant(val));
}
void
@@ -594,14 +594,14 @@
}
void
JavaByteCodeTranslator::bipush(int8 val) {
- pushOpnd(irBuilder.genLdConstant((int32)val));
+ pushOpnd(irBuilder.genLdConstant((I_32)val));
}
void
JavaByteCodeTranslator::sipush(int16 val) {
- pushOpnd(irBuilder.genLdConstant((int32)val));
+ pushOpnd(irBuilder.genLdConstant((I_32)val));
}
void
-JavaByteCodeTranslator::ldc(uint32 constPoolIndex) {
+JavaByteCodeTranslator::ldc(U_32 constPoolIndex) {
// load 32-bit quantity or string from constant pool
Type* constantType =
compilationInterface.getConstantType(&methodToCompile,constPoolIndex);
@@ -618,7 +618,7 @@
const void* constantAddress =
compilationInterface.getConstantValue(&methodToCompile,constPoolIndex);
if (constantType->isInt4()) {
- int32 value = *(int32*)constantAddress;
+ I_32 value = *(I_32*)constantAddress;
opnd = irBuilder.genLdConstant(value);
} else if (constantType->isSingle()) {
float value = *(float*)constantAddress;
@@ -632,7 +632,7 @@
}
void
-JavaByteCodeTranslator::ldc2(uint32 constPoolIndex) {
+JavaByteCodeTranslator::ldc2(U_32 constPoolIndex) {
// load 64-bit quantity from constant pool
Type* constantType =
compilationInterface.getConstantType(&methodToCompile,constPoolIndex);
@@ -677,30 +677,30 @@
genLdVar(varIndex,JavaLabelPrepass::A);
}
void
-JavaByteCodeTranslator::istore(uint16 varIndex,uint32 off) {
+JavaByteCodeTranslator::istore(uint16 varIndex,U_32 off) {
genStVar(varIndex,JavaLabelPrepass::I);
}
void
-JavaByteCodeTranslator::lstore(uint16 varIndex,uint32 off) {
+JavaByteCodeTranslator::lstore(uint16 varIndex,U_32 off) {
genStVar(varIndex,JavaLabelPrepass::L);
}
void
-JavaByteCodeTranslator::fstore(uint16 varIndex,uint32 off) {
+JavaByteCodeTranslator::fstore(uint16 varIndex,U_32 off) {
genStVar(varIndex,JavaLabelPrepass::F);
}
void
-JavaByteCodeTranslator::dstore(uint16 varIndex,uint32 off) {
+JavaByteCodeTranslator::dstore(uint16 varIndex,U_32 off) {
genStVar(varIndex,JavaLabelPrepass::D);
}
void
-JavaByteCodeTranslator::astore(uint16 varIndex,uint32 off) {
+JavaByteCodeTranslator::astore(uint16 varIndex,U_32 off) {
genTypeStVar(varIndex);
}
//-----------------------------------------------------------------------------
// field access byte codes
//-----------------------------------------------------------------------------
Type*
-JavaByteCodeTranslator::getFieldType(FieldDesc* field, uint32 constPoolIndex) {
+JavaByteCodeTranslator::getFieldType(FieldDesc* field, U_32 constPoolIndex) {
Type* fieldType = field->getFieldType();
if (!fieldType) {
// some problem with fieldType class handle. Let's try the constant_pool.
@@ -713,7 +713,7 @@
void
-JavaByteCodeTranslator::getstatic(uint32 constPoolIndex) {
+JavaByteCodeTranslator::getstatic(U_32 constPoolIndex) {
FieldDesc *field = compilationInterface.getStaticField(methodToCompile.getParentHandle(), constPoolIndex, false);
if (field && field->isStatic()) {
bool fieldValueInlined = false;
@@ -732,14 +732,14 @@
case Type::Int8 : constVal=irBuilder.genLdConstant(*(int8*)fieldAddr);break;
case Type::Int16: constVal=irBuilder.genLdConstant(*(int16*)fieldAddr);break;
case Type::Char : constVal=irBuilder.genLdConstant(*(uint16*)fieldAddr);break;
- case Type::Int32: constVal=irBuilder.genLdConstant(*(int32*)fieldAddr);break;
+ case Type::Int32: constVal=irBuilder.genLdConstant(*(I_32*)fieldAddr);break;
case Type::Int64: constVal=irBuilder.genLdConstant(*(int64*)fieldAddr);break;
case Type::Single: constVal=irBuilder.genLdConstant(*(float*)fieldAddr);break;
case Type::Double: constVal=irBuilder.genLdConstant(*(double*)fieldAddr);break;
case Type::Boolean: constVal=irBuilder.genLdConstant(*(bool*)fieldAddr);break;
case Type::UnmanagedPtr: assert(fieldIsMagic);
#ifdef _IA32_
- constVal=irBuilder.genLdConstant(*(int32*)fieldAddr);
+ constVal=irBuilder.genLdConstant(*(I_32*)fieldAddr);
#else
assert(sizeof(void*)==8);
constVal=irBuilder.genLdConstant(*(int64*)fieldAddr);
@@ -772,7 +772,7 @@
}
void
-JavaByteCodeTranslator::putstatic(uint32 constPoolIndex) {
+JavaByteCodeTranslator::putstatic(U_32 constPoolIndex) {
FieldDesc *field = compilationInterface.getStaticField(methodToCompile.getParentHandle(), constPoolIndex, true);
if (field && field->isStatic()) {
Type* fieldType = getFieldType(field,constPoolIndex);
@@ -798,7 +798,7 @@
}
void
-JavaByteCodeTranslator::getfield(uint32 constPoolIndex) {
+JavaByteCodeTranslator::getfield(U_32 constPoolIndex) {
FieldDesc *field = compilationInterface.getNonStaticField(methodToCompile.getParentHandle(), constPoolIndex, false);
if (field && !field->isStatic()) {
Type* fieldType = getFieldType(field, constPoolIndex);
@@ -822,7 +822,7 @@
}
void
-JavaByteCodeTranslator::putfield(uint32 constPoolIndex) {
+JavaByteCodeTranslator::putfield(U_32 constPoolIndex) {
FieldDesc *field = compilationInterface.getNonStaticField(methodToCompile.getParentHandle(), constPoolIndex, true);
if (field && !field->isStatic()) {
Type* fieldType = getFieldType(field,constPoolIndex);
@@ -1085,11 +1085,11 @@
genShr(typeManager.getInt64Type(),UnsignedOp, ShiftMask_Masked);
}
void
-JavaByteCodeTranslator::iinc(uint16 varIndex,int32 amount) {
+JavaByteCodeTranslator::iinc(uint16 varIndex,I_32 amount) {
VarOpnd* varOpnd = (VarOpnd*)getVarOpndLdVar(JavaLabelPrepass::I,varIndex);
assert(varOpnd->isVarOpnd());
Opnd* src1 = irBuilder.genLdVar(typeManager.getInt32Type(),varOpnd);
- Opnd* src2 = irBuilder.genLdConstant((int32)amount);
+ Opnd* src2 = irBuilder.genLdConstant((I_32)amount);
Opnd* result = irBuilder.genAdd(typeManager.getInt32Type(),Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No),
src1,src2);
irBuilder.genStVar(varOpnd,result);
@@ -1210,49 +1210,49 @@
//-----------------------------------------------------------------------------
// control transfer byte codes
//-----------------------------------------------------------------------------
-void JavaByteCodeTranslator::ifeq(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifeq(U_32 targetOffset,U_32 nextOffset) {
genIf1(Cmp_EQ,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::ifne(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifne(U_32 targetOffset,U_32 nextOffset) {
genIf1(Cmp_NE_Un,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::iflt(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::iflt(U_32 targetOffset,U_32 nextOffset) {
genIf1Commute(Cmp_GT,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::ifge(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifge(U_32 targetOffset,U_32 nextOffset) {
genIf1(Cmp_GTE,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::ifgt(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifgt(U_32 targetOffset,U_32 nextOffset) {
genIf1(Cmp_GT,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::ifle(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifle(U_32 targetOffset,U_32 nextOffset) {
genIf1Commute(Cmp_GTE,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::ifnull(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifnull(U_32 targetOffset,U_32 nextOffset) {
genIfNull(Cmp_Zero,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::ifnonnull(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::ifnonnull(U_32 targetOffset,U_32 nextOffset) {
genIfNull(Cmp_NonZero,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_icmpeq(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_icmpeq(U_32 targetOffset,U_32 nextOffset) {
genIf2(Cmp_EQ,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_icmpne(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_icmpne(U_32 targetOffset,U_32 nextOffset) {
genIf2(Cmp_NE_Un,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_icmplt(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_icmplt(U_32 targetOffset,U_32 nextOffset) {
genIf2Commute(Cmp_GT,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_icmpge(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_icmpge(U_32 targetOffset,U_32 nextOffset) {
genIf2(Cmp_GTE,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_icmpgt(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_icmpgt(U_32 targetOffset,U_32 nextOffset) {
genIf2(Cmp_GT,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_icmple(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_icmple(U_32 targetOffset,U_32 nextOffset) {
genIf2Commute(Cmp_GTE,targetOffset,nextOffset);
}
-void JavaByteCodeTranslator::if_acmpeq(uint32 targetOffset,uint32 nextOffset) {
+void JavaByteCodeTranslator::if_acmpeq(U_32 targetOffset,U_32 nextOffset) {
Opnd* src2 = popOpnd();
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
@@ -1267,7 +1267,7 @@
}
void
-JavaByteCodeTranslator::if_acmpne(uint32 targetOffset,uint32 nextOffset) {
+JavaByteCodeTranslator::if_acmpne(U_32 targetOffset,U_32 nextOffset) {
Opnd* src2 = popOpnd();
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
@@ -1282,7 +1282,7 @@
}
void
-JavaByteCodeTranslator::goto_(uint32 targetOffset,uint32 nextOffset) {
+JavaByteCodeTranslator::goto_(U_32 targetOffset,U_32 nextOffset) {
if (targetOffset == nextOffset)
return;
if (targetOffset < nextOffset) {
@@ -1290,7 +1290,7 @@
}
lastInstructionWasABranch = true;
checkStack();
- uint32 lid = labelId(targetOffset);
+ U_32 lid = labelId(targetOffset);
LabelInst *target = getLabel(lid);
irBuilder.genJump(target);
}
@@ -1298,7 +1298,7 @@
// jsr & ret byte codes for finally statements
//-----------------------------------------------------------------------------
void
-JavaByteCodeTranslator::jsr(uint32 targetOffset, uint32 nextOffset) {
+JavaByteCodeTranslator::jsr(U_32 targetOffset, U_32 nextOffset) {
if (targetOffset < nextOffset) {
irBuilder.genPseudoThrow();
}
@@ -1324,10 +1324,10 @@
lastInstructionWasABranch = true;
checkStack();
// subtract the lower bound
- Opnd* bias = irBuilder.genLdConstant((int32)iter->getLowValue());
+ Opnd* bias = irBuilder.genLdConstant((I_32)iter->getLowValue());
Opnd* dst = irBuilder.genSub(bias->getType(),Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No),opnd,bias);
LabelInst** labels = new (memManager) LabelInst*[iter->getNumTargets()];
- for (uint32 i=0; iter->hasNext(); i++) {
+ for (U_32 i=0; iter->hasNext(); i++) {
labels[i] = getLabel(labelId(iter->getNextTarget()));
}
LabelInst * defaultLabel = getLabel(labelId(iter->getDefaultTarget()));
@@ -1341,10 +1341,10 @@
checkStack();
// generate a sequence of branches
while (iter->hasNext()) {
- uint32 key;
- uint32 offset = iter->getNextTarget(&key);
+ U_32 key;
+ U_32 offset = iter->getNextTarget(&key);
// load the key
- Opnd* value = irBuilder.genLdConstant((int32)key);
+ Opnd* value = irBuilder.genLdConstant((I_32)key);
LabelInst *target = getLabel(labelId(offset));
irBuilder.genBranch(Type::Int32,Cmp_EQ,target,opnd,value);
// break the basic block
@@ -1359,37 +1359,37 @@
// method return byte codes
//-----------------------------------------------------------------------------
void
-JavaByteCodeTranslator::ireturn(uint32 off) {
+JavaByteCodeTranslator::ireturn(U_32 off) {
genReturn(JavaLabelPrepass::I,off);
LabelInst *label = irBuilder.createLabel();
cfgBuilder.genBlockAfterCurrent(label);
}
void
-JavaByteCodeTranslator::lreturn(uint32 off) {
+JavaByteCodeTranslator::lreturn(U_32 off) {
genReturn(JavaLabelPrepass::L,off);
LabelInst *label = irBuilder.createLabel();
cfgBuilder.genBlockAfterCurrent(label);
}
void
-JavaByteCodeTranslator::freturn(uint32 off) {
+JavaByteCodeTranslator::freturn(U_32 off) {
genReturn(JavaLabelPrepass::F,off);
LabelInst *label = irBuilder.createLabel();
cfgBuilder.genBlockAfterCurrent(label);
}
void
-JavaByteCodeTranslator::dreturn(uint32 off) {
+JavaByteCodeTranslator::dreturn(U_32 off) {
genReturn(JavaLabelPrepass::D,off);
LabelInst *label = irBuilder.createLabel();
cfgBuilder.genBlockAfterCurrent(label);
}
void
-JavaByteCodeTranslator::areturn(uint32 off) {
+JavaByteCodeTranslator::areturn(U_32 off) {
genReturn(JavaLabelPrepass::A,off);
LabelInst *label = irBuilder.createLabel();
cfgBuilder.genBlockAfterCurrent(label);
}
void
-JavaByteCodeTranslator::return_(uint32 off) {
+JavaByteCodeTranslator::return_(U_32 off) {
genReturn(off);
LabelInst *label = irBuilder.createLabel();
cfgBuilder.genBlockAfterCurrent(label);
@@ -1398,7 +1398,7 @@
// LinkingException throw
//-----------------------------------------------------------------------------
void
-JavaByteCodeTranslator::linkingException(uint32 constPoolIndex, uint32 operation) {
+JavaByteCodeTranslator::linkingException(U_32 constPoolIndex, U_32 operation) {
Class_Handle enclosingDrlVMClass = methodToCompile.getParentHandle();
irBuilder.genThrowLinkingException(enclosingDrlVMClass, constPoolIndex, operation);
}
@@ -1407,7 +1407,7 @@
//-----------------------------------------------------------------------------
void JavaByteCodeTranslator::pseudoInvoke(const char* methodSig)
{
- uint32 numArgs = JavaLabelPrepass::getNumArgsBySignature(methodSig);
+ U_32 numArgs = JavaLabelPrepass::getNumArgsBySignature(methodSig);
// pop numArgs items
while (numArgs--) {
@@ -1427,7 +1427,7 @@
// method invocation byte codes
//-----------------------------------------------------------------------------
Opnd**
-JavaByteCodeTranslator::popArgs(uint32 numArgs) {
+JavaByteCodeTranslator::popArgs(U_32 numArgs) {
// pop source operands
Opnd** srcOpnds = new (memManager) Opnd*[numArgs];
for (int i=numArgs-1; i>=0; i--)
@@ -1444,14 +1444,14 @@
const char* sigSuffix = sigStr;
if (nParams > 0) {
paramTypes = new (mm) Type*[nParams];
- uint32 i = 0;
+ U_32 i = 0;
if (instanceMethod) {
paramTypes[0] = ci.getTypeManager().getUnresolvedObjectType();
i++;
}
sigSuffix++;
for (; i < nParams; i++) {
- uint32 len = 0;
+ U_32 len = 0;
Type* type = JavaLabelPrepass::getTypeByDescriptorString(ci, cl, sigSuffix, len);
assert(type!=NULL);
paramTypes[i] = type;
@@ -1464,12 +1464,12 @@
}
virtual ~JavaMethodSignature(){};
- virtual uint32 getNumParams() const { return nParams;}
+ virtual U_32 getNumParams() const { return nParams;}
virtual Type** getParamTypes() const { return paramTypes;}
virtual Type* getRetType() const {return retType;}
virtual const char* getSignatureString() const {return signatureStr;}
private:
- uint32 nParams;
+ U_32 nParams;
Type** paramTypes;
Type* retType;
const char* signatureStr;
@@ -1487,7 +1487,7 @@
assert(methodSig);
JavaMethodSignature* sig = new (memManager) JavaMethodSignature(irBuilder.getIRManager()->getMemoryManager(),
compilationInterface, !isStatic, (Class_Handle)enclosingClass->getVMTypeHandle(), methodSig);
- uint32 numArgs = sig->getNumParams();
+ U_32 numArgs = sig->getNumParams();
assert(numArgs > 0 || isStatic);
Opnd** args = popArgs(numArgs);
@@ -1522,7 +1522,7 @@
}
void
-JavaByteCodeTranslator::invokevirtual(uint32 constPoolIndex) {
+JavaByteCodeTranslator::invokevirtual(U_32 constPoolIndex) {
MethodDesc* methodDesc = compilationInterface.getVirtualMethod(methodToCompile.getParentHandle(), constPoolIndex);
if (!methodDesc) {
if (!typeManager.isLazyResolutionMode()) {
@@ -1532,7 +1532,7 @@
return;
}
jitrino_assert(methodDesc);
- uint32 numArgs = methodDesc->getNumParams();
+ U_32 numArgs = methodDesc->getNumParams();
Opnd** srcOpnds = popArgs(numArgs);
Type* returnType = methodDesc->getReturnType();
@@ -1584,7 +1584,7 @@
}
void
-JavaByteCodeTranslator::invokespecial(uint32 constPoolIndex) {
+JavaByteCodeTranslator::invokespecial(U_32 constPoolIndex) {
MethodDesc* methodDesc = compilationInterface.getSpecialMethod(methodToCompile.getParentHandle(), constPoolIndex);
if (!methodDesc) {
if (!typeManager.isLazyResolutionMode()) {
@@ -1594,7 +1594,7 @@
return;
}
jitrino_assert(methodDesc);
- uint32 numArgs = methodDesc->getNumParams();
+ U_32 numArgs = methodDesc->getNumParams();
Opnd** srcOpnds = popArgs(numArgs);
Type* returnType = methodDesc->getReturnType();
// invokespecial can throw a null pointer exception
@@ -1623,7 +1623,7 @@
}
void
-JavaByteCodeTranslator::invokestatic(uint32 constPoolIndex) {
+JavaByteCodeTranslator::invokestatic(U_32 constPoolIndex) {
MethodDesc* methodDesc = compilationInterface.getStaticMethod(methodToCompile.getParentHandle(), constPoolIndex);
if (!methodDesc) {
if (!typeManager.isLazyResolutionMode()) {
@@ -1634,7 +1634,7 @@
}
jitrino_assert(methodDesc);
- uint32 numArgs = methodDesc->getNumParams();
+ U_32 numArgs = methodDesc->getNumParams();
Opnd** srcOpnds = popArgs(numArgs);
Type *returnType = methodDesc->getReturnType();
if (returnType == NULL) {
@@ -1655,7 +1655,7 @@
}
void
-JavaByteCodeTranslator::invokeinterface(uint32 constPoolIndex,uint32 count) {
+JavaByteCodeTranslator::invokeinterface(U_32 constPoolIndex,U_32 count) {
MethodDesc* methodDesc = compilationInterface.getInterfaceMethod(methodToCompile.getParentHandle(), constPoolIndex);
if (!methodDesc) {
if (!typeManager.isLazyResolutionMode()) {
@@ -1665,7 +1665,7 @@
return;
}
jitrino_assert(methodDesc);
- uint32 numArgs = methodDesc->getNumParams();
+ U_32 numArgs = methodDesc->getNumParams();
Opnd** srcOpnds = popArgs(numArgs);
Type* returnType = methodDesc->getReturnType();
// callintf can throw a null pointer exception
@@ -1706,7 +1706,7 @@
// object allocation byte codes
//-----------------------------------------------------------------------------
void
-JavaByteCodeTranslator::new_(uint32 constPoolIndex) {
+JavaByteCodeTranslator::new_(U_32 constPoolIndex) {
NamedType* type = compilationInterface.getNamedType(methodToCompile.getParentHandle(), constPoolIndex, ResolveNewCheck_DoCheck);
jitrino_assert(type);
if (type->isUnresolvedObject()) {
@@ -1748,15 +1748,15 @@
pushOpnd(arrayOpnd);
if (translationFlags.optArrayInit) {
const uint8* byteCodes = parser.getByteCodes();
- const uint32 byteCodeLength = parser.getByteCodeLength();
- uint32 offset = currentOffset + 2/*newarray length*/;
- uint32 length = checkForArrayInitializer(arrayOpnd, byteCodes, offset, byteCodeLength);
+ const U_32 byteCodeLength = parser.getByteCodeLength();
+ U_32 offset = currentOffset + 2/*newarray length*/;
+ U_32 length = checkForArrayInitializer(arrayOpnd, byteCodes, offset, byteCodeLength);
currentOffset += length;
}
}
void
-JavaByteCodeTranslator::anewarray(uint32 constPoolIndex) {
+JavaByteCodeTranslator::anewarray(U_32 constPoolIndex) {
NamedType* type = compilationInterface.getNamedType(methodToCompile.getParentHandle(), constPoolIndex);
Opnd* sizeOpnd = popOpnd();
if (type->isUnresolvedType()) {
@@ -1771,7 +1771,7 @@
}
void
-JavaByteCodeTranslator::multianewarray(uint32 constPoolIndex,uint8 dimensions) {
+JavaByteCodeTranslator::multianewarray(U_32 constPoolIndex,uint8 dimensions) {
NamedType* arraytype = compilationInterface.getNamedType(methodToCompile.getParentHandle(), constPoolIndex);
assert(arraytype->isArray());
jitrino_assert(dimensions > 0);
@@ -1810,7 +1810,7 @@
// type checking byte codes
//-----------------------------------------------------------------------------
void
-JavaByteCodeTranslator::checkcast(uint32 constPoolIndex) {
+JavaByteCodeTranslator::checkcast(U_32 constPoolIndex) {
NamedType *type = compilationInterface.getNamedType(methodToCompile.getParentHandle(), constPoolIndex);
Opnd* objOpnd = popOpnd();
if (type->isUnresolvedType()) {
@@ -1824,7 +1824,7 @@
}
int
-JavaByteCodeTranslator::instanceof(const uint8* bcp, uint32 constPoolIndex, uint32 off) {
+JavaByteCodeTranslator::instanceof(const uint8* bcp, U_32 constPoolIndex, U_32 off) {
NamedType *type = compilationInterface.getNamedType(methodToCompile.getParentHandle(), constPoolIndex);
Opnd* src = popOpnd();
Type* srcType = src->getType();
@@ -1866,7 +1866,7 @@
// src is null, instanceOf returns 0
irBuilder.genLabel(ObjIsNullLabel);
cfgBuilder.genBlockAfterCurrent(ObjIsNullLabel);
- Opnd * zero = irBuilder.genLdConstant((int32)0);
+ Opnd * zero = irBuilder.genLdConstant((I_32)0);
irBuilder.genStVar(resVar, zero);
irBuilder.genJump(Exit);
@@ -1907,7 +1907,7 @@
// variable access helpers
//-----------------------------------------------------------------------------
void
-JavaByteCodeTranslator::genLdVar(uint32 varIndex,JavaLabelPrepass::JavaVarType javaType) {
+JavaByteCodeTranslator::genLdVar(U_32 varIndex,JavaLabelPrepass::JavaVarType javaType) {
Opnd *var = getVarOpndLdVar(javaType,varIndex);
if (VMMagicUtils::isVMMagicClass(var->getType()->getName())) {
var->setType(convertVMMagicType2HIR(typeManager, var->getType()));
@@ -1936,7 +1936,7 @@
}
void
-JavaByteCodeTranslator::genStVar(uint32 varIndex,JavaLabelPrepass::JavaVarType javaType) {
+JavaByteCodeTranslator::genStVar(U_32 varIndex,JavaLabelPrepass::JavaVarType javaType) {
Opnd *src = popOpnd();
VarOpnd *var = getVarOpndStVar(javaType,varIndex,src);
if (var != NULL)
@@ -1947,7 +1947,7 @@
// method return helpers
//-----------------------------------------------------------------------------
bool
-JavaByteCodeTranslator::needsReturnLabel(uint32 off) {
+JavaByteCodeTranslator::needsReturnLabel(U_32 off) {
if (!moreThanOneReturn && methodToCompile.getByteCodeSize()-1 != off) {
if (!jumpToTheEnd) {
// allocate one more label
@@ -1961,7 +1961,7 @@
// for non-void returns
void
-JavaByteCodeTranslator::genReturn(JavaLabelPrepass::JavaVarType javaType, uint32 off) {
+JavaByteCodeTranslator::genReturn(JavaLabelPrepass::JavaVarType javaType, U_32 off) {
Opnd *ret = popOpndStVar();
if (methodToCompile.isSynchronized()) {
// Create a new block to break exception region. The monexit exception should
@@ -1980,7 +1980,7 @@
// for void returns
void
-JavaByteCodeTranslator::genReturn(uint32 off) {
+JavaByteCodeTranslator::genReturn(U_32 off) {
if (methodToCompile.isSynchronized()) {
// Create a new block to break exception region. The monexit exception should
// go to unwind.
@@ -2201,8 +2201,8 @@
//-----------------------------------------------------------------------------
void
JavaByteCodeTranslator::genIf1(ComparisonModifier mod,
- int32 targetOffset,
- int32 nextOffset) {
+ I_32 targetOffset,
+ I_32 nextOffset) {
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
return;
@@ -2212,14 +2212,14 @@
lastInstructionWasABranch = true;
checkStack();
LabelInst *target = getLabel(labelId(targetOffset));
- Opnd* src2 = irBuilder.genLdConstant((int32)0);
+ Opnd* src2 = irBuilder.genLdConstant((I_32)0);
irBuilder.genBranch(Type::Int32,mod,target,src1,src2);
}
void
JavaByteCodeTranslator::genIf1Commute(ComparisonModifier mod,
- int32 targetOffset,
- int32 nextOffset) {
+ I_32 targetOffset,
+ I_32 nextOffset) {
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
return;
@@ -2229,14 +2229,14 @@
lastInstructionWasABranch = true;
checkStack();
LabelInst *target = getLabel(labelId(targetOffset));
- Opnd* src2 = irBuilder.genLdConstant((int32)0);
+ Opnd* src2 = irBuilder.genLdConstant((I_32)0);
irBuilder.genBranch(Type::Int32,mod,target,src2,src1);
}
void
JavaByteCodeTranslator::genIf2(ComparisonModifier mod,
- int32 targetOffset,
- int32 nextOffset) {
+ I_32 targetOffset,
+ I_32 nextOffset) {
Opnd* src2 = popOpnd();
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
@@ -2252,8 +2252,8 @@
void
JavaByteCodeTranslator::genIf2Commute(ComparisonModifier mod,
- int32 targetOffset,
- int32 nextOffset) {
+ I_32 targetOffset,
+ I_32 nextOffset) {
Opnd* src2 = popOpnd();
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
@@ -2269,8 +2269,8 @@
void
JavaByteCodeTranslator::genIfNull(ComparisonModifier mod,
- int32 targetOffset,
- int32 nextOffset) {
+ I_32 targetOffset,
+ I_32 nextOffset) {
Opnd* src1 = popOpnd();
if (targetOffset == nextOffset)
return;
@@ -2304,7 +2304,7 @@
void
JavaByteCodeTranslator::genInvokeStatic(MethodDesc * methodDesc,
- uint32 numArgs,
+ U_32 numArgs,
Opnd ** srcOpnds,
Type * returnType) {
Opnd *dst;
@@ -2345,7 +2345,7 @@
bool
JavaByteCodeTranslator::genMinMax(MethodDesc * methodDesc,
- uint32 numArgs,
+ U_32 numArgs,
Opnd ** srcOpnds,
Type * returnType) {
@@ -2469,10 +2469,10 @@
}
}
-uint32 JavaByteCodeTranslator::checkForArrayInitializer(Opnd* arrayOpnd, const uint8* byteCodes, uint32 offset, const uint32 byteCodeLength)
+U_32 JavaByteCodeTranslator::checkForArrayInitializer(Opnd* arrayOpnd, const uint8* byteCodes, U_32 offset, const U_32 byteCodeLength)
{
assert(offset < byteCodeLength);
- const uint32 MIN_NUMBER_OF_INIT_ELEMS = 2;
+ const U_32 MIN_NUMBER_OF_INIT_ELEMS = 2;
const uint8 BYTE_JAVA_SIZE = 1;
const uint8 SHORT_JAVA_SIZE = 2;
@@ -2486,7 +2486,7 @@
// Size of the array elements
uint8 elem_size = 0;
// Number of initialized array elements
- uint32 elems = 0;
+ U_32 elems = 0;
ArrayType* arrayType = arrayOpnd->getType()->asArrayType();
assert(arrayType);
@@ -2506,8 +2506,8 @@
::std::vector<uint64> array_data;
// Current offset.
- uint32 off = offset;
- uint32 predoff = offset;
+ U_32 off = offset;
+ U_32 predoff = offset;
// Array element indexes
uint64 oldIndex = 0;
uint64 newIndex = 0;
@@ -2515,7 +2515,7 @@
uint64 value = 0;
bool exitScan = false;
- uint32 tmpOff = 0;
+ U_32 tmpOff = 0;
while (byteCodes[off++] == 0x59/*dup*/) {
if (off >= byteCodeLength) break;
@@ -2570,10 +2570,10 @@
if (elems < MIN_NUMBER_OF_INIT_ELEMS) return 0;
- const uint32 data_size = elems* elem_size;
+ const U_32 data_size = elems* elem_size;
uint8* init_array_data = new uint8[data_size];
- for (uint32 i = 0; i < elems; i++) {
+ for (U_32 i = 0; i < elems; i++) {
switch (elem_size) {
case BYTE_JAVA_SIZE:
init_array_data[i] = (uint8)(array_data[i]);
@@ -2582,7 +2582,7 @@
*((uint16*)(init_array_data + (i * SHORT_JAVA_SIZE))) = (uint16)(array_data[i]);
break;
case INT_JAVA_SIZE:
- *((uint32*)(init_array_data + (i * INT_JAVA_SIZE))) = (uint32)(array_data[i]);
+ *((U_32*)(init_array_data + (i * INT_JAVA_SIZE))) = (U_32)(array_data[i]);
break;
case LONG_JAVA_SIZE:
*((uint64*)(init_array_data + (i * LONG_JAVA_SIZE))) = (uint64)(array_data[i]);
@@ -2594,10 +2594,10 @@
Type* returnType = typeManager.getVoidType();
Opnd* arrayDataOpnd = irBuilder.genLdConstant((POINTER_SIZE_SINT)init_array_data);
- Opnd* arrayElemsOffset = irBuilder.genLdConstant((int32)(arrayType->getArrayElemOffset()));
- Opnd* elemsOpnd = irBuilder.genLdConstant((int32)data_size);
+ Opnd* arrayElemsOffset = irBuilder.genLdConstant((I_32)(arrayType->getArrayElemOffset()));
+ Opnd* elemsOpnd = irBuilder.genLdConstant((I_32)data_size);
- const uint32 numArgs = 4;
+ const U_32 numArgs = 4;
Opnd* args[numArgs] = {arrayOpnd, arrayElemsOffset, arrayDataOpnd, elemsOpnd};
irBuilder.genJitHelperCall(InitializeArray, returnType, numArgs, args);
@@ -2605,9 +2605,9 @@
return predoff - offset;
}
-uint32 JavaByteCodeTranslator::getNumericValue(const uint8* byteCodes, uint32 offset, const uint32 byteCodeLength, uint64& value) {
+U_32 JavaByteCodeTranslator::getNumericValue(const uint8* byteCodes, U_32 offset, const U_32 byteCodeLength, uint64& value) {
assert(offset < byteCodeLength);
- uint32 off = offset;
+ U_32 off = offset;
switch (byteCodes[off++]) {
case 0x02: // iconst_m1
value = (uint64)(-1);
@@ -2635,19 +2635,19 @@
case 0x0b: // fconst_0
{
float val = 0.0f;
- value = (uint64)(*((uint32*)(&val)));
+ value = (uint64)(*((U_32*)(&val)));
}
break;
case 0x0c: // fconst_1
{
float val = 1.0f;
- value = (uint64)(*((uint32*)(&val)));
+ value = (uint64)(*((U_32*)(&val)));
}
break;
case 0x0d: // fconst_2
{
float val = 2.0f;
- value = (uint64)(*((uint32*)(&val)));
+ value = (uint64)(*((U_32*)(&val)));
}
break;
case 0x0e: // dconst_0
@@ -2674,7 +2674,7 @@
case 0x12: // ldc
{
if (off >= byteCodeLength) return 0;
- uint32 constPoolIndex = su8(byteCodes + (off++));
+ U_32 constPoolIndex = su8(byteCodes + (off++));
// load 32-bit quantity from constant pool
Type* constantType = compilationInterface.getConstantType(&methodToCompile,constPoolIndex);
if ( !(constantType->isInt4() || constantType->isSingle()) ) {
@@ -2684,13 +2684,13 @@
}
const void* constantAddress =
compilationInterface.getConstantValue(&methodToCompile,constPoolIndex);
- value = *(uint32*)constantAddress;
+ value = *(U_32*)constantAddress;
}
break;
case 0x13: // ldc_w
{
if ((off + 1) >= byteCodeLength) return 0;
- uint32 constPoolIndex = su16(byteCodes + off);
+ U_32 constPoolIndex = su16(byteCodes + off);
// load 32-bit quantity from constant pool
Type* constantType = compilationInterface.getConstantType(&methodToCompile,constPoolIndex);
if ( !(constantType->isInt4() || constantType->isSingle()) ) {
@@ -2700,14 +2700,14 @@
}
const void* constantAddress =
compilationInterface.getConstantValue(&methodToCompile,constPoolIndex);
- value = *(uint32*)constantAddress;
+ value = *(U_32*)constantAddress;
}
off += 2;
break;
case 0x14: // ldc2_w
{
if ((off + 1) >= byteCodeLength) return 0;
- uint32 constPoolIndex = su16(byteCodes + off);
+ U_32 constPoolIndex = su16(byteCodes + off);
// load 64-bit quantity from constant pool
Type* constantType = compilationInterface.getConstantType(&methodToCompile,constPoolIndex);
if ( !(constantType->isInt8() || constantType->isDouble()) ) {
@@ -2727,7 +2727,7 @@
return off - offset;
}
-bool JavaByteCodeTranslator::genVMMagic(const char* mname, uint32 numArgs, Opnd **srcOpnds, Type *magicRetType) {
+bool JavaByteCodeTranslator::genVMMagic(const char* mname, U_32 numArgs, Opnd **srcOpnds, Type *magicRetType) {
Type* resType = convertVMMagicType2HIR(typeManager, magicRetType);
Type* cmpResType = typeManager.getInt32Type();
Opnd* tauSafe = irBuilder.genTauSafe();
@@ -2968,7 +2968,7 @@
return false;
}
-bool JavaByteCodeTranslator::genVMHelper(const char* mname, uint32 numArgs, Opnd **srcOpnds, Type *returnType) {
+bool JavaByteCodeTranslator::genVMHelper(const char* mname, U_32 numArgs, Opnd **srcOpnds, Type *returnType) {
Type* resType = VMMagicUtils::isVMMagicClass(returnType->getName()) ? convertVMMagicType2HIR(typeManager, returnType) : returnType;
//VMHelper methods
@@ -3116,7 +3116,7 @@
assert(numArgs == 0);
ObjectType* base = compilationInterface.findClassUsingBootstrapClassloader(VMHELPER_TYPE_NAME);
int ready = base!=NULL && !base->needsInitialization() ? 1 : 0;
- Opnd* res = irBuilder.genLdConstant((int32)ready);
+ Opnd* res = irBuilder.genLdConstant((I_32)ready);
pushOpnd(res);
return true;
}