Delete support for 2-arguments opcodes - it was never used

pull/2812/head
fredzio 5 years ago
parent 3b9a51b8ac
commit 916a9641fc

@ -28,22 +28,6 @@ namespace Interpreter
return;
}
case 1:
{
int opcode = (code>>24) & 0x3f;
unsigned int arg0 = (code>>16) & 0xfff;
unsigned int arg1 = code & 0xfff;
std::map<int, Opcode2 *>::iterator iter = mSegment1.find (opcode);
if (iter==mSegment1.end())
abortUnknownCode (1, opcode);
iter->second->execute (mRuntime, arg0, arg1);
return;
}
case 2:
{
int opcode = (code>>20) & 0x3ff;
@ -79,22 +63,6 @@ namespace Interpreter
return;
}
case 0x31:
{
int opcode = (code>>16) & 0x3ff;
unsigned int arg0 = (code>>8) & 0xff;
unsigned int arg1 = code & 0xff;
std::map<int, Opcode2 *>::iterator iter = mSegment4.find (opcode);
if (iter==mSegment4.end())
abortUnknownCode (4, opcode);
iter->second->execute (mRuntime, arg0, arg1);
return;
}
case 0x32:
{
int opcode = code & 0x3ffffff;
@ -161,10 +129,6 @@ namespace Interpreter
iter!=mSegment0.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode2 *>::iterator iter (mSegment1.begin());
iter!=mSegment1.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode1 *>::iterator iter (mSegment2.begin());
iter!=mSegment2.end(); ++iter)
delete iter->second;
@ -173,10 +137,6 @@ namespace Interpreter
iter!=mSegment3.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode2 *>::iterator iter (mSegment4.begin());
iter!=mSegment4.end(); ++iter)
delete iter->second;
for (std::map<int, Opcode0 *>::iterator iter (mSegment5.begin());
iter!=mSegment5.end(); ++iter)
delete iter->second;
@ -188,12 +148,6 @@ namespace Interpreter
mSegment0.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment1 (int code, Opcode2 *opcode)
{
assert(mSegment1.find(code) == mSegment1.end());
mSegment1.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment2 (int code, Opcode1 *opcode)
{
assert(mSegment2.find(code) == mSegment2.end());
@ -206,12 +160,6 @@ namespace Interpreter
mSegment3.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment4 (int code, Opcode2 *opcode)
{
assert(mSegment4.find(code) == mSegment4.end());
mSegment4.insert (std::make_pair (code, opcode));
}
void Interpreter::installSegment5 (int code, Opcode0 *opcode)
{
assert(mSegment5.find(code) == mSegment5.end());

@ -11,7 +11,6 @@ namespace Interpreter
{
class Opcode0;
class Opcode1;
class Opcode2;
class Interpreter
{
@ -19,10 +18,8 @@ namespace Interpreter
bool mRunning;
Runtime mRuntime;
std::map<int, Opcode1 *> mSegment0;
std::map<int, Opcode2 *> mSegment1;
std::map<int, Opcode1 *> mSegment2;
std::map<int, Opcode1 *> mSegment3;
std::map<int, Opcode2 *> mSegment4;
std::map<int, Opcode0 *> mSegment5;
// not implemented
@ -48,18 +45,12 @@ namespace Interpreter
void installSegment0 (int code, Opcode1 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment1 (int code, Opcode2 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment2 (int code, Opcode1 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment3 (int code, Opcode1 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment4 (int code, Opcode2 *opcode);
///< ownership of \a opcode is transferred to *this.
void installSegment5 (int code, Opcode0 *opcode);
///< ownership of \a opcode is transferred to *this.

@ -25,16 +25,6 @@ namespace Interpreter
virtual ~Opcode1() {}
};
/// opcode for 2 arguments
class Opcode2
{
public:
virtual void execute (Runtime& runtime, unsigned int arg1, unsigned int arg2) = 0;
virtual ~Opcode2() {}
};
}
#endif

Loading…
Cancel
Save