Bug 1022081: SPS: Reset the pushedScript after generation of OOL code, r=djvj

This commit is contained in:
Hannes Verschore 2014-06-11 08:55:46 +02:00
parent feeaf7db9a
commit e3a01489cd
3 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,8 @@
function f() {
(function() {
gc()
})()
}
enableSPSProfiling()
f()
f()

View File

@ -85,6 +85,7 @@ CodeGeneratorShared::CodeGeneratorShared(MIRGenerator *gen, LIRGraph *graph, Mac
bool
CodeGeneratorShared::generateOutOfLineCode()
{
JSScript *topScript = sps_.getPushed();
for (size_t i = 0; i < outOfLineCode_.length(); i++) {
if (!gen->alloc().ensureBallast())
return false;
@ -103,6 +104,7 @@ CodeGeneratorShared::generateOutOfLineCode()
return false;
sps_.finishOOL();
}
sps_.setPushed(topScript);
oolIns = nullptr;
return true;

View File

@ -403,6 +403,12 @@ class SPSInstrumentation
frame->script = script;
}
JSScript *getPushed() {
if (!enabled())
return nullptr;
return frame->script;
}
/*
* Flags entry into a JS function for the first time. Before this is called,
* no instrumentation is emitted, but after this instrumentation is emitted.