Skip to content

Commit

Permalink
Bug 1150714 - Fix streaming tracked optimizations for functions that …
Browse files Browse the repository at this point in the history
…don't have a displayAtom. (r=djvj)
  • Loading branch information
syg committed Apr 7, 2015
1 parent d004b16 commit fb729d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions js/src/jit/OptimizationTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1213,11 +1213,14 @@ IonTrackedOptimizationsTypeInfo::ForEachOpAdapter::readType(const IonTrackedType
return;
}

PutEscapedString(buf, bufsize, fun->displayAtom(), 0);
if (fun->displayAtom())
PutEscapedString(buf, bufsize, fun->displayAtom(), 0);
const char* filename;
unsigned lineno;
InterpretedFunctionFilenameAndLineNumber(fun, &filename, &lineno);
op_.readType(tracked.constructor ? "constructor" : "function", buf, filename, lineno);
op_.readType(tracked.constructor ? "constructor" : "function",
fun->displayAtom() ? buf : nullptr,
filename, lineno);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions tools/profiler/ProfileEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ class StreamOptimizationTypeInfoOp : public JS::ForEachTrackedOptimizationTypeIn
, mStartedTypeList(false)
{ }

void readType(const char *keyedBy, const char *name,
const char *location, unsigned lineno) override {
void readType(const char* keyedBy, const char* name,
const char* location, unsigned lineno) override {
if (!mStartedTypeList) {
mStartedTypeList = true;
mWriter.BeginObject();
Expand All @@ -254,7 +254,7 @@ class StreamOptimizationTypeInfoOp : public JS::ForEachTrackedOptimizationTypeIn
mWriter.EndObject();
}

void operator()(JS::TrackedTypeSite site, const char *mirType) override {
void operator()(JS::TrackedTypeSite site, const char* mirType) override {
if (mStartedTypeList) {
mWriter.EndArray();
mStartedTypeList = false;
Expand Down

0 comments on commit fb729d0

Please sign in to comment.