|
|
@ -120,7 +120,7 @@ void Compiler::createBasicBlocks(bytesConstRef bytecode) |
|
|
|
} |
|
|
|
|
|
|
|
// Remove split points generated from jumps out of code or into data.
|
|
|
|
for (auto it = splitPoints.cbegin(); it != splitPoints.cend(); ) |
|
|
|
for (auto it = splitPoints.cbegin(); it != splitPoints.cend();) |
|
|
|
{ |
|
|
|
if (*it > bytecode.size() || !validJumpTargets[*it]) |
|
|
|
it = splitPoints.erase(it); |
|
|
@ -128,7 +128,7 @@ void Compiler::createBasicBlocks(bytesConstRef bytecode) |
|
|
|
++it; |
|
|
|
} |
|
|
|
|
|
|
|
for (auto it = splitPoints.cbegin(); it != splitPoints.cend(); ) |
|
|
|
for (auto it = splitPoints.cbegin(); it != splitPoints.cend();) |
|
|
|
{ |
|
|
|
auto beginInstIdx = *it; |
|
|
|
++it; |
|
|
@ -523,7 +523,7 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode, |
|
|
|
|
|
|
|
case Instruction::ANY_PUSH: |
|
|
|
{ |
|
|
|
auto numBytes = static_cast<size_t>(inst)-static_cast<size_t>(Instruction::PUSH1) + 1; |
|
|
|
auto numBytes = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::PUSH1) + 1; |
|
|
|
auto value = llvm::APInt(256, 0); |
|
|
|
for (decltype(numBytes) i = 0; i < numBytes; ++i) // TODO: Use pc as iterator
|
|
|
|
{ |
|
|
@ -538,14 +538,14 @@ void Compiler::compileBasicBlock(BasicBlock& basicBlock, bytesConstRef bytecode, |
|
|
|
|
|
|
|
case Instruction::ANY_DUP: |
|
|
|
{ |
|
|
|
auto index = static_cast<size_t>(inst)-static_cast<size_t>(Instruction::DUP1); |
|
|
|
auto index = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::DUP1); |
|
|
|
stack.dup(index); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
case Instruction::ANY_SWAP: |
|
|
|
{ |
|
|
|
auto index = static_cast<size_t>(inst)-static_cast<size_t>(Instruction::SWAP1) + 1; |
|
|
|
auto index = static_cast<size_t>(inst) - static_cast<size_t>(Instruction::SWAP1) + 1; |
|
|
|
stack.swap(index); |
|
|
|
break; |
|
|
|
} |
|
|
|