Bug 965247 - ARM simulator: Support an environment variable and shell argument to enabling icache checks. r=jandem

This commit is contained in:
Douglas Crosher 2014-01-30 01:30:56 +11:00
parent 5658e3ae22
commit 7f74586c39
2 changed files with 16 additions and 2 deletions

View File

@ -402,6 +402,8 @@ class AutoLockSimulatorRuntime
}
};
bool Simulator::ICacheCheckingEnabled = false;
SimulatorRuntime *
CreateSimulatorRuntime()
{
@ -413,6 +415,10 @@ CreateSimulatorRuntime()
js_delete(srt);
return nullptr;
}
if (getenv("ARM_SIM_ICACHE_CHECKS"))
Simulator::ICacheCheckingEnabled = true;
return srt;
}
@ -3790,8 +3796,6 @@ Simulator::decodeSpecialCondition(SimInstruction *instr)
}
}
bool Simulator::ICacheCheckingEnabled = false;
// Executes the current instruction.
void
Simulator::instructionDecode(SimInstruction *instr)

View File

@ -60,6 +60,7 @@
#include "builtin/TestingFunctions.h"
#include "frontend/Parser.h"
#include "jit/arm/Simulator-arm.h"
#include "jit/Ion.h"
#include "js/OldDebugAPI.h"
#include "js/StructuredClone.h"
@ -5844,6 +5845,10 @@ main(int argc, char **argv, char **envp)
#endif
|| !op.addIntOption('\0', "available-memory", "SIZE",
"Select GC settings based on available memory (MB)", 0)
#ifdef JS_ARM_SIMULATOR
|| !op.addBoolOption('\0', "arm-sim-icache-checks", "Enable icache flush checks in the ARM "
"simulator.")
#endif
)
{
return EXIT_FAILURE;
@ -5892,6 +5897,11 @@ main(int argc, char **argv, char **envp)
#endif
#endif
#ifdef JS_ARM_SIMULATOR
if (op.getBoolOption("arm-sim-icache-checks"))
jit::Simulator::ICacheCheckingEnabled = true;
#endif
// Start the engine.
if (!JS_Init())
return 1;