mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1111327
- Fix AsmJSModule::clone to duplicate profiling labels (r=dougc)
--HG-- extra : rebase_source : fce96207623d1bc9c480694bd311d25e827d35f6
This commit is contained in:
parent
dffa5fa728
commit
4110d21005
@ -1496,6 +1496,11 @@ AsmJSModule::serializedSize() const
|
||||
uint8_t *
|
||||
AsmJSModule::serialize(uint8_t *cursor) const
|
||||
{
|
||||
MOZ_ASSERT(!dynamicallyLinked_);
|
||||
MOZ_ASSERT(!loadedFromCache_);
|
||||
MOZ_ASSERT(!profilingEnabled_);
|
||||
MOZ_ASSERT(!interrupted_);
|
||||
|
||||
cursor = WriteBytes(cursor, &pod, sizeof(pod));
|
||||
cursor = WriteBytes(cursor, code_, pod.codeBytes_);
|
||||
cursor = SerializeName(cursor, globalArgumentName_);
|
||||
@ -1590,6 +1595,16 @@ AsmJSModule::clone(JSContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) con
|
||||
out.loadedFromCache_ = loadedFromCache_;
|
||||
out.profilingEnabled_ = profilingEnabled_;
|
||||
|
||||
if (profilingEnabled_) {
|
||||
if (!out.profilingLabels_.resize(profilingLabels_.length()))
|
||||
return false;
|
||||
for (size_t i = 0; i < profilingLabels_.length(); i++) {
|
||||
out.profilingLabels_[i] = DuplicateString(cx, profilingLabels_[i].get());
|
||||
if (!out.profilingLabels_[i])
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// We already know the exact extent of areas that need to be patched, just make sure we
|
||||
// flush all of them at once.
|
||||
out.setAutoFlushICacheRange();
|
||||
|
@ -645,7 +645,7 @@ class AsmJSModule
|
||||
bool clone(ExclusiveContext *cx, Name *out) const;
|
||||
};
|
||||
|
||||
typedef mozilla::UniquePtr<char, JS::FreePolicy> ProfilingLabel;
|
||||
typedef mozilla::UniquePtr<char[], JS::FreePolicy> ProfilingLabel;
|
||||
|
||||
#if defined(MOZ_VTUNE) || defined(JS_ION_PERF)
|
||||
// Function information to add to the VTune JIT profiler following linking.
|
||||
|
11
js/src/jit-test/tests/asm.js/testBug1111327.js
Normal file
11
js/src/jit-test/tests/asm.js/testBug1111327.js
Normal file
@ -0,0 +1,11 @@
|
||||
load(libdir + "asm.js");
|
||||
|
||||
// Single-step profiling currently only works in the ARM simulator
|
||||
if (!getBuildConfiguration()["arm-simulator"])
|
||||
quit();
|
||||
|
||||
enableSPSProfiling();
|
||||
enableSingleStepProfiling();
|
||||
var m = asmCompile(USE_ASM + 'function f() {} return f');
|
||||
asmLink(m)();
|
||||
asmLink(m)();
|
Loading…
Reference in New Issue
Block a user