Closed Bug 1501129 Opened 2 years ago Closed 2 years ago
Searching for JSContext::enqueue
Promise Job Callback gives extraneous results
When searching mozilla-central fcfb479e, right-clicking on the definition of the field `JSContext::enqueuePromiseJobCallback` (at js/src/vm/JSContext.h:918) and choosing 'Search for field JSContext::enqueuePromiseJobCallback' gives me results including the unrelated fields 'JSContext::getIncumbentGlobalCallback' and 'JSContext::enqueuePromiseJobCallbackData'.
Screenshot showing what I'm clicking on.
Results of the search described above.
Note that the search field contains: symbol:F_<T_JSContext>_64,F_<T_JSContext>_65 If I edit that to read, instead: symbol:F_<T_JSContext>_65 then I get the right search results.
Everything after the ifdef at https://searchfox.org/mozilla-central/rev/fcfb479e6ff63aea017d063faa17877ff750b4e5/js/src/vm/JSContext.h#625 suffers from the same problem. Looks like the field symbols are numbered differently on Linux vs Mac but then get merged.
If we change the getFieldIndex() at  to something that's more stable in the face of ifdefs, such as the mangled location, that should fix this.  https://searchfox.org/mozilla-central/rev/fcfb479e6ff63aea017d063faa17877ff750b4e5/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp#401
Assignee: nobody → kats
In https://github.com/mozsearch/mozsearch/commit/94e792c3cee43cfc1064e9eaa1d896dc919c7434 the symbol for field decls was changed from `return std::string("F_") + decl->getQualifiedNameAsString();` to `return std::string("F_<") + GetMangledName(ctx, record) + ">_" + ToString(d2->getFieldIndex());` and it's not really clear why. Using the name instead of the index seems fine to me, and should avoid this problem. Using the name is superior to using the location because it should also handle cases like this: #ifdef MACOSX MacType var = new MacType(); #else LinuxType var = new LinuxType(); #endif var.baz(); because in this case we want `var` to match both the declarations although they would have different locations and the same name.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/23205c4744f0 Use field names instead of their index when mangling. r=mccr8
This is deployed now.
You need to log in before you can comment on or make changes to this bug.