return instructionInfo style

This commit is contained in:
Dimitry
2016-04-04 15:27:09 +04:00
parent 9816510065
commit d43d4347bf
11 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -121,7 +121,7 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con
switch (i.type())
{
case Operation:
_out << " " << getInstructionInfo(i.instruction()).name << "\t" << i.getJumpTypeAsString();
_out << " " << instructionInfo(i.instruction()).name << "\t" << i.getJumpTypeAsString();
break;
case Push:
_out << " PUSH " << hex << i.data();
@@ -205,7 +205,7 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes
{
case Operation:
collection.append(
createJsonValue(getInstructionInfo(i.instruction()).name, i.location().start, i.location().end, i.getJumpTypeAsString()));
createJsonValue(instructionInfo(i.instruction()).name, i.location().start, i.location().end, i.getJumpTypeAsString()));
break;
case Push:
collection.append(
+2 -2
View File
@@ -57,7 +57,7 @@ int AssemblyItem::deposit() const
switch (m_type)
{
case Operation:
return getInstructionInfo(instruction()).ret - getInstructionInfo(instruction()).args;
return instructionInfo(instruction()).ret - instructionInfo(instruction()).args;
case Push:
case PushString:
case PushTag:
@@ -93,7 +93,7 @@ ostream& dev::eth::operator<<(ostream& _out, AssemblyItem const& _item)
switch (_item.type())
{
case Operation:
_out << " " << getInstructionInfo(_item.instruction()).name;
_out << " " << instructionInfo(_item.instruction()).name;
if (_item.instruction() == solidity::Instruction::JUMP || _item.instruction() == solidity::Instruction::JUMPI)
_out << "\t" << _item.getJumpTypeAsString();
break;
+2 -2
View File
@@ -399,7 +399,7 @@ void CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced)
m_stack.erase(m_stackHeight - i);
}
appendItem(*expr.item);
if (expr.item->type() != Operation || getInstructionInfo(expr.item->instruction()).ret == 1)
if (expr.item->type() != Operation || instructionInfo(expr.item->instruction()).ret == 1)
{
m_stack[m_stackHeight] = _c;
m_classPositions[_c].insert(m_stackHeight);
@@ -407,7 +407,7 @@ void CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced)
else
{
assertThrow(
getInstructionInfo(expr.item->instruction()).ret == 0,
instructionInfo(expr.item->instruction()).ret == 0,
OptimizerException,
"Invalid number of return values."
);
+1 -1
View File
@@ -435,7 +435,7 @@ string Pattern::toString() const
switch (m_type)
{
case Operation:
s << getInstructionInfo(Instruction(unsigned(m_data))).name;
s << instructionInfo(Instruction(unsigned(m_data))).name;
break;
case Push:
s << "PUSH " << hex << m_data;
+1 -1
View File
@@ -209,7 +209,7 @@ u256 GasMeter::runGas(Instruction _instruction, EVMSchedule const& _es)
if (_instruction == Instruction::JUMPDEST)
return 1;
int tier = getInstructionInfo(_instruction).gasPriceTier;
int tier = instructionInfo(_instruction).gasPriceTier;
assertThrow(tier != InvalidTier, OptimizerException, "Invalid gas tier.");
return _es.tierStepGas[tier];
}
+3 -3
View File
@@ -307,7 +307,7 @@ void dev::solidity::eachInstruction(
Instruction instr = Instruction(*it);
size_t additional = 0;
if (isValidInstruction(instr))
additional = getInstructionInfo(instr).additional;
additional = instructionInfo(instr).additional;
u256 data;
for (size_t i = 0; i < additional; ++i)
{
@@ -327,7 +327,7 @@ string dev::solidity::disassemble(bytes const& _mem)
ret << "0x" << hex << int(_instr) << " ";
else
{
InstructionInfo info = getInstructionInfo(_instr);
InstructionInfo info = instructionInfo(_instr);
ret << info.name << " ";
if (info.additional)
ret << "0x" << hex << _data << " ";
@@ -336,7 +336,7 @@ string dev::solidity::disassemble(bytes const& _mem)
return ret.str();
}
InstructionInfo dev::solidity::getInstructionInfo(Instruction _inst)
InstructionInfo dev::solidity::instructionInfo(Instruction _inst)
{
try
{
+1 -1
View File
@@ -250,7 +250,7 @@ struct InstructionInfo
};
/// Information on all the instructions.
InstructionInfo getInstructionInfo(Instruction _inst);
InstructionInfo instructionInfo(Instruction _inst);
/// check whether instructions exists
bool isValidInstruction(Instruction _inst);
+1 -1
View File
@@ -101,7 +101,7 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool
else
{
Instruction instruction = _item.instruction();
InstructionInfo info = getInstructionInfo(instruction);
InstructionInfo info = instructionInfo(instruction);
if (SemanticInformation::isDupInstruction(_item))
setStackElement(
m_stackHeight + 1,
+1 -1
View File
@@ -53,7 +53,7 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
return true; // GAS and PC assume a specific order of opcodes
if (_item.instruction() == Instruction::MSIZE)
return true; // msize is modified already by memory access, avoid that for now
InstructionInfo info = getInstructionInfo(_item.instruction());
InstructionInfo info = instructionInfo(_item.instruction());
if (_item.instruction() == Instruction::SSTORE)
return false;
if (_item.instruction() == Instruction::MSTORE)