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:
@@ -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_);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user