Closed Bug 1548729 Opened 7 months ago Closed 7 months ago

Move SourceHook-related functionality into its own public header for reduced dependencies

Categories

(Core :: JavaScript Engine, task, P1, minor)

task

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

It's not much, but it's a small and coherent set, and it reduces the reasons that vm/Runtime.h depends on (really, bootlegs :-\ ) #include "jsfriendapi.h".

Ideally this would have been in place before I started bug 1544882, because that involved a lot of touching of source hooks and resulting clobbers. :-( Better late than never.

Rather than add the usual js/public/SourceHook.h sort of header for this, I created a new js/public/experimental directory, with contents accessible as #include "js/experimental/*". Some things in friend API should just be public and stable, like the ArrayBuffer detaching APIs before I moved them recently. But other stuff really is not quite right -- and source hooks are one of those things, for reasons I explain in the comment adjustments in this patch. If we're going to clear out jsfriendapi.h, we need a place for dubious APIs like this. I think js/public/experimental is a reasonably sensible place.

Anyway -- nothing special in here really, mostly just moving code around and making mild tweaks to docs in the process. The js/public/experimental change of approach is the most interesting part of this for review purposes.

Priority: -- → P1
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/autoland/rev/45ff6c2d30e5
Move SourceHook-related functionality into its own public header for reduced dependencies.  r=jorendorff

Backed out changeset 45ff6c2d30e5 (bug 1548729) for SpiderMonkey failure at build/src/js/src/vm/SourceHook.cpp

Backout: https://hg.mozilla.org/integration/autoland/rev/a4b14e656ad8ab0dea0fde5970cf97fd301334e1

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=245806583&revision=45ff6c2d30e505ca7f6d1060f119ed3e713fc244

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=245870152&repo=autoland&lineNumber=3024

task 2019-05-10T22:58:11.967Z] /builds/worker/workspace/gcc/bin/g++ -o SharedImmutableStringsCache.o -c -I/builds/worker/workspace/build/src/obj-spider/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DWASM_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/js/src -I/builds/worker/workspace/build/src/obj-spider/js/src -I/builds/worker/workspace/build/src/obj-spider/dist/include -I/builds/worker/workspace/build/src/obj-spider/dist/include/nspr -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-spider/js/src/js-confdefs.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wformat -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -Werror=format -Wno-shadow -MD -MP -MF .deps/SharedImmutableStringsCache.o.pp /builds/worker/workspace/build/src/js/src/vm/SharedImmutableStringsCache.cpp
[task 2019-05-10T22:58:12.024Z] /builds/worker/workspace/build/src/js/src/vm/Scope.cpp: In function 'js::XDRResult XDRTrailingName(js::XDRState<(js::XDRMode)1u>, void, uint32_t*)':
[task 2019-05-10T22:58:12.024Z] /builds/worker/workspace/build/src/js/src/vm/Scope.cpp:248:22: warning: 'u8' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2019-05-10T22:58:12.024Z] uint8_t flags = u8 >> HasAtomShift;
[task 2019-05-10T22:58:12.024Z] ^
[task 2019-05-10T22:58:13.378Z] /builds/worker/workspace/gcc/bin/g++ -o SourceHook.o -c -I/builds/worker/workspace/build/src/obj-spider/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DWASM_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/js/src -I/builds/worker/workspace/build/src/obj-spider/js/src -I/builds/worker/workspace/build/src/obj-spider/dist/include -I/builds/worker/workspace/build/src/obj-spider/dist/include/nspr -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-spider/js/src/js-confdefs.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wformat -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -Werror=format -Wno-shadow -MD -MP -MF .deps/SourceHook.o.pp /builds/worker/workspace/build/src/js/src/vm/SourceHook.cpp
[task 2019-05-10T22:58:13.745Z] /builds/worker/workspace/gcc/bin/g++ -o Stack.o -c -I/builds/worker/workspace/build/src/obj-spider/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DWASM_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/js/src -I/builds/worker/workspace/build/src/obj-spider/js/src -I/builds/worker/workspace/build/src/obj-spider/dist/include -I/builds/worker/workspace/build/src/obj-spider/dist/include/nspr -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-spider/js/src/js-confdefs.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wformat -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -Werror=format -Wno-shadow -MD -MP -MF .deps/Stack.o.pp /builds/worker/workspace/build/src/js/src/vm/Stack.cpp
[task 2019-05-10T22:58:14.013Z] /builds/worker/workspace/gcc/bin/g++ -o StringType.o -c -I/builds/worker/workspace/build/src/obj-spider/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DWASM_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/js/src -I/builds/worker/workspace/build/src/obj-spider/js/src -I/builds/worker/workspace/build/src/obj-spider/dist/include -I/builds/worker/workspace/build/src/obj-spider/dist/include/nspr -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-spider/js/src/js-confdefs.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wformat -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -Werror=format -Wno-shadow -MD -MP -MF .deps/StringType.o.pp /builds/worker/workspace/build/src/js/src/vm/StringType.cpp
[task 2019-05-10T22:58:15.032Z] /builds/worker/workspace/gcc/bin/g++ -o StructuredClone.o -c -I/builds/worker/workspace/build/src/obj-spider/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DWASM_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/workspace/build/src/js/src -I/builds/worker/workspace/build/src/obj-spider/js/src -I/builds/worker/workspace/build/src/obj-spider/dist/include -I/builds/worker/workspace/build/src/obj-spider/dist/include/nspr -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-spider/js/src/js-confdefs.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wformat -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -Werror=format -Wno-shadow -MD -MP -MF .deps/StructuredClone.o.pp /builds/worker/workspace/build/src/js/src/vm/StructuredClone.cpp
[task 2019-05-10T22:58:15.376Z] /builds/worker/workspace/build/src/js/src/vm/SourceHook.cpp:21:34: error: 'SourceHook' was not declared in this scope
[task 2019-05-10T22:58:15.376Z] JS_FRIEND_API mozilla::UniquePtr<SourceHook> js::ForgetSourceHook(
[task 2019-05-10T22:58:15.376Z] ^~~~~~~~~~
[task 2019-05-10T22:58:15.376Z] /builds/worker/workspace/build/src/js/src/vm/SourceHook.cpp:21:34: note: suggested alternative:
[task 2019-05-10T22:58:15.376Z] In file included from /builds/worker/workspace/build/src/js/src/vm/SourceHook.cpp:13:0:
[task 2019-05-10T22:58:15.376Z] /builds/worker/workspace/build/src/obj-spider/dist/include/js/experimental/SourceHook.h:60:7: note: 'js::SourceHook'
[task 2019-05-10T22:58:15.376Z] class SourceHook {
[task 2019-05-10T22:58:15.376Z] ^~~~~~~~~~

Flags: needinfo?(jwalden)
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/autoland/rev/776f4df8561d
Move SourceHook-related functionality into its own public header for reduced dependencies.  r=jorendorff
Flags: needinfo?(jwalden)
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.