class MachineCodeForMethod : private Annotation {
- const Function* method;
- bool compiledAsLeaf;
+ std::hash_set<const Constant*> constantsForConstPool;
+ std::hash_map<const Value*, int> offsets;
+ const Function* method;
unsigned staticStackSize;
unsigned automaticVarsSize;
unsigned regSpillsSize;
- unsigned currentOptionalArgsSize;
unsigned maxOptionalArgsSize;
+ unsigned maxOptionalNumArgs;
unsigned currentTmpValuesSize;
unsigned maxTmpValuesSize;
- std::hash_set<const Constant*> constantsForConstPool;
- std::hash_map<const Value*, int> offsets;
+ bool compiledAsLeaf;
+ bool spillsAreaFrozen;
+ bool automaticVarsAreaFrozen;
public:
/*ctor*/ MachineCodeForMethod(const Function* function,
inline unsigned getAutomaticVarsSize() const { return automaticVarsSize; }
inline unsigned getRegSpillsSize() const { return regSpillsSize; }
inline unsigned getMaxOptionalArgsSize() const { return maxOptionalArgsSize;}
- inline unsigned getCurrentOptionalArgsSize() const
- { return currentOptionalArgsSize;}
+ inline unsigned getMaxOptionalNumArgs() const { return maxOptionalNumArgs;}
inline const std::hash_set<const Constant*>&
getConstantPoolValues() const {return constantsForConstPool;}
inline void markAsLeafMethod() { compiledAsLeaf = true; }
int computeOffsetforLocalVar (const TargetMachine& target,
- const Value* local,
+ const Value* local,
unsigned int& getPaddedSize,
unsigned int sizeToUse = 0);
-
int allocateLocalVar (const TargetMachine& target,
const Value* local,
unsigned int sizeToUse = 0);
int allocateSpilledValue (const TargetMachine& target,
const Type* type);
- int allocateOptionalArg (const TargetMachine& target,
- const Type* type);
-
- void resetOptionalArgs (const TargetMachine& target);
-
int pushTempValue (const TargetMachine& target,
unsigned int size);
void popAllTempValues (const TargetMachine& target);
+ void freezeSpillsArea () { spillsAreaFrozen = true; }
+ void freezeAutomaticVarsArea () { automaticVarsAreaFrozen=true; }
+
int getOffset (const Value* val) const;
// int getOffsetFromFP (const Value* val) const;
inline void resetTmpAreaSize() {
currentTmpValuesSize = 0;
}
- inline void incrementCurrentOptionalArgsSize(int incr) {
- currentOptionalArgsSize+= incr; // stack size already includes this!
- }
+ int allocateOptionalArg (const TargetMachine& target,
+ const Type* type);
};
#endif
class MachineCodeForMethod : private Annotation {
- const Function* method;
- bool compiledAsLeaf;
+ std::hash_set<const Constant*> constantsForConstPool;
+ std::hash_map<const Value*, int> offsets;
+ const Function* method;
unsigned staticStackSize;
unsigned automaticVarsSize;
unsigned regSpillsSize;
- unsigned currentOptionalArgsSize;
unsigned maxOptionalArgsSize;
+ unsigned maxOptionalNumArgs;
unsigned currentTmpValuesSize;
unsigned maxTmpValuesSize;
- std::hash_set<const Constant*> constantsForConstPool;
- std::hash_map<const Value*, int> offsets;
+ bool compiledAsLeaf;
+ bool spillsAreaFrozen;
+ bool automaticVarsAreaFrozen;
public:
/*ctor*/ MachineCodeForMethod(const Function* function,
inline unsigned getAutomaticVarsSize() const { return automaticVarsSize; }
inline unsigned getRegSpillsSize() const { return regSpillsSize; }
inline unsigned getMaxOptionalArgsSize() const { return maxOptionalArgsSize;}
- inline unsigned getCurrentOptionalArgsSize() const
- { return currentOptionalArgsSize;}
+ inline unsigned getMaxOptionalNumArgs() const { return maxOptionalNumArgs;}
inline const std::hash_set<const Constant*>&
getConstantPoolValues() const {return constantsForConstPool;}
inline void markAsLeafMethod() { compiledAsLeaf = true; }
int computeOffsetforLocalVar (const TargetMachine& target,
- const Value* local,
+ const Value* local,
unsigned int& getPaddedSize,
unsigned int sizeToUse = 0);
-
int allocateLocalVar (const TargetMachine& target,
const Value* local,
unsigned int sizeToUse = 0);
int allocateSpilledValue (const TargetMachine& target,
const Type* type);
- int allocateOptionalArg (const TargetMachine& target,
- const Type* type);
-
- void resetOptionalArgs (const TargetMachine& target);
-
int pushTempValue (const TargetMachine& target,
unsigned int size);
void popAllTempValues (const TargetMachine& target);
+ void freezeSpillsArea () { spillsAreaFrozen = true; }
+ void freezeAutomaticVarsArea () { automaticVarsAreaFrozen=true; }
+
int getOffset (const Value* val) const;
// int getOffsetFromFP (const Value* val) const;
inline void resetTmpAreaSize() {
currentTmpValuesSize = 0;
}
- inline void incrementCurrentOptionalArgsSize(int incr) {
- currentOptionalArgsSize+= incr; // stack size already includes this!
- }
+ int allocateOptionalArg (const TargetMachine& target,
+ const Type* type);
};
#endif