Implement a watchdog timer for scripts that take too long to execute (bug 5837, r=fyren).

--HG--
extra : rebase_source : ffacb38457eca581660ce8f15c444ad828b7fedd
This commit is contained in:
David Anderson
2013-08-14 23:54:25 -07:00
parent 74f1b800c2
commit 3ac43497b9
25 changed files with 1250 additions and 99 deletions
+5 -5
View File
@@ -64,6 +64,11 @@ class Assembler
return pos_ - buffer_;
}
// Current offset into the code stream.
uint32_t pc() const {
return uint32_t(pos_ - buffer_);
}
protected:
void writeByte(uint8_t byte) {
write<uint8_t>(byte);
@@ -125,11 +130,6 @@ class Assembler
return int32_t(pos_ - buffer_);
}
// pc is the unsigned version of position().
uint32_t pc() const {
return uint32_t(pos_ - buffer_);
}
protected:
void assertCanWrite(size_t bytes) {
assert(pos_ + bytes <= end_);
+8
View File
@@ -640,6 +640,10 @@ class AssemblerX86 : public Assembler
emit2(0xdc, 0xc0 + src.code);
}
void jmp32(Label *dest) {
emit1(0xe9);
emitJumpTarget(dest);
}
void jmp(Label *dest) {
int8_t d8;
if (canEmitSmallJump(dest, &d8)) {
@@ -655,6 +659,10 @@ class AssemblerX86 : public Assembler
void jmp(const Operand &target) {
emit1(0xff, 4, target);
}
void j32(ConditionCode cc, Label *dest) {
emit2(0x0f, 0x80 + uint8_t(cc));
emitJumpTarget(dest);
}
void j(ConditionCode cc, Label *dest) {
int8_t d8;
if (canEmitSmallJump(dest, &d8)) {