Skip to content

Instantly share code, notes, and snippets.

@hotsphink
Created July 3, 2019 18:04
Show Gist options
  • Save hotsphink/1bf26ffd64745fbf1180d726bf7161d0 to your computer and use it in GitHub Desktop.
Save hotsphink/1bf26ffd64745fbf1180d726bf7161d0 to your computer and use it in GitHub Desktop.
mkgist-created gist
void JSString::traceBase(JSTracer* trc) {
MOZ_ASSERT(hasBase());
JSString* oldBase = d.s.u3.base;
if (I am a DependentString) {
base = my base
while (my chars do not come from base)
base = base.base
}
TraceManuallyBarrieredEdge(trc, &d.s.u3.base, "base");
if (oldBase != d.s.u3.base) {
char* oldBaseChars = oldBase->chars;
if (mychars is within oldBaseChars..length)
repoint to d.s.u3.base's chars
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment