mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 974980 - Always push a js:RunScript frame in pseudostack; r=BenWa
This commit is contained in:
parent
3574d8474f
commit
a613e47ef4
@ -78,6 +78,10 @@ class ProfileEntry
|
||||
// a pc into a script's code. To signify a nullptr pc, use a -1 index. This
|
||||
// is checked against in pc() and setPC() to set/get the right pc.
|
||||
static const int32_t NullPCIndex = -1;
|
||||
|
||||
// This bit is added to the stack address to indicate that copying the
|
||||
// frame label is not necessary when taking a sample of the pseudostack.
|
||||
static const uintptr_t NoCopyBit = 1;
|
||||
};
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
|
@ -212,7 +212,7 @@ SPSProfiler::push(const char *string, void *sp, JSScript *script, jsbytecode *pc
|
||||
volatile uint32_t *size = size_;
|
||||
uint32_t current = *size;
|
||||
|
||||
JS_ASSERT(enabled());
|
||||
JS_ASSERT(installed());
|
||||
if (current < max_) {
|
||||
stack[current].setLabel(string);
|
||||
stack[current].setStackAddress(sp);
|
||||
@ -291,12 +291,12 @@ SPSEntryMarker::SPSEntryMarker(JSRuntime *rt
|
||||
: profiler(&rt->spsProfiler)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
if (!profiler->enabled()) {
|
||||
if (!profiler->installed()) {
|
||||
profiler = nullptr;
|
||||
return;
|
||||
}
|
||||
size_before = *profiler->size_;
|
||||
profiler->push("js::RunScript", this, nullptr, nullptr);
|
||||
profiler->pushNoCopy("js::RunScript", this, nullptr, nullptr);
|
||||
}
|
||||
|
||||
SPSEntryMarker::~SPSEntryMarker()
|
||||
|
@ -128,6 +128,12 @@ class SPSProfiler
|
||||
|
||||
const char *allocProfileString(JSScript *script, JSFunction *function);
|
||||
void push(const char *string, void *sp, JSScript *script, jsbytecode *pc);
|
||||
void pushNoCopy(const char *string, void *sp,
|
||||
JSScript *script, jsbytecode *pc) {
|
||||
push(string, reinterpret_cast<void*>(
|
||||
reinterpret_cast<uintptr_t>(sp) | ProfileEntry::NoCopyBit),
|
||||
script, pc);
|
||||
}
|
||||
void pop();
|
||||
|
||||
public:
|
||||
|
@ -93,10 +93,10 @@ public:
|
||||
// Last bit 1 = Don't copy, Last bit 0 = Copy.
|
||||
if (copy) {
|
||||
setStackAddress(reinterpret_cast<void*>(
|
||||
reinterpret_cast<uintptr_t>(sparg) & ~0x1));
|
||||
reinterpret_cast<uintptr_t>(sparg) & ~NoCopyBit));
|
||||
} else {
|
||||
setStackAddress(reinterpret_cast<void*>(
|
||||
reinterpret_cast<uintptr_t>(sparg) | 0x1));
|
||||
reinterpret_cast<uintptr_t>(sparg) | NoCopyBit));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user