mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 998490 - OdinMonkey: rm unused functionCounts from asm.js (r=bbouvier)
--HG-- extra : rebase_source : c6b38f528625ca9bea4ce6f9de85d66e1d3374e0
This commit is contained in:
parent
8d5f4193c1
commit
aadd9c9a70
@ -1445,10 +1445,6 @@ class MOZ_STACK_CLASS ModuleCompiler
|
||||
}
|
||||
#endif
|
||||
|
||||
bool addFunctionCounts(IonScriptCounts *counts) {
|
||||
return module_->addFunctionCounts(counts);
|
||||
}
|
||||
|
||||
void finishFunctionBodies() {
|
||||
JS_ASSERT(!finishedFunctionBodies_);
|
||||
masm_.align(AsmJSPageSize);
|
||||
@ -5461,12 +5457,6 @@ GenerateCode(ModuleCompiler &m, ModuleCompiler::Func &func, MIRGenerator &mir, L
|
||||
if (!codegen || !codegen->generateAsmJS(&m.stackOverflowLabel()))
|
||||
return m.fail(nullptr, "internal codegen failure (probably out of memory)");
|
||||
|
||||
jit::IonScriptCounts *counts = codegen->extractUnassociatedScriptCounts();
|
||||
if (counts && !m.addFunctionCounts(counts)) {
|
||||
js_delete(counts);
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(MOZ_VTUNE) || defined(JS_ION_PERF)
|
||||
// Profiling might not be active now, but it may be activated later (perhaps
|
||||
// after the module has been cached and reloaded from the cache). Function
|
||||
|
@ -371,9 +371,6 @@ AsmJSModule::~AsmJSModule()
|
||||
|
||||
DeallocateExecutableMemory(code_, pod.totalBytes_);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < numFunctionCounts(); i++)
|
||||
js_delete(functionCounts(i));
|
||||
}
|
||||
|
||||
void
|
||||
@ -392,7 +389,6 @@ AsmJSModule::addSizeOfMisc(mozilla::MallocSizeOf mallocSizeOf, size_t *asmJSModu
|
||||
#if defined(JS_ION_PERF)
|
||||
perfProfiledBlocksFunctions_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
#endif
|
||||
functionCounts_.sizeOfExcludingThis(mallocSizeOf) +
|
||||
staticLinkData_.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
|
@ -458,8 +458,6 @@ class AsmJSModule
|
||||
|
||||
ScriptSource * scriptSource_;
|
||||
|
||||
FunctionCountsVector functionCounts_;
|
||||
|
||||
// This field is accessed concurrently when requesting an interrupt.
|
||||
// Access must be synchronized via the runtime's interrupt lock.
|
||||
mutable bool codeIsProtected_;
|
||||
@ -596,9 +594,6 @@ class AsmJSModule
|
||||
*exitIndex = unsigned(exits_.length());
|
||||
return exits_.append(Exit(ffiIndex, globalDataOffset));
|
||||
}
|
||||
bool addFunctionCounts(jit::IonScriptCounts *counts) {
|
||||
return functionCounts_.append(counts);
|
||||
}
|
||||
|
||||
bool addExportedFunction(PropertyName *name, uint32_t line, uint32_t column,
|
||||
uint32_t srcStart, uint32_t srcEnd,
|
||||
@ -687,12 +682,6 @@ class AsmJSModule
|
||||
JS_ASSERT(exit.ionCodeOffset_);
|
||||
return code_ + exit.ionCodeOffset_;
|
||||
}
|
||||
unsigned numFunctionCounts() const {
|
||||
return functionCounts_.length();
|
||||
}
|
||||
jit::IonScriptCounts *functionCounts(unsigned i) {
|
||||
return functionCounts_[i];
|
||||
}
|
||||
|
||||
// An Exit holds bookkeeping information about an exit; the ExitDatum
|
||||
// struct overlays the actual runtime data stored in the global data
|
||||
|
@ -150,14 +150,12 @@ MNewStringObject::templateObj() const {
|
||||
CodeGenerator::CodeGenerator(MIRGenerator *gen, LIRGraph *graph, MacroAssembler *masm)
|
||||
: CodeGeneratorSpecific(gen, graph, masm)
|
||||
, ionScriptLabels_(gen->alloc())
|
||||
, unassociatedScriptCounts_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
CodeGenerator::~CodeGenerator()
|
||||
{
|
||||
JS_ASSERT_IF(!gen->compilingAsmJS(), masm.numAsmJSAbsoluteLinks() == 0);
|
||||
js_delete(unassociatedScriptCounts_);
|
||||
}
|
||||
|
||||
typedef bool (*StringToNumberFn)(ThreadSafeContext *, JSString *, double *);
|
||||
@ -2976,15 +2974,15 @@ CodeGenerator::maybeCreateScriptCounts()
|
||||
if (!cx || !cx->runtime()->profilingScripts)
|
||||
return nullptr;
|
||||
|
||||
IonScriptCounts *counts = nullptr;
|
||||
|
||||
CompileInfo *outerInfo = &gen->info();
|
||||
JSScript *script = outerInfo->script();
|
||||
|
||||
if (script && !script->hasScriptCounts() && !script->initScriptCounts(cx))
|
||||
if (!script)
|
||||
return nullptr;
|
||||
|
||||
counts = js_new<IonScriptCounts>();
|
||||
if (!script->hasScriptCounts() && !script->initScriptCounts(cx))
|
||||
return nullptr;
|
||||
|
||||
IonScriptCounts *counts = js_new<IonScriptCounts>();
|
||||
if (!counts || !counts->init(graph.numBlocks())) {
|
||||
js_delete(counts);
|
||||
return nullptr;
|
||||
@ -2993,33 +2991,24 @@ CodeGenerator::maybeCreateScriptCounts()
|
||||
for (size_t i = 0; i < graph.numBlocks(); i++) {
|
||||
MBasicBlock *block = graph.getBlock(i)->mir();
|
||||
|
||||
uint32_t offset = 0;
|
||||
if (script) {
|
||||
// Find a PC offset in the outermost script to use. If this block
|
||||
// is from an inlined script, find a location in the outer script
|
||||
// to associate information about the inlining with.
|
||||
MResumePoint *resume = block->entryResumePoint();
|
||||
while (resume->caller())
|
||||
resume = resume->caller();
|
||||
offset = script->pcToOffset(resume->pc());
|
||||
}
|
||||
// Find a PC offset in the outermost script to use. If this block
|
||||
// is from an inlined script, find a location in the outer script
|
||||
// to associate information about the inlining with.
|
||||
MResumePoint *resume = block->entryResumePoint();
|
||||
while (resume->caller())
|
||||
resume = resume->caller();
|
||||
|
||||
uint32_t offset = script->pcToOffset(resume->pc());
|
||||
if (!counts->block(i).init(block->id(), offset, block->numSuccessors())) {
|
||||
js_delete(counts);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < block->numSuccessors(); j++)
|
||||
counts->block(i).setSuccessor(j, block->getSuccessor(j)->id());
|
||||
}
|
||||
|
||||
if (script) {
|
||||
script->addIonCounts(counts);
|
||||
} else {
|
||||
// Compiling code for Asm.js. Leave the counts on the CodeGenerator to
|
||||
// be picked up by the AsmJSModule after generation finishes.
|
||||
unassociatedScriptCounts_ = counts;
|
||||
}
|
||||
|
||||
script->addIonCounts(counts);
|
||||
return counts;
|
||||
}
|
||||
|
||||
|
@ -349,12 +349,6 @@ class CodeGenerator : public CodeGeneratorSpecific
|
||||
|
||||
bool visitRecompileCheck(LRecompileCheck *ins);
|
||||
|
||||
IonScriptCounts *extractUnassociatedScriptCounts() {
|
||||
IonScriptCounts *counts = unassociatedScriptCounts_;
|
||||
unassociatedScriptCounts_ = nullptr; // prevent delete in dtor
|
||||
return counts;
|
||||
}
|
||||
|
||||
private:
|
||||
bool addGetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
|
||||
PropertyName *name, TypedOrValueRegister output,
|
||||
@ -455,9 +449,6 @@ class CodeGenerator : public CodeGeneratorSpecific
|
||||
bool emitValueResultChecks(LInstruction *lir, MDefinition *mir);
|
||||
#endif
|
||||
|
||||
// Script counts created when compiling code with no associated JSScript.
|
||||
IonScriptCounts *unassociatedScriptCounts_;
|
||||
|
||||
#if defined(JS_ION_PERF)
|
||||
PerfSpewer perfSpewer_;
|
||||
#endif
|
||||
|
@ -843,34 +843,6 @@ JS_DumpCompartmentPCCounts(JSContext *cx)
|
||||
if (script->hasScriptCounts())
|
||||
JS_DumpPCCounts(cx, script);
|
||||
}
|
||||
|
||||
#if defined(JS_ION)
|
||||
for (unsigned thingKind = FINALIZE_OBJECT0; thingKind < FINALIZE_OBJECT_LIMIT; thingKind++) {
|
||||
for (CellIter i(cx->zone(), (AllocKind) thingKind); !i.done(); i.next()) {
|
||||
JSObject *obj = i.get<JSObject>();
|
||||
if (obj->compartment() != cx->compartment())
|
||||
continue;
|
||||
|
||||
if (obj->is<AsmJSModuleObject>()) {
|
||||
AsmJSModule &module = obj->as<AsmJSModuleObject>().module();
|
||||
|
||||
Sprinter sprinter(cx);
|
||||
if (!sprinter.init())
|
||||
return;
|
||||
|
||||
fprintf(stdout, "--- Asm.js Module ---\n");
|
||||
|
||||
for (size_t i = 0; i < module.numFunctionCounts(); i++) {
|
||||
jit::IonScriptCounts *counts = module.functionCounts(i);
|
||||
DumpIonScriptCounts(&sprinter, counts);
|
||||
}
|
||||
|
||||
fputs(sprinter.string(), stdout);
|
||||
fprintf(stdout, "--- END Asm.js Module ---\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
|
Loading…
Reference in New Issue
Block a user