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 [5/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/ jitr...
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp Thu May 22 06:33:38 2008
@@ -99,7 +99,7 @@
bool replaced = false;
if (memOpndKind != MemOpndKind_Null){
assert(isPlacedIn(OpndKind_Mem));
- for (uint32 i=0; i<MemOpndSubOpndKind_Count; i++) {
+ for (U_32 i=0; i<MemOpndSubOpndKind_Count; i++) {
if (memOpndSubOpnds[i]!=NULL && memOpndSubOpnds[i]==opndOld) {
setMemOpndSubOpnd((MemOpndSubOpndKind)i, opndNew);
replaced = true;
@@ -118,7 +118,7 @@
bool replaced = false;
if (memOpndKind != MemOpndKind_Null){
assert(isPlacedIn(OpndKind_Mem));
- for (uint32 i=0; i<MemOpndSubOpndKind_Count; i++) {
+ for (U_32 i=0; i<MemOpndSubOpndKind_Count; i++) {
if (memOpndSubOpnds[i]!=NULL && opndMap[memOpndSubOpnds[i]->id]!=NULL){
setMemOpndSubOpnd((MemOpndSubOpndKind)i, opndMap[memOpndSubOpnds[i]->id]);
replaced = true;
@@ -165,7 +165,7 @@
}
//_________________________________________________________________________________________________
-void Opnd::addRefCount(uint32& index, uint32 blockExecCount)
+void Opnd::addRefCount(U_32& index, U_32 blockExecCount)
{
if (blockExecCount==0)
blockExecCount=1;
@@ -173,7 +173,7 @@
if (id==EmptyUint32)
id=index++;
if (memOpndKind != MemOpndKind_Null){
- for (uint32 i=0; i<MemOpndSubOpndKind_Count; i++)
+ for (U_32 i=0; i<MemOpndSubOpndKind_Count; i++)
if (memOpndSubOpnds[i]!=NULL){
memOpndSubOpnds[i]->addRefCount(index, blockExecCount);
}
@@ -201,7 +201,7 @@
//=================================================================================================
// class Inst
//=================================================================================================
-void* Inst::operator new(size_t sz, MemoryManager& mm, uint32 opndCount)
+void* Inst::operator new(size_t sz, MemoryManager& mm, U_32 opndCount)
{
Inst * p = (Inst*)mm.alloc(sz + Inst::getOpndChunkSize(opndCount));
p->allocatedOpndCount = opndCount; p->opnds = (Opnd**)((uint8*)p + sz);
@@ -209,7 +209,7 @@
}
//_________________________________________________________________________________________________
-void Inst::insertOpnd(uint32 idx, Opnd * opnd, uint32 roles)
+void Inst::insertOpnd(U_32 idx, Opnd * opnd, U_32 roles)
{
assert(opndCount < allocatedOpndCount);
@@ -225,10 +225,10 @@
if (idx > opndCount)
idx = opndCount;
- uint32 * opndRoles = getOpndRoles();
+ U_32 * opndRoles = getOpndRoles();
Constraint * opndConstraints = getConstraints();
- for (uint32 i = opndCount; i > idx; i--){
+ for (U_32 i = opndCount; i > idx; i--){
opnds[i] = opnds[i - 1];
opndRoles[i] = opndRoles[i - 1];
opndConstraints[i] = opndConstraints[i - 1];
@@ -241,23 +241,23 @@
}
//_________________________________________________________________________________________________
-uint32 Inst::countOpnds(uint32 roles)const
+U_32 Inst::countOpnds(U_32 roles)const
{
- uint32 count=0;
+ U_32 count=0;
if ( (roles & OpndRole_InstLevel) != 0 ){
- const uint32 * opndRoles = getOpndRoles();
- for (uint32 i = 0, n = opndCount; i < n; i++){
- uint32 r = opndRoles [i];
+ const U_32 * opndRoles = getOpndRoles();
+ for (U_32 i = 0, n = opndCount; i < n; i++){
+ U_32 r = opndRoles [i];
if ( (r & roles & OpndRole_FromEncoder) != 0 && (r & roles & OpndRole_ForIterator) != 0 )
count++;
}
}
if ( (roles & OpndRole_OpndLevel) != 0 && (roles & OpndRole_Use) != 0 ){
- for (uint32 i = 0, n = opndCount; i < n; i++){
+ for (U_32 i = 0, n = opndCount; i < n; i++){
const Opnd * opnd = opnds[i];
if ( opnd->memOpndKind != MemOpndKind_Null ){
const Opnd * const * subOpnds = opnd->getMemOpndSubOpnds();
- for (uint32 j = 0; j < MemOpndSubOpndKind_Count; j++){
+ for (U_32 j = 0; j < MemOpndSubOpndKind_Count; j++){
const Opnd * subOpnd = subOpnds[j];
if (subOpnd != NULL)
count++;
@@ -269,11 +269,11 @@
}
//_________________________________________________________________________________________________
-Constraint Inst::getConstraint(uint32 idx, uint32 memOpndMask, OpndSize size) const
+Constraint Inst::getConstraint(U_32 idx, U_32 memOpndMask, OpndSize size) const
{
Constraint c(OpndKind_Any);
if (idx < opndCount){
- const uint32 * opndRoles = getOpndRoles();
+ const U_32 * opndRoles = getOpndRoles();
const Constraint * constraints = getConstraints();
c = constraints[idx];
if ((opndRoles[idx] & OpndRole_Explicit) && (properties & Inst::Properties_MemoryOpndConditional)){
@@ -300,7 +300,7 @@
}
//_________________________________________________________________________________________________
-void Inst::setOpnd(uint32 index, Opnd * opnd)
+void Inst::setOpnd(U_32 index, Opnd * opnd)
{
Opnd ** opnds = getOpnds();
if (index < opndCount) {
@@ -329,12 +329,12 @@
}
//_________________________________________________________________________________________________
-bool Inst::replaceOpnd(Opnd * oldOpnd, Opnd * newOpnd, uint32 opndRoleMask)
+bool Inst::replaceOpnd(Opnd * oldOpnd, Opnd * newOpnd, U_32 opndRoleMask)
{
bool replaced = false;
assert(newOpnd != NULL);
- for (uint32 i=0, n=getOpndCount(); i<n; i++){
- uint32 opndRole=getOpndRoles(i);
+ for (U_32 i=0, n=getOpndCount(); i<n; i++){
+ U_32 opndRole=getOpndRoles(i);
Opnd * opnd=getOpnd(i);
if (
(opndRole&opndRoleMask&OpndRole_FromEncoder)!=0 &&
@@ -358,7 +358,7 @@
if (getProperties() & Properties_PureDef) {
assert(getOpndCount(OpndRole_InstLevel|OpndRole_Use)==2);
Opnd * use = NULL;
- for (uint32 i=0, n=getOpndCount(); i<n; i++){
+ for (U_32 i=0, n=getOpndCount(); i<n; i++){
if (getOpndRoles(i)&OpndRole_Use) {
if(!use) {
use = getOpnd(i);
@@ -371,11 +371,11 @@
return false;
}
//_________________________________________________________________________________________________
-bool Inst::replaceOpnds(Opnd * const * opndMap, uint32 opndRoleMask)
+bool Inst::replaceOpnds(Opnd * const * opndMap, U_32 opndRoleMask)
{
bool replaced = false;
- for (uint32 i=0, n=getOpndCount(); i<n; i++){
- uint32 opndRole=getOpndRoles(i);
+ for (U_32 i=0, n=getOpndCount(); i<n; i++){
+ U_32 opndRole=getOpndRoles(i);
if (
(opndRole&opndRoleMask&OpndRole_FromEncoder)!=0 &&
(opndRole&opndRoleMask&OpndRole_ForIterator)!=0
@@ -396,7 +396,7 @@
}
//_________________________________________________________________________________________________
-void Inst::swapOperands(uint32 idx0, uint32 idx1)
+void Inst::swapOperands(U_32 idx0, U_32 idx1)
{
Opnd * opnd0=getOpnd(idx0), * opnd1=getOpnd(idx1);
setOpnd(idx1, opnd0);
@@ -433,7 +433,7 @@
assert(form==Form_Native);
instEnd = Encoder::emit(stream, this);
}
- setCodeSize((uint32)(instEnd - stream));
+ setCodeSize((U_32)(instEnd - stream));
return instEnd;
}
@@ -441,10 +441,10 @@
void Inst::initFindInfo(Encoder::FindInfo& fi, Opnd::ConstraintKind opndConstraintKind)const
{
Opnd * const * opnds = getOpnds();
- const uint32 * roles = getOpndRoles();
- uint32 count = 0, defCount = 0, defCountFromInst = defOpndCount;
- for (uint32 i=0, n=opndCount; i<n; i++){
- uint32 r = roles[i];
+ const U_32 * roles = getOpndRoles();
+ U_32 count = 0, defCount = 0, defCountFromInst = defOpndCount;
+ for (U_32 i=0, n=opndCount; i<n; i++){
+ U_32 r = roles[i];
if (r & Inst::OpndRole_Explicit){
fi.opndConstraints[count++] = opnds[i]->getConstraint(opndConstraintKind);
if (i < defCountFromInst)
@@ -461,16 +461,16 @@
//_________________________________________________________________________________________________
void Inst::fixOpndsForOpcodeGroup(IRManager * irManager)
{
- uint32 handledExplicitOpnds = 0, handledImplicitOpnds = 0;
+ U_32 handledExplicitOpnds = 0, handledImplicitOpnds = 0;
- uint32 * roles = getOpndRoles();
+ U_32 * roles = getOpndRoles();
Constraint * constraints = getConstraints();
Form f = getForm();
- for (uint32 i=0, n=opndCount; i<n; i++){
+ for (U_32 i=0, n=opndCount; i<n; i++){
if (roles[i] & Inst::OpndRole_Explicit){
- uint32 idx, r;
+ U_32 idx, r;
if (f == Form_Native){
idx = handledExplicitOpnds;
r = Encoder::getOpndRoles(opcodeGroup->opndRoles, idx);
@@ -491,10 +491,10 @@
}
}
- for (uint32 i = handledImplicitOpnds; i < opcodeGroup->implicitOpndRoles.count; i++){
+ for (U_32 i = handledImplicitOpnds; i < opcodeGroup->implicitOpndRoles.count; i++){
RegName iorn = opcodeGroup->implicitOpndRegNames[i];
Opnd * implicitOpnd = irManager->getRegOpnd(iorn);
- uint32 implicitOpndRoles =
+ U_32 implicitOpndRoles =
Encoder::getOpndRoles(opcodeGroup->implicitOpndRoles, i) | Inst::OpndRole_Implicit;
if (implicitOpndRoles & OpndRole_Def){
insertOpnd(defOpndCount, implicitOpnd, implicitOpndRoles);
@@ -512,11 +512,11 @@
if (hasKind(Inst::Kind_PseudoInst)){
assert(getForm() == Form_Extended);
opcodeGroup= (Encoder::OpcodeGroup *)Encoder::getDummyOpcodeGroup();
- uint32 * roles = getOpndRoles();
- uint32 i = 0;
- for (uint32 n = defOpndCount; i < n; i++)
+ U_32 * roles = getOpndRoles();
+ U_32 i = 0;
+ for (U_32 n = defOpndCount; i < n; i++)
roles[i] = OpndRole_Auxilary | OpndRole_Def;
- for (uint32 n = opndCount; i < n; i++)
+ for (U_32 n = opndCount; i < n; i++)
roles[i] = OpndRole_Auxilary | OpndRole_Use;
}else{
Encoder::FindInfo fi;
@@ -537,17 +537,17 @@
Node* bb = getNode();
- uint32 * opndRoles = getOpndRoles();
+ U_32 * opndRoles = getOpndRoles();
Constraint * constraints = getConstraints();
- int32 defs[IRMaxNativeOpnds]={ -1, -1, -1, -1 };
- for (uint32 i=0; i<opndCount; i++){
- uint32 r = opndRoles[i];
+ I_32 defs[IRMaxNativeOpnds]={ -1, -1, -1, -1 };
+ for (U_32 i=0; i<opndCount; i++){
+ U_32 r = opndRoles[i];
if ((r & OpndRole_Explicit) == 0) continue;
- uint32 extendedIdx = r >> 16;
- uint32 nativeIdx = opcodeGroup->extendedToNativeMap[extendedIdx];
+ U_32 extendedIdx = r >> 16;
+ U_32 nativeIdx = opcodeGroup->extendedToNativeMap[extendedIdx];
assert(nativeIdx < IRMaxNativeOpnds);
- int32 defNativeIdx = defs[nativeIdx];
+ I_32 defNativeIdx = defs[nativeIdx];
if (defNativeIdx != -1){
assert(i >= defOpndCount);
opndRoles[defNativeIdx] |= OpndRole_Use;
@@ -560,10 +560,10 @@
defs[nativeIdx] = i;
}
- uint32 packedOpnds = 0, explicitOpnds = 0;
- for (uint32 i = 0, n = opndCount; i < n; i++){
+ U_32 packedOpnds = 0, explicitOpnds = 0;
+ for (U_32 i = 0, n = opndCount; i < n; i++){
if (opnds[i] == NULL) continue;
- uint32 r = opndRoles[i];
+ U_32 r = opndRoles[i];
if ((r & OpndRole_Explicit) != 0){
r = (r & 0xffff) | (explicitOpnds << 16);
explicitOpnds++;
@@ -683,7 +683,7 @@
return (ConstantAreaItem *)tableAddrRI->getValue(0);
}
-Node* SwitchInst::getTarget(uint32 i)const
+Node* SwitchInst::getTarget(U_32 i)const
{
ConstantAreaItem * cai = getConstantAreaItem();
assert(i<cai->getSize()/sizeof(Node*));
@@ -697,7 +697,7 @@
Node* target = edge->getTargetNode();
assert(target->isBlockNode());
bool found = false;
- for (uint32 i =0 ; i < getNumTargets(); i++) {
+ for (U_32 i =0 ; i < getNumTargets(); i++) {
Node* myTarget = getTarget(i);
if (myTarget == target) {
found = true;
@@ -710,13 +710,13 @@
}
//_________________________________________________________________________________________________
-uint32 SwitchInst::getNumTargets() const
+U_32 SwitchInst::getNumTargets() const
{
return getConstantAreaItem()->getSize() / sizeof(Node*);
}
//_________________________________________________________________________________________________
-void SwitchInst::setTarget(uint32 i, Node* bb)
+void SwitchInst::setTarget(U_32 i, Node* bb)
{
assert(bb->isBlockNode());
@@ -734,7 +734,7 @@
#ifdef _DEBUG
bool found = false;
#endif
- for (uint32 i=0, n=cai->getSize()/sizeof(Node*); i<n; i++) {
+ for (U_32 i=0, n=cai->getSize()/sizeof(Node*); i<n; i++) {
if (bbs[i]==bbFrom) {
#ifdef _DEBUG
found = true;
@@ -774,7 +774,7 @@
{
Inst::verify();
#ifdef _DEBUG
- for (uint32 i=0, n = getNumTargets(); i<n; ++i) {
+ for (U_32 i=0, n = getNumTargets(); i<n; ++i) {
Node* target = getTarget(i);
assert(target!=NULL && target->isBlockNode());
assert(node->isConnectedTo(true, target));
@@ -804,18 +804,18 @@
//_________________________________________________________________________________________________
void CallingConventionClient::finalizeInfos(Inst::OpndRole role, CallingConvention::ArgKind argKind)
{
- uint32 slotNumber=0;
+ U_32 slotNumber=0;
StlVector<CallingConvention::OpndInfo> & infos = getInfos(role);
assert(callingConvention != NULL);
- callingConvention->getOpndInfo(argKind, (uint32)infos.size(),
+ callingConvention->getOpndInfo(argKind, (U_32)infos.size(),
infos.empty() ? (CallingConvention::OpndInfo*)NULL : &infos.front());
- for (uint32 i = 0, n = (uint32)infos.size(); i != n; i++) {
- uint32 index = callingConvention->pushLastToFirst() ? i : (n - 1 - i);
+ for (U_32 i = 0, n = (U_32)infos.size(); i != n; i++) {
+ U_32 index = callingConvention->pushLastToFirst() ? i : (n - 1 - i);
CallingConvention::OpndInfo & info = infos[index];
- for (uint32 j = 0; j < info.slotCount; j++) {
+ for (U_32 j = 0; j < info.slotCount; j++) {
if (!info.isReg)
info.slots[j] = 0xFFFF & slotNumber++;
}
@@ -845,20 +845,20 @@
{
StlVector<CallingConvention::OpndInfo> & infos = getInfos(role);
StlVector<StackOpndInfo> & stackOpndInfos = getStackOpndInfos(role);
- uint32 slotSize=sizeof(POINTER_SIZE_INT);
- uint32 regArgCount=0, stackArgCount=0;
+ U_32 slotSize=sizeof(POINTER_SIZE_INT);
+ U_32 regArgCount=0, stackArgCount=0;
Inst::Opnds opnds(ownerInst, Inst::OpndRole_Auxilary|role);
Inst::Opnds::iterator handledOpnds=opnds.begin();
- for (uint32 i=0, n=(uint32)infos.size(); i<n; i++){
+ for (U_32 i=0, n=(U_32)infos.size(); i<n; i++){
const CallingConvention::OpndInfo& info=infos[i];
#ifdef _DEBUG
bool eachSlotRequiresOpnd=false;
#endif
- uint32 offset=0;
- for (uint32 j=0, cbCurrent=0; j<info.slotCount; j++){
+ U_32 offset=0;
+ for (U_32 j=0, cbCurrent=0; j<info.slotCount; j++){
Opnd * opnd=opnds.getOpnd(handledOpnds);
OpndSize sz=opnd->getSize();
- uint32 cb=getByteSize(sz);
+ U_32 cb=getByteSize(sz);
RegName r=(RegName)info.slots[j];
if (info.isReg) {
r=Constraint::getAliasRegName(r,sz);
@@ -912,7 +912,7 @@
#endif
{ kind=Kind_EntryPointPseudoInst; callingConventionClient.setOwnerInst(this); }
//_________________________________________________________________________________________________________
-Opnd * EntryPointPseudoInst::getDefArg(uint32 i)const
+Opnd * EntryPointPseudoInst::getDefArg(U_32 i)const
{
return NULL;
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h Thu May 22 06:33:38 2008
@@ -165,27 +165,27 @@
};
/** Constructs a RuntimeInfo instance of RuntimeInfo::Type t and initialize it with given values */
- RuntimeInfo(RuntimeInfo::Kind k, void * value0, void * value1=0, void * value2=0, void * value3=0, uint32 addOffset=0)
+ RuntimeInfo(RuntimeInfo::Kind k, void * value0, void * value1=0, void * value2=0, void * value3=0, U_32 addOffset=0)
:kind(k), additionalOffset(addOffset)
{ value[0]=value0; value[1]=value1; value[2]=value2; value[3]=value3; }
/** Returns the the value at index i */
- void * getValue(uint32 i)const{ assert(i<sizeof(value)/sizeof(value[0])); return value[i]; }
+ void * getValue(U_32 i)const{ assert(i<sizeof(value)/sizeof(value[0])); return value[i]; }
- uint32 getAdditionalOffset()const{ return additionalOffset; }
+ U_32 getAdditionalOffset()const{ return additionalOffset; }
/** Returns the kind of the info */
RuntimeInfo::Kind getKind()const { return kind; }
private:
RuntimeInfo::Kind kind;
void * value[4];
- uint32 additionalOffset;
+ U_32 additionalOffset;
};
public:
/** Returns the ID of the operand */
- uint32 getId()const{ return id; }
+ U_32 getId()const{ return id; }
/**
* Returns the ID of the operand assigned at its creation.
@@ -193,7 +193,7 @@
* The original ID returned by getFirstID is used in logging and IR dumps
* for convenience.
*/
- uint32 getFirstId()const{ return firstId; }
+ U_32 getFirstId()const{ return firstId; }
/** Returns the type of the operand */
Type * getType()const{ return type; }
@@ -219,7 +219,7 @@
bool canBePlacedIn(Constraint c)const
{ return !(getConstraint(ConstraintKind_Calculated, c.getSize())&c).isNull(); }
inline bool canBePlacedIn(OpndKind opndKind)const
- { return ((uint32)opndKind & constraints[ConstraintKind_Calculated].getKind()) != 0; }
+ { return ((U_32)opndKind & constraints[ConstraintKind_Calculated].getKind()) != 0; }
/** Returns the physical register assigned to the operand */
RegName getRegName()const{ return isPlacedIn(OpndKind_Reg)?regName:RegName_Null; }
@@ -268,7 +268,7 @@
* This is an "optimized" version of the isPlacedIn method for OpndKind args.
*/
inline bool isPlacedIn(OpndKind opndKind)const
- { return ( (uint32)opndKind & constraints[ConstraintKind_Location].getKind() ) != 0; }
+ { return ( (U_32)opndKind & constraints[ConstraintKind_Location].getKind() ) != 0; }
/** Returns true if the operand IS assigned to any location. */
bool hasAssignedPhysicalLocation()const
@@ -318,7 +318,7 @@
*
* The refCount value is calculated during IRManager::calculateOpndStatistics.
*/
- uint32 getRefCount()const{ return refCount; }
+ U_32 getRefCount()const{ return refCount; }
/** Assigns the Calculated constrain to the operand. */
void setCalculatedConstraint(Constraint c);
@@ -361,7 +361,7 @@
*/
void normalizeMemSubOpnds(void);
- void addRefCount(uint32& index, uint32 blockExecCount);
+ void addRefCount(U_32& index, U_32 blockExecCount);
#ifdef _DEBUG
void checkConstraints();
@@ -371,7 +371,7 @@
private:
//-------------------------------------------------------------------------
- Opnd(uint32 _id, Type * t, Constraint c)
+ Opnd(U_32 _id, Type * t, Constraint c)
:id(_id), firstId(_id), type(t),
defScope(DefScope_Null), definingInst(NULL), refCount(0),
segReg(RegName_Null), memOpndKind(MemOpndKind_Null),
@@ -381,14 +381,14 @@
}
//-------------------------------------------------------------------------
- uint32 id;
- uint32 firstId;
+ U_32 id;
+ U_32 firstId;
Type * type;
Constraint constraints[ConstraintKind_Current];
DefScope defScope;
Inst * definingInst;
- uint32 refCount;
+ U_32 refCount;
RegName segReg;
MemOpndKind memOpndKind;
@@ -579,7 +579,7 @@
bool hasKind(Kind k)const{ return (kind&k)==kind; }
/** Returns the id of the instruction. */
- uint32 getId()const{ return id; }
+ U_32 getId()const{ return id; }
/** Returns the current form of the instruction. */
Form getForm()const{ return (Form)form; }
@@ -588,7 +588,7 @@
* Returns the stack depth at the instruction.
* This information is calculated in IRManager::calculateStackDepth().
*/
- uint32 getStackDepth() const { return stackDepth; }
+ U_32 getStackDepth() const { return stackDepth; }
/** Returns the mnemonic of the instruction. */
Mnemonic getMnemonic()const{ return mnemonic; }
@@ -605,25 +605,25 @@
/** Shortcut: returns the properties of the instruction (bit-mask of Properties). */
- uint32 getProperties()const
+ U_32 getProperties()const
{ return properties; }
bool getPureDefProperty() const;
/** Returns the sequential index of the instruction after ordering via IRManager::indexInsts. */
- uint32 getIndex()const{ return index; }
+ U_32 getIndex()const{ return index; }
/**
* Returns the number of InstLevel operands in the instruction.
* This is an optimized version of getOpndCount(OpndRole_InstLevel|OpndRole_UseDef).
*/
- uint32 getOpndCount()const{ return opndCount; }
+ U_32 getOpndCount()const{ return opndCount; }
/**
* Returns the number of operands in the instruction satisfying the given mask.
* Please refer to documentation of enum OpndRole for description of usage of opnd roles as filters.
*/
- uint32 getOpndCount(uint32 roles)const
+ U_32 getOpndCount(U_32 roles)const
{ return
roles == (OpndRole_InstLevel|OpndRole_UseDef) ? opndCount:
roles == (OpndRole_InstLevel|OpndRole_Def) ? defOpndCount:
@@ -650,7 +650,7 @@
* Inst::Opnds::iterator can also be used as index in this method and should be used to iterate
* over all operands including OpndLevel.
*/
- Opnd * getOpnd(uint32 index)const
+ Opnd * getOpnd(U_32 index)const
{
Opnd * const * opnds = getOpnds();
if (index < opndCount)
@@ -662,27 +662,27 @@
* Returns a mask describing operand roles (|-ed from OpndRole values).
*
* The indexing space is common for all operands including OpndLevel
- * (please see comments to Opnd * getOpnd(uint32 index)const).
+ * (please see comments to Opnd * getOpnd(U_32 index)const).
*/
- uint32 getOpndRoles(uint32 index) const
+ U_32 getOpndRoles(U_32 index) const
{ return index < opndCount ? getOpndRoles()[index] : OpndRole_OpndLevel|OpndRole_Use; }
/** Returns a const array of all InstLevel operands. */
Opnd * const * getOpnds()const { return opnds; }
/** Returns a const array of InstLevel operand roles. */
- const uint32 * getOpndRoles()const
- { uint32 aoc = allocatedOpndCount; return (const uint32*)(opnds + aoc); }
+ const U_32 * getOpndRoles()const
+ { U_32 aoc = allocatedOpndCount; return (const U_32*)(opnds + aoc); }
/** Returns a const array of InstLevel operand constraints. */
const Constraint * getConstraints()const
- { uint32 aoc = allocatedOpndCount; return (const Constraint*)((const uint32*)(opnds + aoc) + aoc); }
+ { U_32 aoc = allocatedOpndCount; return (const Constraint*)((const U_32*)(opnds + aoc) + aoc); }
/**
* Returns the constraint imposed by the instruction for the operand at idx.
*
* The indexing space is common for all operands including OpndLevel
- * (please see comments to Opnd * getOpnd(uint32 index)const).
+ * (please see comments to Opnd * getOpnd(U_32 index)const).
*
* @param idx - operand index to get the constraint for.
*
@@ -695,13 +695,13 @@
* @param size - if this parameter is not OpndSize_Null the resulted constraint
* is adjusted to the requested size.
*/
- Constraint getConstraint(uint32 idx, uint32 memOpndMask, OpndSize size = OpndSize_Null) const;
+ Constraint getConstraint(U_32 idx, U_32 memOpndMask, OpndSize size = OpndSize_Null) const;
/**
* Returns true if the position at idx starts or extends the operand live range
* (simplistically its a use of the operand).
*/
- bool isLiveRangeStart(uint32 idx)const
+ bool isLiveRangeStart(U_32 idx)const
{ return (getOpndRoles(idx) & Inst::OpndRole_Use) != 0 && getOpnd(idx)->isSubjectForLivenessAnalysis() && !getPureDefProperty(); }
@@ -709,7 +709,7 @@
* Returns true if the position at idx ends the operand live range
* (simplistically its a pure def of the operand).
*/
- bool isLiveRangeEnd(uint32 idx)const
+ bool isLiveRangeEnd(U_32 idx)const
{ return ((getOpndRoles(idx) & Inst::OpndRole_UseDef) == Inst::OpndRole_Def && (getProperties() & Inst::Properties_Conditional)==0) || ((getOpndRoles(idx) & Inst::OpndRole_Def)!=0 && getPureDefProperty()); }
@@ -717,9 +717,9 @@
* Sets opnd in the instruction at idx.
*
* The indexing space is common for all operands including OpndLevel
- * (please see comments to Opnd * getOpnd(uint32 index)const).
+ * (please see comments to Opnd * getOpnd(U_32 index)const).
*/
- void setOpnd(uint32 idx, Opnd * opnd);
+ void setOpnd(U_32 idx, Opnd * opnd);
/**
@@ -728,10 +728,10 @@
* Works only for InstLevel operands. The total number of operands cannot
* exceed pre-allocated capacity.
*/
- void insertOpnd(uint32 idx, Opnd * opnd, uint32 opndRoles);
+ void insertOpnd(U_32 idx, Opnd * opnd, U_32 opndRoles);
/** Replaces all occurences of opndOld with roles matching opndRoleMask to opndNew */
- bool replaceOpnd(Opnd * opndOld, Opnd * opndNew, uint32 opndRoleMask=OpndRole_All);
+ bool replaceOpnd(Opnd * opndOld, Opnd * opndNew, U_32 opndRoleMask=OpndRole_All);
/**
* Replaces all occurences of operands with roles matching opndRoleMask
@@ -740,7 +740,7 @@
* The opndMap map is organized as an array indexed by from-operand ID which contains to-operands.
* The number of entries in the array must be no less than the value returned by IRManager::getOpndCount()
*/
- bool replaceOpnds(Opnd * const * opndMap, uint32 opndRoleMask=OpndRole_All);
+ bool replaceOpnds(Opnd * const * opndMap, U_32 opndRoleMask=OpndRole_All);
/** Returns true if the instruction has side effect not described by its operands */
virtual bool hasSideEffect()const
@@ -785,7 +785,7 @@
Inst * getPrev()const{ return (Inst*)_prev; }
/** Swaps inst's operands at idx0 and idx1 */
- void swapOperands(uint32 idx0, uint32 idx1);
+ void swapOperands(U_32 idx0, U_32 idx1);
/**
* Changes instruction form to native
@@ -807,11 +807,11 @@
{ return getProperties()&&Properties_Conditional; }
/** Sets the offset of native code for this instruction. */
- void setCodeOffset(uint32 offset) {codeOffset = offset;}
+ void setCodeOffset(U_32 offset) {codeOffset = offset;}
/** Returns the offset of native code for this instruction. */
- uint32 getCodeOffset()const { return codeOffset; }
+ U_32 getCodeOffset()const { return codeOffset; }
/** Returns the size of native code for this instruction. */
- uint32 getCodeSize()const { return codeSize; }
+ U_32 getCodeSize()const { return codeSize; }
/** Returns the pointer to the native code for this instruction. */
void * getCodeStartAddr()const;
@@ -834,68 +834,68 @@
protected:
//---------------------------------------------------------------
- static void* operator new(size_t sz, MemoryManager& mm, uint32 opndCount);
+ static void* operator new(size_t sz, MemoryManager& mm, U_32 opndCount);
- static inline void operator delete(void * p, MemoryManager& mm, uint32 opndCount) {}
+ static inline void operator delete(void * p, MemoryManager& mm, U_32 opndCount) {}
static inline void operator delete(void * p) {}
- Inst(Mnemonic m, uint32 _id, Form f)
+ Inst(Mnemonic m, U_32 _id, Form f)
:kind(Kind_Inst), id(_id), mnemonic(m), prefix(InstPrefix_Null),
form(f), reservedFlags(0), codeSize(0), properties(0), reservedFlags2(0),
opcodeGroup(0), index(0), codeOffset(0),
/*allocatedOpndCount(0), */defOpndCount(0), opndCount(0), stackDepth(0)/*, opnds(0)*/
// WARN! commented opnds are assigned in overloaded 'new' operator before the constructor
- // : void* Inst::operator new(size_t sz, MemoryManager& mm, uint32 opndCount)
+ // : void* Inst::operator new(size_t sz, MemoryManager& mm, U_32 opndCount)
{}
virtual ~Inst(){};
- static uint32 getOpndChunkSize(uint32 opndCount){ return opndCount * (sizeof(Opnd*) + sizeof(uint32) * 2); }
+ static U_32 getOpndChunkSize(U_32 opndCount){ return opndCount * (sizeof(Opnd*) + sizeof(U_32) * 2); }
/** sets the size of native code for this instruction */
- void setCodeSize(uint32 size) {codeSize = size;}
+ void setCodeSize(U_32 size) {codeSize = size;}
Opnd ** getOpnds() { return opnds; }
- uint32 * getOpndRoles()
- { uint32 aoc = allocatedOpndCount; return (uint32*)(opnds + aoc); }
+ U_32 * getOpndRoles()
+ { U_32 aoc = allocatedOpndCount; return (U_32*)(opnds + aoc); }
Constraint * getConstraints()
- { uint32 aoc = allocatedOpndCount; return (Constraint*)((const uint32*)(opnds + aoc) + aoc); }
- static uint32 getExplicitOpndIndexFromOpndRoles(uint32 roles)
+ { U_32 aoc = allocatedOpndCount; return (Constraint*)((const U_32*)(opnds + aoc) + aoc); }
+ static U_32 getExplicitOpndIndexFromOpndRoles(U_32 roles)
{ return roles>>16; }
- uint32 countOpnds(uint32 roles)const;
+ U_32 countOpnds(U_32 roles)const;
- void setConstraint(uint32 idx, Constraint c)
+ void setConstraint(U_32 idx, Constraint c)
{ assert( (getOpndRoles()[idx] & OpndRole_Explicit) == 0 ); getConstraints()[idx] = c; }
void fixOpndsForOpcodeGroup(IRManager * irManager);
void assignOpcodeGroup(IRManager * irManager);
- void setStackDepth(const uint32 sd) { stackDepth = sd; }
+ void setStackDepth(const U_32 sd) { stackDepth = sd; }
//---------------------------------------------------------------
Kind kind;
- uint32 id;
+ U_32 id;
Mnemonic mnemonic;
InstPrefix prefix;
- uint32 form:1;
- uint32 reservedFlags:7;
- uint32 codeSize:8;
- uint32 properties:8;
- uint32 reservedFlags2:8;
+ U_32 form:1;
+ U_32 reservedFlags:7;
+ U_32 codeSize:8;
+ U_32 properties:8;
+ U_32 reservedFlags2:8;
Encoder::OpcodeGroup * opcodeGroup;
- uint32 index;
- uint32 codeOffset;
+ U_32 index;
+ U_32 codeOffset;
- uint32 allocatedOpndCount:16;
- uint32 defOpndCount:16;
- uint32 opndCount:16;
- uint32 stackDepth:16;
+ U_32 allocatedOpndCount:16;
+ U_32 defOpndCount:16;
+ U_32 opndCount:16;
+ U_32 stackDepth:16;
Opnd ** opnds;
@@ -914,8 +914,8 @@
class Inst::Opnds
{
public:
- typedef uint32 iterator;
- inline Opnds(const Inst * inst, uint32 r)
+ typedef U_32 iterator;
+ inline Opnds(const Inst * inst, U_32 r)
{
rolesToCheck = 0;
roles = NULL;
@@ -956,21 +956,21 @@
if (index < instEndIndex){
if (roles == NULL)
return index;
- uint32 r = rolesToCheck;
+ U_32 r = rolesToCheck;
do {
- uint32 ri = roles[index] & r;
+ U_32 ri = roles[index] & r;
if ( (ri & Inst::OpndRole_ForIterator) && (ri & Inst::OpndRole_FromEncoder) ) return index;
}while (++index < instEndIndex);
}
return skipNulls(index);
}
- uint32 skipNulls(iterator index)const
+ U_32 skipNulls(iterator index)const
{
while (index < endIndex){
- uint32 diffIndex = index - instEndIndex;
+ U_32 diffIndex = index - instEndIndex;
Opnd * instOpnd = opnds[diffIndex / 4];
- uint32 subIndex = diffIndex & 3;
+ U_32 subIndex = diffIndex & 3;
if (subIndex == 0 && instOpnd->getMemOpndKind()==MemOpndKind_Null)
index += 4;
else if (instOpnd->getMemOpndSubOpnd((MemOpndSubOpndKind)(subIndex))==NULL) index++;
@@ -979,7 +979,7 @@
return index;
}
- uint32 fill( Opnd ** opnds )const;
+ U_32 fill( Opnd ** opnds )const;
Opnd * getOpnd(iterator index)const
{
@@ -990,9 +990,9 @@
}
}
- uint32 startIndex, endIndex, instEndIndex;
- Opnd * const * opnds; const uint32 * roles;
- uint32 rolesToCheck;
+ U_32 startIndex, endIndex, instEndIndex;
+ Opnd * const * opnds; const U_32 * roles;
+ U_32 rolesToCheck;
};
@@ -1026,7 +1026,7 @@
: Inst(Mnemonic_NULL, id, Inst::Form_Extended), offset(EmptyUint32)
{kind=Kind_AliasPseudoInst;}
- uint32 offset;
+ U_32 offset;
friend class IRManager;
};
@@ -1066,7 +1066,7 @@
virtual bool hasSideEffect()const{ return true; }
public:
- StlVector<int32> offsets;
+ StlVector<I_32> offsets;
const char* desc;
};
@@ -1107,7 +1107,7 @@
virtual bool isDirect()const
{ return getOpndCount()>0 && getOpnd(getTargetOpndIndex())->isPlacedIn(OpndKind_Imm); }
- uint32 getTargetOpndIndex()const{ return getOpndCount(OpndRole_InstLevel|OpndRole_Def); }
+ U_32 getTargetOpndIndex()const{ return getOpndCount(OpndRole_InstLevel|OpndRole_Def); }
virtual bool hasSideEffect()const { return true; }
protected:
@@ -1186,10 +1186,10 @@
public:
/** Returns the basic block for index i */
- uint32 getNumTargets() const;
- Node* getTarget(uint32 i)const;
+ U_32 getNumTargets() const;
+ Node* getTarget(U_32 i)const;
/** Sets the basic block for index i */
- void setTarget(uint32 i, Node* bb);
+ void setTarget(U_32 i, Node* bb);
Opnd * getTableAddress() const;
ConstantAreaItem * getConstantAreaItem() const;
@@ -1230,8 +1230,8 @@
public:
struct StackOpndInfo
{
- uint32 opndIndex;
- uint32 offset;
+ U_32 opndIndex;
+ U_32 offset;
bool operator<(const StackOpndInfo& r)const{ return offset < r.offset; }
};
@@ -1246,7 +1246,7 @@
void pushInfo(Inst::OpndRole role, Type::Tag typeTag)
{
CallingConvention::OpndInfo info;
- info.typeTag=(uint32)typeTag; info.slotCount=0;
+ info.typeTag=(U_32)typeTag; info.slotCount=0;
StlVector<CallingConvention::OpndInfo> & infos = getInfos(role);
infos.push_back(info);
}
@@ -1257,10 +1257,10 @@
const CallingConvention * getCallingConvention()const
{ assert(callingConvention!=NULL); return callingConvention; }
- uint32 getArgStackDepth(Inst::OpndRole role)const
+ U_32 getArgStackDepth(Inst::OpndRole role)const
{ return ((role & Inst::OpndRole_UseDef) == Inst::OpndRole_Def) ? defArgStackDepth : useArgStackDepth; }
- uint32 getArgStackDepthAlignment(Inst::OpndRole role) const
+ U_32 getArgStackDepthAlignment(Inst::OpndRole role) const
{ return ((role & Inst::OpndRole_UseDef) == Inst::OpndRole_Def) ? useArgStackDepthAlignment : useArgStackDepthAlignment; }
void setOwnerInst(Inst * oi){ ownerInst = oi; }
@@ -1279,8 +1279,8 @@
StlVector<StackOpndInfo> defStackOpndInfos;
StlVector<StackOpndInfo> useStackOpndInfos;
- uint32 defArgStackDepth, useArgStackDepth;
- uint32 defArgStackDepthAlignment, useArgStackDepthAlignment;
+ U_32 defArgStackDepth, useArgStackDepth;
+ U_32 defArgStackDepthAlignment, useArgStackDepthAlignment;
};
@@ -1296,9 +1296,9 @@
public:
virtual bool isHeaderCriticalInst() const {return true;}
- Opnd * getDefArg(uint32 i)const;
+ Opnd * getDefArg(U_32 i)const;
- uint32 getArgStackDepth()const
+ U_32 getArgStackDepth()const
{ return callingConventionClient.getArgStackDepth(Inst::OpndRole_Def); }
CallingConventionClient& getCallingConventionClient(){ return callingConventionClient; }
@@ -1327,10 +1327,10 @@
{
public:
- uint32 getArgStackDepth()const
+ U_32 getArgStackDepth()const
{ return callingConventionClient.getArgStackDepth(Inst::OpndRole_Use); }
- uint32 getArgStackDepthAlignment() const
+ U_32 getArgStackDepthAlignment() const
{ return callingConventionClient.getArgStackDepthAlignment(Inst::OpndRole_Use); }
CallingConventionClient& getCallingConventionClient(){ return callingConventionClient; }
@@ -1431,20 +1431,20 @@
Kind_SwitchTableConstantAreaItem=0x100,
};
- ConstantAreaItem(Kind k, uint32 s, const void * v)
+ ConstantAreaItem(Kind k, U_32 s, const void * v)
:kind(k), size(s), value(v), address(NULL){}
Kind getKind()const{ return kind; }
bool hasKind(Kind k)const{ return (kind&k)==kind; }
- uint32 getSize()const{ return size; }
+ U_32 getSize()const{ return size; }
void const * getValue()const{ return value; }
void * getAddress()const { return address; }
void setAddress(void * addr) { address=addr; }
protected:
const Kind kind;
- const uint32 size;
+ const U_32 size;
void const * value;
void * address;
};
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp Thu May 22 06:33:38 2008
@@ -113,19 +113,19 @@
float __stdcall convF8F4 (double v) stdcall__;
float __stdcall convF8F4 (double v) { return (float)v; }
-int32 __stdcall convF4I4 (float v) stdcall__;
-int32 __stdcall convF4I4 (float v) {
+I_32 __stdcall convF4I4 (float v) stdcall__;
+I_32 __stdcall convF4I4 (float v) {
#ifdef PLATFORM_POSIX
if (isnan(v))
#else
if (_isnan(v))
#endif
return 0;
- if (v>(double)(int32)0x7fffffff)
- return (int32)0x7fffffff; // maxint
- if (v<(double)(int32)0x80000000)
- return (int32)0x80000000; // minint
- return (int32)v;
+ if (v>(double)(I_32)0x7fffffff)
+ return (I_32)0x7fffffff; // maxint
+ if (v<(double)(I_32)0x80000000)
+ return (I_32)0x80000000; // minint
+ return (I_32)v;
}
int64 __stdcall convF4I8 (float v) stdcall__;
@@ -144,19 +144,19 @@
return (int64)v;
}
-int32 __stdcall convF8I4 (double v) stdcall__;
-int32 __stdcall convF8I4 (double v) {
+I_32 __stdcall convF8I4 (double v) stdcall__;
+I_32 __stdcall convF8I4 (double v) {
#ifdef PLATFORM_POSIX
if (isnan(v))
#else
if (_isnan(v))
#endif
return 0;
- if (v>(double)(int32)0x7fffffff)
- return (int32)0x7fffffff; // maxint
- if (v<(double)(int32)0x80000000)
- return (int32)0x80000000; // minint
- return (int32)v;
+ if (v>(double)(I_32)0x7fffffff)
+ return (I_32)0x7fffffff; // maxint
+ if (v<(double)(I_32)0x80000000)
+ return (I_32)0x80000000; // minint
+ return (I_32)v;
}
int64 __stdcall convF8I8 (double v) stdcall__;
@@ -174,12 +174,12 @@
return (int64)v;
}
-double __stdcall convI4F8 (uint32 v) stdcall__;
-double __stdcall convI4F8 (uint32 v) {
- return (double)(int32)v; }
+double __stdcall convI4F8 (U_32 v) stdcall__;
+double __stdcall convI4F8 (U_32 v) {
+ return (double)(I_32)v; }
-float __stdcall convI4F4 (uint32 v) stdcall__;
-float __stdcall convI4F4 (uint32 v) { return (float)(int32)v; }
+float __stdcall convI4F4 (U_32 v) stdcall__;
+float __stdcall convI4F4 (U_32 v) { return (float)(I_32)v; }
double __stdcall convI8F8 (uint64 v) stdcall__;
double __stdcall convI8F8 (uint64 v) { return (double)(int64)v; }
@@ -198,27 +198,27 @@
return jitrino_ieee754_fmod_double(v0,v1);
}
-void __stdcall initialize_array(uint8* array, uint32 elems_offset, uint8* data, uint32 num_elems) stdcall__;
-void __stdcall initialize_array(uint8* array, uint32 elems_offset, uint8* data, uint32 num_elems) {
+void __stdcall initialize_array(uint8* array, U_32 elems_offset, uint8* data, U_32 num_elems) stdcall__;
+void __stdcall initialize_array(uint8* array, U_32 elems_offset, uint8* data, U_32 num_elems) {
uint8* array_data = array + elems_offset;
- for (uint32 i = 0; i < num_elems; i++) {
+ for (U_32 i = 0; i < num_elems; i++) {
array_data[i] = data[i];
}
}
-void __stdcall add_value_profile_value(EM_ProfileAccessInterface* profileAccessInterface, Method_Profile_Handle mpHandle, uint32 index, POINTER_SIZE_INT value) stdcall__;
-void __stdcall add_value_profile_value(EM_ProfileAccessInterface* profileAccessInterface, Method_Profile_Handle mpHandle, uint32 index, POINTER_SIZE_INT value) {
+void __stdcall add_value_profile_value(EM_ProfileAccessInterface* profileAccessInterface, Method_Profile_Handle mpHandle, U_32 index, POINTER_SIZE_INT value) stdcall__;
+void __stdcall add_value_profile_value(EM_ProfileAccessInterface* profileAccessInterface, Method_Profile_Handle mpHandle, U_32 index, POINTER_SIZE_INT value) {
profileAccessInterface->value_profiler_add_value(mpHandle, index, value);
}
-void __stdcall fill_array_with_const(uint32 copyOp, uint32 arrayRef, uint32 arrayBound, uint32 baseOp) {
+void __stdcall fill_array_with_const(U_32 copyOp, U_32 arrayRef, U_32 arrayBound, U_32 baseOp) {
Jitrino::crash("Illegal internal helper was called.\n Please enable cg_fastArrayFill optimization in the code generator path");
assert(0);
return;
}
//_______________________________________________________________________________________________________________
-uint32 InstCodeSelector::_tauUnsafe;
+U_32 InstCodeSelector::_tauUnsafe;
//_______________________________________________________________________________________________________________
void InstCodeSelector::onCFGInit(IRManager& irManager)
@@ -319,7 +319,7 @@
//_______________________________________________________________________________________________________________
-void InstCodeSelector::throwLinkingException(Class_Handle encClass, uint32 cp_ndx, uint32 opcode)
+void InstCodeSelector::throwLinkingException(Class_Handle encClass, U_32 cp_ndx, U_32 opcode)
{
Opnd* encClassArg = irManager.newImmOpnd(getRuntimeIdType(), (POINTER_SIZE_INT)encClass);
Opnd* cpIndexArg = irManager.newImmOpnd(typeManager.getUInt32Type(),cp_ndx);
@@ -1204,7 +1204,7 @@
CG_OpndHandle* InstCodeSelector::shladd(IntegerOp::Types opType,
CG_OpndHandle* value,
- uint32 imm,
+ U_32 imm,
CG_OpndHandle* addto)
{
Opnd * shiftDest = (Opnd *)shl(opType, value, irManager.newImmOpnd(typeManager.getUInt8Type(), imm));
@@ -1426,7 +1426,7 @@
assert(0); // not supposed to be used on ia32
#endif
Opnd* heapBaseOpnd = NULL;
- if((POINTER_SIZE_INT)heapBase == (uint32)heapBase) { // heap base fits into 32 bits
+ if((POINTER_SIZE_INT)heapBase == (U_32)heapBase) { // heap base fits into 32 bits
heapBaseOpnd = irManager.newImmOpnd(type, heapBase);
} else { // heapBase can not be an immediate at comparison
heapBaseOpnd = irManager.newOpnd(type);
@@ -1462,7 +1462,7 @@
//_______________________________________________________________________________________________________________
// Switch: generate compare and branch to the default case.
-void InstCodeSelector::tableSwitch(CG_OpndHandle* src, uint32 nTargets)
+void InstCodeSelector::tableSwitch(CG_OpndHandle* src, U_32 nTargets)
{
switchSrcOpnd=(Opnd*)src;
switchNumTargets=nTargets;
@@ -1473,7 +1473,7 @@
// Generate instructions for switch dispatch
// SwitchTableInst should be the first inst in the block.
-void InstCodeSelector::genSwitchDispatch(uint32 numTargets, Opnd *switchSrc)
+void InstCodeSelector::genSwitchDispatch(U_32 numTargets, Opnd *switchSrc)
{
#ifdef _EM64T_
Opnd * opnd = irManager.newOpnd(typeManager.getUInt64Type());
@@ -1582,7 +1582,7 @@
//_______________________________________________________________________________________________________________
// Load 32-bit integer constant
-CG_OpndHandle* InstCodeSelector::ldc_i4(int32 val)
+CG_OpndHandle* InstCodeSelector::ldc_i4(I_32 val)
{
return irManager.newImmOpnd(typeManager.getInt32Type(), val);
}
@@ -1824,7 +1824,7 @@
Opnd* InstCodeSelector::addOffset(Opnd * addr,
Opnd * base,
- uint32 offset)
+ U_32 offset)
{
ICS_ASSERT(0);
return 0;
@@ -1986,7 +1986,7 @@
Type * offType = typeManager.getInt32Type();
#endif
- uint32 elemSize = 0;
+ U_32 elemSize = 0;
if (elemType->isReference()
&& Type::isCompressedReference(elemType->tag, compilationInterface)
&& !elemType->isCompressedReference()) {
@@ -2032,7 +2032,7 @@
PtrType * ptrType=type->asPtrType();
Type * elemType = ptrType->getPointedToType();
- uint32 elemSize=getByteSize(irManager.getTypeSize(elemType));
+ U_32 elemSize=getByteSize(irManager.getTypeSize(elemType));
Type * indexType =
#ifdef _EM64T_
@@ -2264,7 +2264,7 @@
//_______________________________________________________________________________________________________________
// Load variable address
-CG_OpndHandle* InstCodeSelector::ldVarAddr(uint32 varId)
+CG_OpndHandle* InstCodeSelector::ldVarAddr(U_32 varId)
{
ICS_ASSERT(0);
return 0;
@@ -2273,7 +2273,7 @@
//_______________________________________________________________________________________________________________
// Load variable
-CG_OpndHandle * InstCodeSelector::ldVar(Type* dstType, uint32 varId)
+CG_OpndHandle * InstCodeSelector::ldVar(Type* dstType, U_32 varId)
{
if (dstType->tag==Type::Tau)
return getTauUnsafe();
@@ -2285,7 +2285,7 @@
//_______________________________________________________________________________________________________________
// Store variable
-void InstCodeSelector::stVar(CG_OpndHandle* src, uint32 varId)
+void InstCodeSelector::stVar(CG_OpndHandle* src, U_32 varId)
{
if (src==getTauUnsafe())
return;
@@ -2331,16 +2331,16 @@
//_______________________________________________________________________________________________________________
// Create multidimentional new array
-// Call Helper_NewMultiArray(arrayTypeRuntimeId, numDims, uint32 dimN, ...,uint32 dim1)
+// Call Helper_NewMultiArray(arrayTypeRuntimeId, numDims, U_32 dimN, ...,U_32 dim1)
CG_OpndHandle* InstCodeSelector::newMultiArray(ArrayType* arrayType,
- uint32 numDims,
+ U_32 numDims,
CG_OpndHandle** dims)
{
Opnd ** helperOpnds = new (memManager) Opnd * [2+numDims];
helperOpnds[0]=irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, arrayType);
helperOpnds[1]=irManager.newImmOpnd(typeManager.getInt32Type(), numDims);
- for (uint32 i = 0; i < numDims; i++)
+ for (U_32 i = 0; i < numDims; i++)
helperOpnds[i + 2] = (Opnd*)dims[numDims - 1 - i];
Opnd * retOpnd=irManager.newOpnd(arrayType);
CallInst * callInst=irManager.newRuntimeHelperCallInst(
@@ -2355,7 +2355,7 @@
CG_OpndHandle* InstCodeSelector::ldRef(Type *dstType,
MethodDesc* enclosingMethod,
- uint32 refToken,
+ U_32 refToken,
bool uncompress)
{
assert(dstType->isSystemString() || dstType->isSystemClass());
@@ -2432,7 +2432,7 @@
//_______________________________________________________________________________________________________________
// Load token
-CG_OpndHandle * InstCodeSelector::ldToken(Type *dstType,MethodDesc* enclosingMethod,uint32 token)
+CG_OpndHandle * InstCodeSelector::ldToken(Type *dstType,MethodDesc* enclosingMethod,U_32 token)
{
ICS_ASSERT(0);
return 0;
@@ -2441,12 +2441,12 @@
//_______________________________________________________________________________________________________________
// Increment counter for the program instrumentation
-void InstCodeSelector::incCounter(Type *counterType,uint32 key)
+void InstCodeSelector::incCounter(Type *counterType,U_32 key)
{
assert( counterType->isUInt4() );
EdgeMethodProfile* edgeProfile = this->codeSelector.methodCodeSelector.edgeProfile;
assert(edgeProfile!=NULL);
- uint32* ptr = key == 0 ? edgeProfile->getEntryCounter() : edgeProfile->getCounter(key );
+ U_32* ptr = key == 0 ? edgeProfile->getEntryCounter() : edgeProfile->getCounter(key );
assert( ptr != NULL /*&& *ptr == 0 if compilation is locked*/);
Opnd* baseOpnd = irManager.newImmOpnd(typeManager.getUnmanagedPtrType(typeManager.getUIntPtrType()), (POINTER_SIZE_INT)ptr);
Opnd* memOpnd = irManager.newMemOpnd(typeManager.getUIntPtrType(), MemOpndKind_Heap, baseOpnd, NULL, NULL, NULL);
@@ -2508,7 +2508,7 @@
//_______________________________________________________________________________________________________________
// Define an argument
-CG_OpndHandle* InstCodeSelector::defArg(uint32 position, Type *type)
+CG_OpndHandle* InstCodeSelector::defArg(U_32 position, Type *type)
{
return irManager.defArg(type, position);
}
@@ -2598,7 +2598,7 @@
//_______________________________________________________________________________________________________________
// Indirect call w/o a tau that indicates that first argument is non-null
-CG_OpndHandle* InstCodeSelector::calli(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::calli(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
CG_OpndHandle* methodPtr)
@@ -2609,7 +2609,7 @@
//_______________________________________________________________________________________________________________
// Indirect call with the tau that indicates that first argument is non-null
-CG_OpndHandle* InstCodeSelector::tau_calli(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::tau_calli(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
CG_OpndHandle* methodPtr,
@@ -2628,7 +2628,7 @@
// either expand direct call into loading method address into a register and
// indirect call or true direct call that will be patched if method is recompiled.
-CG_OpndHandle* InstCodeSelector::call(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::call(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
MethodDesc * desc)
@@ -2641,7 +2641,7 @@
// either expand direct call into loading method address into a register and
// indirect call or true direct call that will be patched if method is recompiled.
-CG_OpndHandle* InstCodeSelector::tau_call(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::tau_call(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
MethodDesc * desc,
@@ -2666,7 +2666,7 @@
// Virtual call.
// 'this' reference is in args[0]
-CG_OpndHandle* InstCodeSelector::tau_callvirt(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::tau_callvirt(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
MethodDesc * desc,
@@ -2690,7 +2690,7 @@
//_______________________________________________________________________________________________________________
// JIT helper call
-CG_OpndHandle* InstCodeSelector::callhelper(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::callhelper(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
JitHelperCallOp::Id callId)
@@ -2763,7 +2763,7 @@
Type* int32type = typeManager.getInt32Type();
Type* unmanPtr = typeManager.getUnmanagedPtrType(int32type);
Opnd * tlsBase = createTlsBaseLoadSequence(irManager, currentBasicBlock, unmanPtr);
- uint32 offsetInTLS = VMInterface::flagTLSThreadStateOffset();
+ U_32 offsetInTLS = VMInterface::flagTLSThreadStateOffset();
Opnd* pStateFlag = irManager.newMemOpnd(int32type, MemOpndKind_Any, tlsBase, offsetInTLS);
Inst* ii = irManager.newCopyPseudoInst(Mnemonic_MOV, pStateFlag, (Opnd*)args[0]);
appendInsts(ii);
@@ -2776,7 +2776,7 @@
Type* unmanPtr = typeManager.getUnmanagedPtrType(int32type);
Opnd * tlsBase = createTlsBaseLoadSequence(irManager, currentBasicBlock, unmanPtr);
- uint32 offsetInTLS = VMInterface::flagTLSThreadStateOffset();
+ U_32 offsetInTLS = VMInterface::flagTLSThreadStateOffset();
Opnd* pStateFlag = irManager.newMemOpnd(int32type, MemOpndKind_Any, tlsBase, offsetInTLS);
Inst* ii = irManager.newCopyPseudoInst(Mnemonic_MOV, dstOpnd, pStateFlag);
appendInsts(ii);
@@ -2820,7 +2820,7 @@
assert(numArgs == 2);
Opnd* empiOpnd = irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_EM_ProfileAccessInterface);
Opnd* mphOpnd = irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_Method_Value_Profile_Handle);
- const uint32 nArgs = 4;
+ const U_32 nArgs = 4;
Opnd* newArgs[4] = {empiOpnd, mphOpnd, ((Opnd **)args)[0], ((Opnd **)args)[1]};
appendInsts(irManager.newInternalRuntimeHelperCallInst("add_value_profile_value", nArgs, newArgs, dstOpnd));
break;
@@ -2881,7 +2881,7 @@
//_______________________________________________________________________________________________________________
// VM helper call
-CG_OpndHandle* InstCodeSelector::callvmhelper(uint32 numArgs,
+CG_OpndHandle* InstCodeSelector::callvmhelper(U_32 numArgs,
CG_OpndHandle** args,
Type* retType,
VM_RT_SUPPORT callId)
@@ -2896,7 +2896,7 @@
hlpArgs[0] = irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId,
md->getParentType());
- for (uint32 i = 0; i < numArgs-1; i++)
+ for (U_32 i = 0; i < numArgs-1; i++)
hlpArgs[i+1] = (Opnd*)args[i+1];
hlpArgs[numArgs] = irManager.newImmOpnd(getRuntimeIdType(),
Opnd::RuntimeInfo::Kind_MethodRuntimeId, md);
@@ -3260,7 +3260,7 @@
//_______________________________________________________________________________________________________________
// And several tau operands
-CG_OpndHandle* InstCodeSelector::tauAnd(uint32 numArgs, CG_OpndHandle** args)
+CG_OpndHandle* InstCodeSelector::tauAnd(U_32 numArgs, CG_OpndHandle** args)
{
return getTauUnsafe();
}
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h Thu May 22 06:33:38 2008
@@ -43,7 +43,7 @@
*/
class InstCodeSelector : public InstructionCallback {
public:
- virtual void throwLinkingException(Class_Handle encClass, uint32 cp_ndx, uint32 opcode);
+ virtual void throwLinkingException(Class_Handle encClass, U_32 cp_ndx, U_32 opcode);
static void onCFGInit(IRManager& irManager);
@@ -60,7 +60,7 @@
//
virtual CG_OpndHandle* tauPoint(); // tied to control flow reaching this point
virtual CG_OpndHandle* tauEdge(); // tied to previous branch
- virtual CG_OpndHandle* tauAnd(uint32 numArgs, CG_OpndHandle** args);
+ virtual CG_OpndHandle* tauAnd(U_32 numArgs, CG_OpndHandle** args);
virtual CG_OpndHandle* tauUnsafe(); // no dependence info; operation may depend on any branch
virtual CG_OpndHandle* tauSafe(); // operation is always safe
@@ -92,7 +92,7 @@
CG_OpndHandle* xor_(IntegerOp::Types,CG_OpndHandle* src1,CG_OpndHandle* src2);
CG_OpndHandle* not_(IntegerOp::Types,CG_OpndHandle* src);
CG_OpndHandle* shladd(IntegerOp::Types,CG_OpndHandle* value,
- uint32 shiftAmount, CG_OpndHandle* addto);
+ U_32 shiftAmount, CG_OpndHandle* addto);
CG_OpndHandle* shl(IntegerOp::Types,CG_OpndHandle* value,CG_OpndHandle* shiftAmount);
CG_OpndHandle* shr(IntegerOp::Types,CG_OpndHandle* value,CG_OpndHandle* shiftAmount);
CG_OpndHandle* shru(IntegerOp::Types,CG_OpndHandle* value,CG_OpndHandle* shiftAmount);
@@ -106,7 +106,7 @@
void jump() { // do nothing
}
- void tableSwitch(CG_OpndHandle* src, uint32 nTargets);
+ void tableSwitch(CG_OpndHandle* src, U_32 nTargets);
void throwException(CG_OpndHandle* exceptionObj, bool createStackTrace);
void throwSystemException(CompilationInterface::SystemExceptionId);
CG_OpndHandle* convToInt(ConvertToIntOp::Types,bool isSigned, bool isZeroExtend,
@@ -119,7 +119,7 @@
CG_OpndHandle* convToUPtr(PtrType * dstType, CG_OpndHandle* src);
- CG_OpndHandle* ldc_i4(int32 val);
+ CG_OpndHandle* ldc_i4(I_32 val);
CG_OpndHandle* ldc_i8(int64 val);
CG_OpndHandle* ldc_s(float val);
CG_OpndHandle* ldc_d(double val);
@@ -167,8 +167,8 @@
CG_OpndHandle* tau_ldElem(Type *dstType, CG_OpndHandle* array, CG_OpndHandle* index,
bool autoUncompressRef,
CG_OpndHandle* tauBaseNonNull, CG_OpndHandle* tauIdxIsInBounds);
- CG_OpndHandle* ldVarAddr(uint32 varId);
- CG_OpndHandle* ldVar(Type* dstType, uint32 varId);
+ CG_OpndHandle* ldVarAddr(U_32 varId);
+ CG_OpndHandle* ldVar(Type* dstType, U_32 varId);
CG_OpndHandle* tau_arrayLen(Type* dstType,ArrayType* arrayType, Type* lenType, CG_OpndHandle* base,
CG_OpndHandle* tauArrayNonNull, CG_OpndHandle* tauIsArray);
void tau_stInd(CG_OpndHandle* src, CG_OpndHandle* ptr, Type::Tag memType,
@@ -187,36 +187,36 @@
bool autoCompressRef, CG_OpndHandle* tauBaseNonNull,
CG_OpndHandle* tauAddressInRange, CG_OpndHandle* tauElemTypeChecked);
- void stVar(CG_OpndHandle* src, uint32 varId);
+ void stVar(CG_OpndHandle* src, U_32 varId);
CG_OpndHandle* newObj(ObjectType* objType);
CG_OpndHandle* newArray(ArrayType* arrayType, CG_OpndHandle* numElems);
- CG_OpndHandle* newMultiArray(ArrayType* arrayType, uint32 numDims, CG_OpndHandle** dims);
- CG_OpndHandle* ldRef(Type *dstType, MethodDesc* enclosingMethod,uint32 stringToken, bool uncompress);
- CG_OpndHandle* ldToken(Type *dstType,MethodDesc* enclosingMethod,uint32 token);
+ CG_OpndHandle* newMultiArray(ArrayType* arrayType, U_32 numDims, CG_OpndHandle** dims);
+ CG_OpndHandle* ldRef(Type *dstType, MethodDesc* enclosingMethod,U_32 stringToken, bool uncompress);
+ CG_OpndHandle* ldToken(Type *dstType,MethodDesc* enclosingMethod,U_32 token);
- void incCounter(Type *counterType,uint32 counter);
+ void incCounter(Type *counterType,U_32 counter);
void ret();
void ret(CG_OpndHandle* returnValue);
- CG_OpndHandle* defArg(uint32 position, Type *type);
+ CG_OpndHandle* defArg(U_32 position, Type *type);
CG_OpndHandle* ldFunAddr(Type* dstType, MethodDesc *desc);
CG_OpndHandle* tau_ldVirtFunAddr(Type* dstType, CG_OpndHandle* vtableAddr,
MethodDesc *desc, CG_OpndHandle *tauVtableHasDesc);
CG_OpndHandle* tau_ldVTableAddr(Type *dstType, CG_OpndHandle* base, CG_OpndHandle *tauBaseNonNull);
CG_OpndHandle* getVTableAddr(Type *dstType, ObjectType *base);
CG_OpndHandle* tau_ldIntfTableAddr(Type *dstType, CG_OpndHandle* base,NamedType* vtableTypeDesc);
- CG_OpndHandle* calli(uint32 numArgs,CG_OpndHandle** args, Type* retType,
+ CG_OpndHandle* calli(U_32 numArgs,CG_OpndHandle** args, Type* retType,
CG_OpndHandle* methodPtr);
- CG_OpndHandle* tau_calli(uint32 numArgs,CG_OpndHandle** args, Type* retType,
+ CG_OpndHandle* tau_calli(U_32 numArgs,CG_OpndHandle** args, Type* retType,
CG_OpndHandle* methodPtr, CG_OpndHandle* nonNullFirstArgTau,
CG_OpndHandle* tauTypesChecked);
- CG_OpndHandle* call(uint32 numArgs, CG_OpndHandle** args, Type* retType, MethodDesc *desc);
- CG_OpndHandle* tau_call(uint32 numArgs, CG_OpndHandle** args, Type* retType,
+ CG_OpndHandle* call(U_32 numArgs, CG_OpndHandle** args, Type* retType, MethodDesc *desc);
+ CG_OpndHandle* tau_call(U_32 numArgs, CG_OpndHandle** args, Type* retType,
MethodDesc *desc, CG_OpndHandle *nonNullFirstArgTau,
CG_OpndHandle *tauTypesChecked);
- CG_OpndHandle* tau_callvirt(uint32 numArgs,CG_OpndHandle** args, Type* retType, MethodDesc *desc, CG_OpndHandle* tauNullChecked, CG_OpndHandle* tauTypesChecked);
- CG_OpndHandle* callhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType,JitHelperCallOp::Id callId);
- CG_OpndHandle* callvmhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType,
+ CG_OpndHandle* tau_callvirt(U_32 numArgs,CG_OpndHandle** args, Type* retType, MethodDesc *desc, CG_OpndHandle* tauNullChecked, CG_OpndHandle* tauTypesChecked);
+ CG_OpndHandle* callhelper(U_32 numArgs, CG_OpndHandle** args, Type* retType,JitHelperCallOp::Id callId);
+ CG_OpndHandle* callvmhelper(U_32 numArgs, CG_OpndHandle** args, Type* retType,
VM_RT_SUPPORT callId);
CG_OpndHandle* box(ObjectType * boxedType, CG_OpndHandle* val);
@@ -275,9 +275,9 @@
//
// Additional instruction selection methods
//
- void genSwitchDispatch(uint32 numTargets,Opnd *switchSrc);
+ void genSwitchDispatch(U_32 numTargets,Opnd *switchSrc);
void genReturn();
- CG_OpndHandle* runtimeHelperCall(uint32 numArgs, CG_OpndHandle** args,
+ CG_OpndHandle* runtimeHelperCall(U_32 numArgs, CG_OpndHandle** args,
Type *retType,
VM_RT_SUPPORT helper,
Type *typeArgument,
@@ -293,7 +293,7 @@
assert(switchSrcOpnd != NULL);
return switchSrcOpnd;
}
- uint32 getSwitchNumTargets() {
+ U_32 getSwitchNumTargets() {
assert(switchNumTargets > 0);
return switchNumTargets;
}
@@ -363,15 +363,15 @@
Opnd * zxtInt32(Opnd *opnd);
void sxtOneInt32(Opnd*& opnd1, Opnd*& opnd2);
void zxtOneInt32(Opnd*& opnd1, Opnd*& opnd2);
- bool opndIsFoldableImm(Opnd * opnd, uint32 nbits,
- int32& imm);
+ bool opndIsFoldableImm(Opnd * opnd, U_32 nbits,
+ I_32& imm);
Opnd * doSetf(Opnd * opnd);
Type * divOpType(DivOp::Types op);
Type * integerOpType(IntegerOp::Types opType);
- Opnd * addOffset(Opnd * addr, Opnd * base, uint32 offset);
- Opnd* buildOffset(uint32 offset, MemoryAttribute::Context context);
- Opnd* buildOffsetPlusHeapbase(uint32 offset, MemoryAttribute::Context context);
- Opnd* addVtableBaseAndOffset(Opnd *addr, CG_OpndHandle* compPtr, uint32 offset);
+ Opnd * addOffset(Opnd * addr, Opnd * base, U_32 offset);
+ Opnd* buildOffset(U_32 offset, MemoryAttribute::Context context);
+ Opnd* buildOffsetPlusHeapbase(U_32 offset, MemoryAttribute::Context context);
+ Opnd* addVtableBaseAndOffset(Opnd *addr, CG_OpndHandle* compPtr, U_32 offset);
void simpleMemCopy(Opnd *dst, Opnd *src, OpndSize size,
Opnd *dstBaseTau, Opnd *dstOffsetTau,
Opnd *srcBaseTau, Opnd *srcOffsetTau);
@@ -386,8 +386,8 @@
bool autoCompressRef, Opnd *baseTau, Opnd *offsetAndTypeTau);
Type * getFieldRefType(Type *dstType, Type::Tag memType);
void simplifyTypeTag(Type::Tag& tag,Type *ptr);
- Opnd ** createReturnArray(Type * retType, uint32& numRegRet);
- void assignCallArgs(CallInst *call, uint32 numArgs, CG_OpndHandle **args,
+ Opnd ** createReturnArray(Type * retType, U_32& numRegRet);
+ void assignCallArgs(CallInst *call, U_32 numArgs, CG_OpndHandle **args,
Type *retType, bool isHelperCall);
CG_OpndHandle* assignCallRet(CallInst *call, Type *retType, bool isHelperCall);
Opnd * doInt32Divide(Opnd * fA, Opnd * fB);
@@ -411,7 +411,7 @@
SyncFenceFlag_EnforceEnterFence = 0x1,
SyncFenceFlag_EnforceExitFence = 0x2
};
- uint32 getSyncFenceFlag();
+ U_32 getSyncFenceFlag();
//
// Set/clear current predicate operand to be assigned to the generated instructions
//
@@ -436,20 +436,20 @@
MemoryManager memManager; // for local data
Node* currentBasicBlock;
Opnd ** vars;
- uint32 inArgPos;
+ U_32 inArgPos;
int persistentId;
#ifdef _DEBUG
- uint32 nextInArg;
+ U_32 nextInArg;
#endif
bool seenReturn;
Opnd * switchSrcOpnd;
- uint32 switchNumTargets;
+ U_32 switchNumTargets;
PersistentInstructionId currPersistentId;
Opnd * currPredOpnd;
static VM_RT_SUPPORT
divOpHelperIds[],
remOpHelperIds[];
- static uint32 _tauUnsafe;
+ static U_32 _tauUnsafe;
};
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp Thu May 22 06:33:38 2008
@@ -31,7 +31,7 @@
struct BBStats {
int64 * bbExecCount;
- uint32 * counters;
+ U_32 * counters;
BBStats() : bbExecCount(NULL), counters(NULL) {}
};
@@ -90,7 +90,7 @@
bool isOR;
FilterAttr<Mnemonic> mnemonic;
- FilterAttr<int32> operandNumber;
+ FilterAttr<I_32> operandNumber;
FilterAttr<Opnd::RuntimeInfo::Kind> rtKind;
FilterAttr<VM_RT_SUPPORT> rtHelperID;
FilterAttr<std::string> rtIntHelperName;
@@ -262,7 +262,7 @@
bool rc = false;
if (configFile.is_open()) {
std::string line;
- uint32 ln = 0;
+ U_32 ln = 0;
bool opened = false;
int num = -1;
while (std::getline(configFile, line)) {
@@ -289,7 +289,7 @@
config->counters[num].filter.isOR=true;
} else if ((int)line.find(std::string(config->counters[num].name)+"=")!=-1) {
char * val = (char *)std::strstr(line.c_str(),"=")+1;
- for(uint32 i = 0; i < config->counters.size(); i++) {
+ for(U_32 i = 0; i < config->counters.size(); i++) {
if(std::string(config->counters[i].name) == val) {
config->counters[num].filter = config->counters[i].filter;
break;
@@ -330,7 +330,7 @@
} else {
config->counters[num].filter.isInitialized=true;
config->counters[num].filter.operandFilters[opNum].opndRole.isInitialized=true;
- for (uint32 i = 0; i<lengthof(opndRoles); i++) {
+ for (U_32 i = 0; i<lengthof(opndRoles); i++) {
if(std::string(opndRoles[i].name) == val)
config->counters[num].filter.operandFilters[opNum].opndRole.value=opndRoles[i].value;
}
@@ -357,7 +357,7 @@
} else {
config->counters[num].filter.isInitialized=true;
config->counters[num].filter.operandFilters[opNum].memOpndKind.isInitialized=true;
- for (uint32 i = 0; i<lengthof(memOpndKinds); i++) {
+ for (U_32 i = 0; i<lengthof(memOpndKinds); i++) {
if(std::string(memOpndKinds[i].name) == val)
config->counters[num].filter.operandFilters[opNum].memOpndKind.value=memOpndKinds[i].value;
}
@@ -369,7 +369,7 @@
config->counters[num].filter.rtKind.isNegative=true;
} else {
config->counters[num].filter.isInitialized=true;
- for (uint32 i = 0; i<lengthof(rtKinds); i++) {
+ for (U_32 i = 0; i<lengthof(rtKinds); i++) {
if(std::string(rtKinds[i].name) == val)
config->counters[num].filter.rtKind.value=rtKinds[i].value;
}
@@ -529,7 +529,7 @@
fname = "iprof.stat";
std::ofstream outFile(fname, std::ios::ate);
outFile << "Method name\t";
- for(uint32 i = 0; i < config->counters.size(); i++) {
+ for(U_32 i = 0; i < config->counters.size(); i++) {
std::string fName = config->counters[i].title != "" ? config->counters[i].title : config->counters[i].name;
outFile << fName << "\t";
}
@@ -539,7 +539,7 @@
MethodStats * stats = *it;
outFile << stats->methodName.c_str() << "\t";
BBStats bbs = stats->bbStats[-1];
- for(uint32 i = 0; i < config->counters.size(); i++) {
+ for(U_32 i = 0; i < config->counters.size(); i++) {
int64 count;
std::string name = config->counters[i].name;
if((name == "ByteCodeSize") || (name == "ExcHandlersNum")) {
@@ -580,7 +580,7 @@
if(iter->first == -1)
continue;
outFile << "BB_" << iter->first << "_" << stats->methodName.c_str() << "\t";
- for(uint32 i = 0; i < config->counters.size(); i++) {
+ for(U_32 i = 0; i < config->counters.size(); i++) {
int64 outValue = iter->second.counters[i] * (*(iter->second.bbExecCount));
outFile << outValue << "\t";
}
@@ -601,16 +601,16 @@
InternalProfilerAct& storage = *static_cast<InternalProfilerAct*>(getAction());
storage.statistics->push_back(ms);
//method external properties, no need to count
- uint32 cSize = (uint32)storage.config->counters.size();
+ U_32 cSize = (U_32)storage.config->counters.size();
if (!cSize)
return;
- ms->bbStats[-1].counters= new(mm) uint32[cSize];
- for(uint32 i = 0; i < cSize ; i++) {
+ ms->bbStats[-1].counters= new(mm) U_32[cSize];
+ for(U_32 i = 0; i < cSize ; i++) {
ms->bbStats[-1].counters[i] = 0;
}
ms->bbStats[-1].bbExecCount= new(mm) int64[1];
*(ms->bbStats[-1].bbExecCount) = 0;
- for(uint32 i = 0; i < cSize ; i++) {
+ for(U_32 i = 0; i < cSize ; i++) {
Counter c = storage.config->counters[i];
if(c.name == std::string("ByteCodeSize")) {
ms->bbStats[-1].bbExecCount= new(mm) int64[1];
@@ -628,13 +628,13 @@
for (Nodes::const_iterator it = nodes.begin(),end = nodes.end();it!=end; ++it) {
Node* node = *it;
if (node->isBlockNode()){
- ms->bbStats[node->getId()].counters= new(mm) uint32[cSize];
- for(uint32 i = 0; i < cSize ; i++) {
+ ms->bbStats[node->getId()].counters= new(mm) U_32[cSize];
+ for(U_32 i = 0; i < cSize ; i++) {
ms->bbStats[node->getId()].counters[i] = 0;
}
for (Inst * inst=(Inst*)node->getFirstInst(); inst!=NULL; inst=inst->getNextInst()){
if(!inst->hasKind(Inst::Kind_PseudoInst) || inst->hasKind(Inst::Kind_EntryPointPseudoInst)) {
- for(uint32 i = 0; i < cSize ; i++) {
+ for(U_32 i = 0; i < cSize ; i++) {
Counter c = storage.config->counters[i];
if(std::string(c.name) == "MaxBBExec" || std::string(c.name) == "HottestBBNum" || std::string(c.name) == "BBExec" ) {
ms->bbStats[node->getId()].counters[i] =1;
@@ -740,7 +740,7 @@
if(!opndFltr.isInitialized)
continue;
if(opndFltr.opNum == -1) {
- for(uint32 i = 0; i < inst->getOpndCount(Inst::OpndRole_All) ; i++) {
+ for(U_32 i = 0; i < inst->getOpndCount(Inst::OpndRole_All) ; i++) {
Opnd * opnd = inst->getOpnd(i);
res = passOpndFilter(inst, opnd, filter, opndFltr);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp Thu May 22 06:33:38 2008
@@ -49,7 +49,7 @@
static MemoryManager mm("printRuntimeOpndInternalHelper");
static TypeManager *tm = NULL;
-void __stdcall methodEntry(const char * methodName, uint32 argInfoCount, CallingConvention::OpndInfo * argInfos)
+void __stdcall methodEntry(const char * methodName, U_32 argInfoCount, CallingConvention::OpndInfo * argInfos)
{
JitFrameContext context;
@@ -67,18 +67,18 @@
if (tm == NULL) {
tm = new (mm) TypeManager(mm); tm->init();
}
- for (uint32 i=0; i<argInfoCount; i++){
+ for (U_32 i=0; i<argInfoCount; i++){
CallingConvention::OpndInfo & info=argInfos[i];
- uint32 cb=0;
- uint8 arg[4*sizeof(uint32)];
- for (uint32 j=0; j<info.slotCount; j++){
+ U_32 cb=0;
+ uint8 arg[4*sizeof(U_32)];
+ for (U_32 j=0; j<info.slotCount; j++){
if (!info.isReg){
#ifdef _EM64T_
*(POINTER_SIZE_INT*)(arg+cb)=((POINTER_SIZE_INT*)context.rsp)[info.slots[j]];
#else
- *(uint32*)(arg+cb)=((uint32*)context.esp)[info.slots[j]];
+ *(U_32*)(arg+cb)=((U_32*)context.esp)[info.slots[j]];
#endif
- cb+=sizeof(uint32);
+ cb+=sizeof(U_32);
}else{
m_assert(info.isReg);
m_assert(0);
@@ -136,7 +136,7 @@
EntryPointPseudoInst * entryPointPseudoInst = (EntryPointPseudoInst *)inst;
entryPointPseudoInst->getCallingConventionClient().finalizeInfos(Inst::OpndRole_Def, CallingConvention::ArgKind_InArg);
const StlVector<CallingConvention::OpndInfo> & infos=((const EntryPointPseudoInst *)entryPointPseudoInst)->getCallingConventionClient().getInfos(Inst::OpndRole_Def);
- Opnd * argInfoOpnd=irManager->newBinaryConstantImmOpnd((uint32)infos.size()*sizeof(CallingConvention::OpndInfo), &infos.front());
+ Opnd * argInfoOpnd=irManager->newBinaryConstantImmOpnd((U_32)infos.size()*sizeof(CallingConvention::OpndInfo), &infos.front());
Opnd * args[3]={ methodNameOpnd,
irManager->newImmOpnd(irManager->getTypeManager().getInt32Type(), infos.size()),
argInfoOpnd,
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.h?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.h Thu May 22 06:33:38 2008
@@ -41,7 +41,7 @@
};
void __stdcall methodExit(const char * methodName) stdcall__;
-void __stdcall methodEntry(const char * methodName, uint32 argInfoCount, CallingConvention::OpndInfo * argInfos) stdcall__;
+void __stdcall methodEntry(const char * methodName, U_32 argInfoCount, CallingConvention::OpndInfo * argInfos) stdcall__;
void __stdcall fieldWrite(const void * address) stdcall__;
}}; // namespace Ia32
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32LightJNI.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32LightJNI.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32LightJNI.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32LightJNI.cpp Thu May 22 06:33:38 2008
@@ -47,7 +47,7 @@
class LightJNISession : public SessionAction {
protected:
void runImpl();
- uint32 getSideEffects()const{ return 0; }
+ U_32 getSideEffects()const{ return 0; }
const char* getName() { return "light_jni"; }
bool isInOptimizationTable(Method_Table* table, MethodDesc* mmd);
void derefIfObject(CallInst* callInst, Opnd* origRetOpnd);
@@ -211,7 +211,7 @@
void* tmpPoint = md->getNativeAddress();
Opnd* tmpZero = lirm->newImmOpnd(lirm->getTypeManager().getIntPtrType(), 0);
- uint32 tmpNumArgs = callInst->getOpndCount();
+ U_32 tmpNumArgs = callInst->getOpndCount();
CallInst* newCallInst = NULL;
Opnd* origRetOpnd = callInst->getOpnd(0);
//const char* mmthName = md->getName();
@@ -225,7 +225,7 @@
Opnd* newTargetOpnd = lirm->newImmOpnd(tm.getIntPtrType(), ((POINTER_SIZE_INT)tmpPoint));
tmpOpnds[0] = tmpZero;
- for (uint32 i = 2; i<tmpNumArgs; i++) {
+ for (U_32 i = 2; i<tmpNumArgs; i++) {
tmpOpnds[i-1] = callInst->getOpnd(i);
}
newCallInst = lirm->newCallInst(newTargetOpnd, &CallingConvention_STDCALL, tmpNumArgs - 1, tmpOpnds, newRetOpnd);
@@ -236,7 +236,7 @@
Opnd* tmpClassName = lirm->newImmOpnd(tm.getIntPtrType(), (POINTER_SIZE_INT)(md->getParentHandle()));
tmpOpnds[0] = tmpZero;
tmpOpnds[1] = tmpClassName;
- for (uint32 i = 2; i<tmpNumArgs; i++){
+ for (U_32 i = 2; i<tmpNumArgs; i++){
tmpOpnds[i] = callInst->getOpnd(i);
}
newCallInst = lirm->newCallInst(newTargetOpnd, &CallingConvention_STDCALL, tmpNumArgs, tmpOpnds, newRetOpnd);
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp?rev=659108&r1=659107&r2=659108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp Thu May 22 06:33:38 2008
@@ -48,9 +48,9 @@
{
private:
// Virtuals
- uint32 getSideEffects(void) const
+ U_32 getSideEffects(void) const
{
- return m_bHadAnyChange ? (uint32)-1 : 0;
+ return m_bHadAnyChange ? (U_32)-1 : 0;
}
private:
enum Changed {
@@ -400,8 +400,8 @@
return Changed_Node;
}
-static int getMinBit(uint32 val) {
- uint32 currentVal = val;
+static int getMinBit(U_32 val) {
+ U_32 currentVal = val;
int i=0;
do {
if ((currentVal & 1)) {
@@ -412,8 +412,8 @@
return i;
}
-static int getMaxBit(uint32 val) {
- uint32 currentVal = val;
+static int getMaxBit(U_32 val) {
+ U_32 currentVal = val;
int i=31;
do {
if ((currentVal & (1<<31))) {