Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 945275 - Mark ThisV in rectifier frames r=jandem
Browse files Browse the repository at this point in the history
  • Loading branch information
jonco3 committed Jan 10, 2014
1 parent 39ad8ca commit 6da36b2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions js/src/jit-test/tests/gc/bug-945275.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function TestCase(n) {
this.name = undefined;
this.description = undefined;
}
gczeal(7,1);
eval("\
function reportCompare() new TestCase;\
reportCompare();\
Object.defineProperty(Object.prototype, 'name', {});\
reportCompare();\
");
13 changes: 13 additions & 0 deletions js/src/jit-test/tests/gc/bug-957114.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gczeal(7,1);
function TestCase(n) {
this.name = '';
this.description = '';
this.expect = '';
this.actual = '';
this.reason = '';
this.passed = '';
}
function test() new TestCase;
test();
Object.defineProperty(Object.prototype, "name", {});
test();
11 changes: 11 additions & 0 deletions js/src/jit/IonFrames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,15 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
}
}

static void
MarkRectifierFrame(JSTracer *trc, const IonFrameIterator &frame)
{
// Mark thisv. Baseline JIT code generated as part of the ICCall_Fallback
// stub may read it if a constructor returns a primitive value.
IonRectifierFrameLayout *layout = (IonRectifierFrameLayout *)frame.fp();
gc::MarkValueRoot(trc, &layout->argv()[0], "ion-thisv");
}

static void
MarkJitActivation(JSTracer *trc, const JitActivationIterator &activations)
{
Expand Down Expand Up @@ -1132,6 +1141,8 @@ MarkJitActivation(JSTracer *trc, const JitActivationIterator &activations)
case IonFrame_Unwound_OptimizedJS:
MOZ_ASSUME_UNREACHABLE("invalid");
case IonFrame_Rectifier:
MarkRectifierFrame(trc, frames);
break;
case IonFrame_Unwound_Rectifier:
break;
case IonFrame_Osr:
Expand Down

0 comments on commit 6da36b2

Please sign in to comment.