Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 19, 2012
@nominolo Print more debug info for trace recorder. a2eebb4
@nominolo Abort recording if we hit a heap block overflow.
Upon encountering a heap-overflow during an allocation instruction we
adjust the heap pointer and then try to execute the instruction again.
This caused problems when executing the instruction in recording mode.
Rather than handle this case in the recorder we simply abort recording
and retry another time (at least for now).
3b79b98
Showing with 12 additions and 2 deletions.
  1. +6 −2 vm/capability.cc
  2. +3 −0  vm/jit.cc
  3. +3 −0  vm/jit.hh
View
8 vm/capability.cc
@@ -440,6 +440,7 @@ record: {
}
heapOverflow:
+ if (isRecording()) jit_.requestAbort();
--pc;
// Convention: If GC is needed, T->pc points to the instruction that
// tried to allocate.
@@ -711,7 +712,8 @@ op_CALLT: {
// Synchronises the interpreter state from the capability.
// Does NOT update the memory manager state!
LOAD_STATE_FROM_CAP;
- if (isEnabledBytecodeTracing())
+ if (isEnabledBytecodeTracing() ||
+ ((DEBUG_COMPONENTS & DEBUG_TRACE_RECORDER) && isRecording()))
dispatch = dispatch_debug;
// TODO: this is hacky.
DISPATCH_NEXT;
@@ -727,7 +729,8 @@ op_JFUNC: {
heaplim = (char *)traceExitHpLim_;
LOAD_STATE_FROM_CAP;
- if (isEnabledBytecodeTracing())
+ if (isEnabledBytecodeTracing() ||
+ ((DEBUG_COMPONENTS & DEBUG_TRACE_RECORDER) && isRecording()))
dispatch = dispatch_debug;
// Reload code/KBASE
@@ -909,6 +912,7 @@ generic_apply: {
heap += (wordsof(PapClosure) + pap_size) * sizeof(Word);
while (LC_UNLIKELY(heap > heaplim)) {
heap -= (wordsof(PapClosure) + pap_size) * sizeof(Word);
+ if (isRecording()) jit_.requestAbort();
// PC points after the CALL/CALLT/EVAL. We're setting the
// top of stack pointer mask, though, so the GC really only
// needs the correct base pointer.
View
3  vm/jit.cc
@@ -291,6 +291,8 @@ bool Jit::recordGenericApply(uint32_t call_info, Word *base,
}
bool Jit::recordIns(BcIns *ins, Word *base, const Code *code) {
+ if (LC_UNLIKELY(shouldAbort_))
+ goto abort_recording;
buf_.pc_ = ins;
buf_.steps_++;
DBG(cerr << "REC: " << ins << " " << ins->name() << endl);
@@ -726,6 +728,7 @@ inline void Jit::resetRecorderState() {
flags_.clear();
targets_.clear();
cap_ = NULL;
+ shouldAbort_ = false;
}
void Jit::finishRecording() {
View
3  vm/jit.hh
@@ -162,6 +162,8 @@ public:
inline bool isRecording() const { return cap_ != NULL; }
+ inline void requestAbort() { shouldAbort_ = true; }
+
// Returns the fragment starting at the given PC. NULL, otherwise.
inline Fragment *traceAt(BcIns *pc);
@@ -211,6 +213,7 @@ private:
CallStack callStack_;
BranchTargetBuffer btb_;
MCode *exitStubGroup_[16];
+ bool shouldAbort_;
static FRAGMENT_MAP fragmentMap_;
static std::vector<Fragment*> fragments_;

No commit comments for this range

Something went wrong with that request. Please try again.