Backed out changeset 84663a25b44e (bug 976260) for compilation failures

This commit is contained in:
Ed Morley 2014-02-28 18:42:34 +00:00
parent e0d667c0c5
commit e014226006
10 changed files with 11 additions and 119 deletions

View File

@ -91,9 +91,6 @@ SetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,
JS_FRIEND_API(void) JS_FRIEND_API(void)
EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled); EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);
JS_FRIEND_API(void)
RegisterRuntimeProfilingEventMarker(JSRuntime *rt, void (*fn)(const char *));
JS_FRIEND_API(jsbytecode*) JS_FRIEND_API(jsbytecode*)
ProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip); ProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);

View File

@ -975,8 +975,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
IonSpew(IonSpew_BaselineBailouts, " Set resumeAddr=%p", opReturnAddr); IonSpew(IonSpew_BaselineBailouts, " Set resumeAddr=%p", opReturnAddr);
} }
if (cx->runtime()->spsProfiler.enabled()) { if (cx->runtime()->spsProfiler.enabled() && blFrame->hasPushedSPSFrame()) {
if (blFrame->hasPushedSPSFrame()) {
// Set PC index to 0 for the innermost frame to match what the // Set PC index to 0 for the innermost frame to match what the
// interpreter and Baseline do: they update the SPS pc for // interpreter and Baseline do: they update the SPS pc for
// JSOP_CALL ops but set it to 0 when running other ops. Ion code // JSOP_CALL ops but set it to 0 when running other ops. Ion code
@ -986,25 +985,6 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
cx->runtime()->spsProfiler.updatePC(script, script->code()); cx->runtime()->spsProfiler.updatePC(script, script->code());
} }
// Register bailout with profiler.
const char *filename = script->filename();
if (filename == nullptr)
filename = "<unknown>";
unsigned len = strlen(filename) + 200;
char *buf = js_pod_malloc<char>(len);
if (buf == nullptr)
return false;
JS_snprintf(buf, len, "%s %s %s on line %d of %s:%d",
BailoutKindString(bailoutKind),
resumeAfter ? "after" : "at",
js_CodeName[op],
int(PCToLineNumber(script, pc)),
filename,
int(script->lineno()));
cx->runtime()->spsProfiler.markEvent(buf);
js_free(buf);
}
return true; return true;
} }

View File

@ -6226,19 +6226,6 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
SetIonScript(script, executionMode, ionScript); SetIonScript(script, executionMode, ionScript);
if (cx->runtime()->spsProfiler.enabled()) {
const char *filename = script->filename();
if (filename == nullptr)
filename = "<unknown>";
unsigned len = strlen(filename) + 50;
char *buf = js_pod_malloc<char>(len);
if (!buf)
return false;
JS_snprintf(buf, len, "Ion compiled %s:%d", filename, (int) script->lineno());
cx->runtime()->spsProfiler.markEvent(buf);
js_free(buf);
}
// In parallel execution mode, when we first compile a script, we // In parallel execution mode, when we first compile a script, we
// don't know that its potential callees are compiled, so set a // don't know that its potential callees are compiled, so set a
// flag warning that the callees may not be fully compiled. // flag warning that the callees may not be fully compiled.

View File

@ -15,7 +15,6 @@
#include "TraceLogging.h" #include "TraceLogging.h"
#endif #endif
#include "jsprf.h"
#include "gc/Marking.h" #include "gc/Marking.h"
#include "jit/AliasAnalysis.h" #include "jit/AliasAnalysis.h"
#include "jit/AsmJSModule.h" #include "jit/AsmJSModule.h"
@ -2622,27 +2621,6 @@ jit::Invalidate(JSContext *cx, JSScript *script, ExecutionMode mode, bool resetU
{ {
JS_ASSERT(script->hasIonScript()); JS_ASSERT(script->hasIonScript());
if (cx->runtime()->spsProfiler.enabled()) {
// Register invalidation with profiler.
// Format of event payload string:
// "<filename>:<lineno>"
// Get the script filename, if any, and its length.
const char *filename = script->filename();
if (filename == nullptr)
filename = "<unknown>";
size_t len = strlen(filename) + 20;
char *buf = js_pod_malloc<char>(len);
if (!buf)
return false;
// Construct the descriptive string.
JS_snprintf(buf, len, "Invalidate %s:%llu", filename, script->lineno());
cx->runtime()->spsProfiler.markEvent(buf);
js_free(buf);
}
Vector<types::RecompileInfo> scripts(cx); Vector<types::RecompileInfo> scripts(cx);
switch (mode) { switch (mode) {

View File

@ -52,6 +52,7 @@ enum BailoutKind
static const uint32_t BAILOUT_KIND_BITS = 3; static const uint32_t BAILOUT_KIND_BITS = 3;
static const uint32_t BAILOUT_RESUME_BITS = 1; static const uint32_t BAILOUT_RESUME_BITS = 1;
#ifdef DEBUG
inline const char * inline const char *
BailoutKindString(BailoutKind kind) BailoutKindString(BailoutKind kind)
{ {
@ -70,6 +71,7 @@ BailoutKindString(BailoutKind kind)
MOZ_ASSUME_UNREACHABLE("Invalid BailoutKind"); MOZ_ASSUME_UNREACHABLE("Invalid BailoutKind");
} }
} }
#endif
static const uint32_t ELEMENT_TYPE_BITS = 4; static const uint32_t ELEMENT_TYPE_BITS = 4;
static const uint32_t ELEMENT_TYPE_SHIFT = 0; static const uint32_t ELEMENT_TYPE_SHIFT = 0;

View File

@ -4275,22 +4275,6 @@ SetCachingEnabled(JSContext *cx, unsigned argc, Value *vp)
return true; return true;
} }
static void
PrintProfilerEvents_Callback(const char *msg)
{
fprintf(stderr, "PROFILER EVENT: %s\n", msg);
}
static bool
PrintProfilerEvents(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (cx->runtime()->spsProfiler.enabled())
js::RegisterRuntimeProfilingEventMarker(cx->runtime(), &PrintProfilerEvents_Callback);
args.rval().setUndefined();
return true;
}
static const JSFunctionSpecWithHelp shell_functions[] = { static const JSFunctionSpecWithHelp shell_functions[] = {
JS_FN_HELP("version", Version, 0, 0, JS_FN_HELP("version", Version, 0, 0,
"version([number])", "version([number])",
@ -4631,11 +4615,6 @@ static const JSFunctionSpecWithHelp shell_functions[] = {
" and read by the \"evaluate\" function by using it in place of the source, and\n" " and read by the \"evaluate\" function by using it in place of the source, and\n"
" by setting \"saveBytecode\" and \"loadBytecode\" options."), " by setting \"saveBytecode\" and \"loadBytecode\" options."),
JS_FN_HELP("printProfilerEvents", PrintProfilerEvents, 0, 0,
"printProfilerEvents()",
" Register a callback with the profiler that prints javascript profiler events\n"
" to stderr. Callback is only registered if profiling is enabled."),
JS_FS_HELP_END JS_FS_HELP_END
}; };

View File

@ -26,8 +26,7 @@ SPSProfiler::SPSProfiler(JSRuntime *rt)
max_(0), max_(0),
slowAssertions(false), slowAssertions(false),
enabled_(false), enabled_(false),
lock_(nullptr), lock_(nullptr)
eventMarker_(nullptr)
{ {
JS_ASSERT(rt != nullptr); JS_ASSERT(rt != nullptr);
} }
@ -67,12 +66,6 @@ SPSProfiler::setProfilingStack(ProfileEntry *stack, uint32_t *size, uint32_t max
max_ = max; max_ = max;
} }
void
SPSProfiler::setEventMarker(void (*fn)(const char *))
{
eventMarker_ = fn;
}
void void
SPSProfiler::enable(bool enabled) SPSProfiler::enable(bool enabled)
{ {
@ -338,13 +331,6 @@ js::EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled)
rt->spsProfiler.enable(enabled); rt->spsProfiler.enable(enabled);
} }
JS_FRIEND_API(void)
js::RegisterRuntimeProfilingEventMarker(JSRuntime *rt, void (*fn)(const char *))
{
JS_ASSERT(rt->spsProfiler.enabled());
rt->spsProfiler.setEventMarker(fn);
}
JS_FRIEND_API(jsbytecode*) JS_FRIEND_API(jsbytecode*)
js::ProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip) js::ProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip)
{ {

View File

@ -125,7 +125,6 @@ class SPSProfiler
bool slowAssertions; bool slowAssertions;
uint32_t enabled_; uint32_t enabled_;
PRLock *lock_; PRLock *lock_;
void (*eventMarker_)(const char *);
const char *allocProfileString(JSScript *script, JSFunction *function); const char *allocProfileString(JSScript *script, JSFunction *function);
void push(const char *string, void *sp, JSScript *script, jsbytecode *pc); void push(const char *string, void *sp, JSScript *script, jsbytecode *pc);
@ -192,16 +191,9 @@ class SPSProfiler
jsbytecode *ipToPC(JSScript *script, size_t ip) { return nullptr; } jsbytecode *ipToPC(JSScript *script, size_t ip) { return nullptr; }
void setProfilingStack(ProfileEntry *stack, uint32_t *size, uint32_t max); void setProfilingStack(ProfileEntry *stack, uint32_t *size, uint32_t max);
void setEventMarker(void (*fn)(const char *));
const char *profileString(JSScript *script, JSFunction *maybeFun); const char *profileString(JSScript *script, JSFunction *maybeFun);
void onScriptFinalized(JSScript *script); void onScriptFinalized(JSScript *script);
void markEvent(const char *event) {
JS_ASSERT(enabled());
if (eventMarker_)
eventMarker_(event);
}
/* meant to be used for testing, not recommended to call in normal code */ /* meant to be used for testing, not recommended to call in normal code */
size_t stringsCount(); size_t stringsCount();
void stringsReset(); void stringsReset();

View File

@ -143,8 +143,3 @@ IOMarkerPayload::preparePayloadImp<JSCustomObjectBuilder>(JSCustomObjectBuilder&
template JSObjectBuilder::Object template JSObjectBuilder::Object
IOMarkerPayload::preparePayloadImp<JSObjectBuilder>(JSObjectBuilder& b); IOMarkerPayload::preparePayloadImp<JSObjectBuilder>(JSObjectBuilder& b);
void
ProfilerJSEventMarker(const char *event)
{
PROFILER_MARKER(event);
}

View File

@ -292,9 +292,6 @@ private:
volatile bool mSignalLock; volatile bool mSignalLock;
}; };
// Stub eventMarker function for js-engine event generation.
void ProfilerJSEventMarker(const char *event);
// the PseudoStack members are read by signal // the PseudoStack members are read by signal
// handlers, so the mutation of them needs to be signal-safe. // handlers, so the mutation of them needs to be signal-safe.
struct PseudoStack struct PseudoStack
@ -401,7 +398,6 @@ public:
void enableJSSampling() { void enableJSSampling() {
if (mRuntime) { if (mRuntime) {
js::EnableRuntimeProfilingStack(mRuntime, true); js::EnableRuntimeProfilingStack(mRuntime, true);
js::RegisterRuntimeProfilingEventMarker(mRuntime, &ProfilerJSEventMarker);
mStartJSSampling = false; mStartJSSampling = false;
} else { } else {
mStartJSSampling = true; mStartJSSampling = true;