Closed Bug 1885337 Opened 6 months ago Closed 6 months ago

Initial implementation of Uint8Array to/from base64 proposal

Categories

(Core :: JavaScript: Standard Library, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

No description provided.

Add preference for the proposal and implement to/from hex-string methods. The
initial implementation doesn't yet try to optimise allocations. For example as
a follow-up, we could directly allocate in the correct jemalloc arena instead of
first creating an intermediate js::Vector.

Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c514b57a1a81
Part 1: Implement to/from hex methods. r=dminor
https://hg.mozilla.org/integration/autoland/rev/9d1ed8863e3c
Part 2: Implement to/from base64 methods. r=dminor
https://hg.mozilla.org/integration/autoland/rev/13160371cd95
Part 3: Import tests from test262 PR. r=spidermonkey-reviewers,dminor

Backed out for causing bustages on TypedArrayObject.cpp

[task 2024-03-19T12:40:23.218Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2024-03-19T12:40:23.582Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:23.582Z] /builds/worker/fetches/clang/bin/clang++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -o StringType.o -c  -I/builds/worker/workspace/obj-spider/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DWASM_SUPPORTS_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/checkouts/gecko/js/src -I/builds/worker/workspace/obj-spider/js/src -I/builds/worker/checkouts/gecko/intl/icu_capi/c/include -I/builds/worker/workspace/obj-spider/dist/include -I/builds/worker/workspace/obj-spider/dist/include/nspr -I/builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-spider/js/src/js-confdefs.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -gdwarf-4 -Xclang -load -Xclang /builds/worker/workspace/obj-spider/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wenum-float-conversion -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wformat -Wformat-security -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -Werror=format -fstandalone-debug -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/StringType.o.pp   /builds/worker/checkouts/gecko/js/src/vm/StringType.cpp
[task 2024-03-19T12:40:23.582Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:23.582Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:23.582Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:23.582Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2024-03-19T12:40:23.582Z] js/src/jit/JSONSpewer.o
[task 2024-03-19T12:40:23.582Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2024-03-19T12:40:23.654Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:23.654Z] /builds/worker/fetches/clang/bin/clang++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -o TypedArrayObject.o -c  -I/builds/worker/workspace/obj-spider/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DWASM_SUPPORTS_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/checkouts/gecko/js/src -I/builds/worker/workspace/obj-spider/js/src -I/builds/worker/checkouts/gecko/intl/icu_capi/c/include -I/builds/worker/workspace/obj-spider/dist/include -I/builds/worker/workspace/obj-spider/dist/include/nspr -I/builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-spider/js/src/js-confdefs.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -gdwarf-4 -Xclang -load -Xclang /builds/worker/workspace/obj-spider/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wenum-float-conversion -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wformat -Wformat-security -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -Werror=format -fstandalone-debug -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/TypedArrayObject.o.pp   /builds/worker/checkouts/gecko/js/src/vm/TypedArrayObject.cpp
[task 2024-03-19T12:40:23.654Z] /builds/worker/checkouts/gecko/js/src/vm/TypedArrayObject.cpp:2969:19: error: variable has incomplete type 'JSStringBuilder'
[task 2024-03-19T12:40:23.654Z]  2969 |   JSStringBuilder sb(cx);
[task 2024-03-19T12:40:23.654Z]       |                   ^
[task 2024-03-19T12:40:23.654Z] /builds/worker/checkouts/gecko/js/src/wasm/WasmJS.h:64:7: note: forward declaration of 'js::JSStringBuilder'
[task 2024-03-19T12:40:23.654Z]    64 | class JSStringBuilder;
[task 2024-03-19T12:40:23.654Z]       |       ^
[task 2024-03-19T12:40:23.654Z] /builds/worker/checkouts/gecko/js/src/vm/TypedArrayObject.cpp:3083:19: error: variable has incomplete type 'JSStringBuilder'
[task 2024-03-19T12:40:23.654Z]  3083 |   JSStringBuilder sb(cx);
[task 2024-03-19T12:40:23.654Z]       |                   ^
[task 2024-03-19T12:40:23.654Z] /builds/worker/checkouts/gecko/js/src/wasm/WasmJS.h:64:7: note: forward declaration of 'js::JSStringBuilder'
[task 2024-03-19T12:40:23.654Z]    64 | class JSStringBuilder;
[task 2024-03-19T12:40:23.654Z]       |       ^
[task 2024-03-19T12:40:23.654Z] 2 errors generated.
[task 2024-03-19T12:40:23.654Z] gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:688: TypedArrayObject.o] Error 1
[task 2024-03-19T12:40:23.654Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:23.654Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2024-03-19T12:40:23.654Z] js/src/jit/Jit.o
[task 2024-03-19T12:40:23.654Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2024-03-19T12:40:24.338Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:24.338Z] /builds/worker/fetches/clang/bin/clang++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -o UbiNode.o -c  -I/builds/worker/workspace/obj-spider/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DWASM_SUPPORTS_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/checkouts/gecko/js/src -I/builds/worker/workspace/obj-spider/js/src -I/builds/worker/checkouts/gecko/intl/icu_capi/c/include -I/builds/worker/workspace/obj-spider/dist/include -I/builds/worker/workspace/obj-spider/dist/include/nspr -I/builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-spider/js/src/js-confdefs.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -gdwarf-4 -Xclang -load -Xclang /builds/worker/workspace/obj-spider/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wenum-float-conversion -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wformat -Wformat-security -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -Werror=format -fstandalone-debug -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/UbiNode.o.pp   /builds/worker/checkouts/gecko/js/src/vm/UbiNode.cpp
[task 2024-03-19T12:40:24.338Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:24.338Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:24.338Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src'
[task 2024-03-19T12:40:24.341Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2024-03-19T12:40:24.341Z] js/src/jit/JitContext.o
Flags: needinfo?(andrebargull)
Flags: needinfo?(andrebargull)
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6235925f0dc1
Part 1: Implement to/from hex methods. r=dminor
https://hg.mozilla.org/integration/autoland/rev/bfb8d23857e8
Part 2: Implement to/from base64 methods. r=dminor
https://hg.mozilla.org/integration/autoland/rev/3f87e310a83e
Part 3: Import tests from test262 PR. r=spidermonkey-reviewers,dminor
Severity: -- → N/A
Priority: -- → P2
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
Regressions: 1886451
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: