Compare commits

...
Author SHA1 Message Date
Basilisk-Dev c3b18eb6d0 Issue #2229 Followup - Handle re-entrant module instantiation/evaluation during async module loads 2026-02-12 21:31:53 +01:00
Moonchild fd8ae1dc03 Adapt top-level await call to use context top-level interpreterStack() 2026-02-12 21:31:43 +01:00
Basilisk-Dev 8ed8eb4043 Issue #2229 - Add top level await tests 2026-02-12 21:31:29 +01:00
Basilisk-Dev 2f2e1cf9a4 Issue #2229 - Add comment regarding JIT to top level await code 2026-02-12 21:31:23 +01:00
Basilisk-Dev 1691120b77 Issue #2229 - add better comments on top level await code 2026-02-12 21:31:18 +01:00
Basilisk-Dev e99bd10fd6 Issue #2229 - Initial implementation of top level await functionality 2026-02-12 21:31:10 +01:00
Basilisk-Dev 4471ff57f1 Issue #2229 - Fix debug builds when visiting pages that utilize top-level await (port to idle-runnables)
Fix JSOP_AWAIT stack modeling for top‑level await in modules.
Ensure yield/await offsets are emitted for TLA scripts.
Allow interpreter prologue for resumed TLA module frames.
Fix MediaQueryList invariant for onchange handler.
2026-02-12 21:03:39 +01:00
win7-7 78f3924414 It has been long time tried adjust CC time. Same as idle runnables-rebase branch.
It has been long time tried  adjust CC time. Same as idle runnables-rebase branch.
2026-02-12 15:13:28 +02:00
win7-7 673b3a2e41 ASAN changes to fix assertions and stack and heap buffer overflow.
ASAN changes to fix assertions and stack and heap buffer overflow.

ASAN changes to fix assertions and stack overflow part 1 of ASAN changes.

Including: 1494030 - Fix an assertion,

1291413 - Fix assertion when resuming an Animation with both a start time and hold time,

1322770: Remove bogus assertion from SMIL motion code,

1322849 - Add a range check when the duration is multiplied by the repeat count,

1352453 - Check image dimension when computing border space size,

1359397 - Don't allow Selection in nodes not in the document (resolves some assertions),

1361052 - DeleteSelectionAndPrepareToCreateNode should be more safety (libeditor/EditorBase.cpp in UXP),

1381541 - queryCommandState should consider that parent node of selection is null,

1394405 - Relax the assertion in CalculateDistanceToEllipticArc to deal with the floating point precision problem,

1397795 - Fix stack overflow crash due to box-shadow,

1401726 - Fix crash in nsLabelsNodeList::PopulateSelf,

1407895 - ensure mDecoder->Suspend() is called on a newly created decoder if mPausedForInactiveDocumentOrChannel is true,

1418477 - Part 1. Should check error status of unum_open, no crash test so part 1 only.

1429523 - Make IMEContentObserver ignore character data change notifications of invisible data nodes,

1494380 - Ignore emphasis marks on combined text with horizontal writing mode,

1499099 - Clamp result codes to NS_ERROR_MODULE_DOM_FILEHANDLE result codes in ActorsParent,

1499854 - Binary should not be affected by locale,

1505817 - Handle the case where a float is dynamically inserted inside a continuation,

1507961 - Check that an SVG DOM item wasn't removed from its list before scheduling its animation update,

1536892 - Check a frame does maintain overflow before adding to OverflowChangedTracker,

1596516 - NodeIsBlockStatic should return false for non-element,

1614360 - Signal error to child on attempts to read beyond EOF instead of asserting,

1626970 - Use saturating operators to avoid scrolling position overflow,

1626973 - Add assertions for result of MaybeUpdateSize,

1626973 - Make attempt to increase the file size via IDBFileHandle.truncate an error,
2026-02-12 15:05:15 +02:00
win7-7 4c27b23edd 1330536
1330536

OOM changes to idls also.
2026-02-12 15:03:04 +02:00
win7-7 7b38654a95 Update graphite to 1.3.11 and OTS to 8.1.4 version like done in 55 branch.
Update graphite to 1.3.11 and OTS to 8.1.4 (this version had performance improvements specifically) version like done in 55 branch.
2026-02-12 14:58:14 +02:00
win7-7 6a6c6e6948 Uncertain where this change got lost?
Uncertain where this change got lost? Clean enough branch anyway.
2026-02-10 22:52:59 +02:00
Moonchild ca16a49df6 Merge pull request 'Return Standard Space to Formatted Times with Day Periods' (#2921) from RealityRipple/UXP:space-time into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2921
2026-02-10 22:49:18 +02:00
Moonchild a6fac29db0 Merge pull request 'Emoji 17.0 Support' (#2884) from RealityRipple/UXP:emoji-17.0 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2884
2026-02-10 22:49:02 +02:00
Moonchild aea8c85697 Merge pull request 'Update ICU to v78.1' (#2878) from RealityRipple/UXP:icu-78 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2878
2026-02-10 22:48:42 +02:00
win7-7 a5cc0f81cd Set slice time to 18ms. 15ms causes hang. 18ms seems work well.
Set slice time to 18ms. 15ms causes hang/does not work well with UXP even with idle runnables. 18ms seems work well.
2026-02-10 22:27:38 +02:00
win7-7 8503bd23b2 Set max nursery size in MB instead KB.
Set max nursery size in MB instead KB.
2026-02-10 22:27:38 +02:00
win7-7 cc9a54e012 1409380 - Simplify HeapSlot to make it trivially copyable remaining parts.
1409380 - Simplify HeapSlot to make it trivially copyable  remaining parts not done before, fixes memory corruption crash.
2026-02-10 22:27:37 +02:00
win7-7 020e5b6a4a 1455599 - Redo bug 1446693, creating separate AutoTraceSessions instead of expanding one
1455599 - Redo bug 1446693, creating separate AutoTraceSessions instead of expanding one
2026-02-10 22:27:36 +02:00
win7-7 33f0667072 Fix typo.
Fix typo.
2026-02-10 22:27:35 +02:00
win7-7 669c14c5e3 1445196 - Store the atom's pinned flag in the atom to simplify lookup
1445196 - Store the atom's pinned flag in the atom to simplify lookup.
2026-02-10 22:27:34 +02:00
win7-7 5c99d4d5d3 Implement a callback system for interrupting timed slice budgets for bug #1351790
Trying this again.
2026-02-10 22:27:34 +02:00
win7-7 48dd665fad Undo change it breaks compilation and issue is fixed, asserts no longer happen.
Undo change it breaks compilation and issue is fixed, asserts no longer happen.
2026-02-10 22:27:33 +02:00
win7-7 45749ad7f4 Add preference for nursery size. DOM aspects were done some time period already.
Add preference for nursery size. DOM aspects were done some time period already.
2026-02-10 22:27:32 +02:00
win7-7 b0bd4b316e This should work without further issues.
This should work without issues like using vector GCPtr in one location then non-GCPtr in another causing issues in tracing.
2026-02-10 22:27:32 +02:00
win7-7 6999af2ab5 Fix remaining errors from mixing two different approaches.
Fix remaining errors from mixing two different approaches.

Fix remaining errors without busting compilation.
2026-02-10 22:27:31 +02:00
win7-7 e7e1ad8b94 Crash is gone. Functionally seems work with indices. Going test with regexp zones and without to see this is ideal solution.
Crash is gone. Functionally seems work with indices. Going test with regexp zones and without to see this is ideal solution.
2026-02-10 22:27:31 +02:00
win7-7 62da3857f0 Attempt fix regexp crash. Not working.
Attempt fix regexp crash. Not working.
2026-02-10 22:27:30 +02:00
win7-7 87bddd59b2 Fix two asserts crashing properly instead bypassing that revealed bigger unsafe objectgroup sweeping during usage issue.
Fix asserts properly instead bypassing that revealed bigger unsafe objectgroup sweeping during usage issue.
2026-02-10 22:27:29 +02:00
win7-7 6087326c81 Fix last crashing assert.
Fix last crashing assert.
2026-02-10 22:27:29 +02:00
win7-7 36fc0bf9d9 903519 - Reparent JSString from TenuredCell to Cell last missed aspect.
903519 - Reparent JSString from TenuredCell to Cell last missed aspect.
2026-02-10 22:27:28 +02:00
win7-7 2faf80a38c 903519 - Done fully.
903519 - Change Relocated marker to not confuse string vs object bit, partially done before.
2026-02-10 22:27:27 +02:00
win7-7 2bff9a7549 Fix logic not invert that if some registers are left still give extra registry causing slower performance than only doing extra registry when needed.
Fix logic not invert that if some registers are left still give extra registry causing slower performance than only doing extra registry when needed.
2026-02-10 22:27:26 +02:00
win7-7 b00d4fec28 Temporary. It no longer crashes with tradera.com and Speedometer 2.1 works with those asserts bypassed. Time re-enable them soon.
Nursery strings no longer crashes with tradera.com and Speedometer 2.1.

These asserts now work after 903519 - Allocate strings in the nursery if enabled, leaving only one major assert left in jsgc.cpp.
2026-02-10 22:27:25 +02:00
win7-7 8290c9c0ca CodeGenerator.cpp missing JIT support for nursery, there was some missing implementation.
CodeGenerator.cpp missing JIT support for nursery, there was some missing implementation.
2026-02-10 22:27:24 +02:00
win7-7 1916baf095 1380030 fully.
1380030 - Remove color constants from public API and replace with an internal MarkColor enum.

1380030 - Simplify and refactor use of isMarked*() methods.

I only had one part of this before: Refactor isMarked() methods into separate methods for each color and any.
2026-02-10 22:27:24 +02:00
win7-7 23a3548be9 903519 - Allocate strings in the nursery if enabled
903519 - Allocate strings in the nursery if enabled, missed change somehow.
2026-02-10 22:27:23 +02:00
win7-7 fc63db48ea 903519 - Strings in the nursery: barriers
Cell.h was missed after headers split to nursery support. Third crash.
2026-02-10 22:27:22 +02:00
win7-7 9138bcd48c Enable nursery strings fixes from 67. Still crashes.
Enable nursery strings fixes from 67. Still crashes.
2026-02-10 22:27:21 +02:00
win7-7 60d479524d Enable nursery strings.
Enable nursery strings and see to fix crash:

1442481 - Use whole cell buffer to post-barrier string -> string edges
2026-02-10 22:27:20 +02:00
win7-7 84bd401f8f 1434263 - Refactor JSString to have an IsLinear flag instead of IsFlat.
1434263 - Refactor JSString to have an IsLinear flag instead of IsFlat. Fixes crash.
2026-02-10 22:27:18 +02:00
win7-7 2f3cd6c567 903519 - Disable nursery strings in a Zone if too many get tenured among with other fixes, won't fix startup crash assert though.
903519 - Disable nursery strings in a Zone if too many get tenured among with other fixes, won't fix startup crash assert though.

Also small fix for expanding macro correctly.
2026-02-10 22:27:17 +02:00
win7-7 0a35bbd8d8 903519 - Remove verifier assumption that only objects are in the nursery
903519 - Remove verifier assumption that only objects are in the nursery. This is only relevant after 55 verifier.
2026-02-10 22:27:17 +02:00
win7-7 f670baf367 Split up Heap.h to Cell.h and 903519 - Change Relocated marker to not confuse string vs object bit, RelocationOverlay.h aspect.
Split up Heap.h to Cell.h and 903519 - Change Relocated marker to not confuse string vs object bit, RelocationOverlay.h aspect.
2026-02-10 22:27:16 +02:00
win7-7 c5f65dd9a8 1328948 + 1421152 + 903519 forgotten part.
1328948 - add is(), as() to Cell.

903519 - Strings in the nursery: JIT, HeapAPI.h was forgotten.

1421152 - Add a checked cast method to TenuredCell.
2026-02-10 22:27:14 +02:00
win7-7 b1aa0b3005 Fixes for nursery strings
Fixes for nursery strings.

Also:

CacheIR nursery changes.

903519 - Strings in the nursery: barriers, one missed change.

Fixes to VMFunctions.cpp, assert no longer crashes.

Fixes. Now compiles and links, still crashes at atoms zone similar previous nursery strings.

Fixes. Now compiles and links, still crashes at atoms zone similar previous nursery strings.
2026-02-10 22:27:13 +02:00
win7-7 67749dde4e Comment out debug only code and change register types. This will not compile yet though to test how this would work.
Comment out debug only code  and change register types.
2026-02-10 22:27:12 +02:00
win7-7 82b3fde86b 903519 - Implement AutoSuppressNurseryCellAlloc to avoid nursery allocation just before offthread parse startup
903519 - Implement AutoSuppressNurseryCellAlloc to avoid nursery allocation just before offthread parse startup
2026-02-10 22:27:11 +02:00
win7-7 85f1525949 903519 - Split out string nursery pointers from object nursery
903519 - Split out string nursery pointers from object nursery, this was not done before.
2026-02-10 22:27:10 +02:00
win7-7 efe4acdcdc 1444335 - Nursery allocation is not infallible, even right after collecting the nursery
1444335 - Nursery allocation is not infallible, even right after collecting the nursery. Hoping this solves crash.
2026-02-10 22:27:09 +02:00
win7-7 06fae3bbee 903519 - Register nursery string buffers to be freed
903519 - Register nursery string buffers to be freed, this was missed somehow before.
2026-02-10 22:27:07 +02:00
win7-7 50cc1abd6e Bug 903519 - Strings in the nursery: JIT
Bug 903519 - Strings in the nursery: JIT, majority of it was not done before due CodeGenerator.cpp
2026-02-10 22:27:07 +02:00
win7-7 809e28a4b6 Fix more errors.
Fix more errors.
2026-02-10 22:27:05 +02:00
win7-7 a3cf793662 Sigh..
Sigh..
2026-02-10 22:27:04 +02:00
win7-7 0f4eb07ab3 Some more fixes.
Some more fixes.
2026-02-10 22:27:03 +02:00
win7-7 0d49538fa0 Bug 903519 - allocate JSStrings and string data in the Nursery
903519 part 2: Reparent JSString from TenuredCell to Cell.

903519 Part 3: Make js::Allocate cast strings to requested type.

903519 Part 4: Force non-atom strings to have their low flag bit set in order to distinguish them from JSObjects in the nursery.

903519 Part 5: Strings in the nursery: allocation.

Mixed reset later.
2026-02-10 22:27:03 +02:00
win7-7 ad00b0bc18 Various fixes.
Various fixes. INIT_ROPE_FLAGS does not exist in this time of js engine, unsure why it was added. String.h fix  closure. Don't comment out new code in Barrier.h. Mir.h change back to MAryInstruction<4>, since MQuaternaryInstruction does not work and calls MAryInstruction<4> anyway. Note this likely need  parts of 1412912  hopefully solve failing static asserts.
2026-02-10 22:27:02 +02:00
win7-7 2995dd0962 1464912 - Add exposeToActiveJS specialization for JSString.
1464912 - Add exposeToActiveJS specialization for JSString. Necessary for nursery.
2026-02-10 22:27:00 +02:00
win7-7 e1377fc428 Remaining file updated.
Remaining file updated.
2026-02-10 22:26:59 +02:00
win7-7 08d6d61763 903519 part 6 to 13 (partially)
903519 Part 6: Strings in the nursery: tracing and tenuring.

903519 Part 7: Strings in the nursery: barriers.

903519 Part 8: Discard nursery keys from EvalCache.

903519 Part 9:  Strings in the nursery: allow any thread to access zone of permanent atoms.

903519 Part 10: Strings in the nursery: MIR node.

903519 Part 11: Change Relocated marker to not confuse string vs object bit.

903519 Part 12: Default nursery strings to off, add ability to enable.

903519 Part 13: Strings in the nursery: JIT, partial due CodeGenerator.cpp differences startin from: // Follow any base pointer if the input is itself a dependent string.

This is due file changed: 1434230: Spectre mitigations for strings
2026-02-10 22:26:58 +02:00
win7-7 a6d09feaac Bug 903519- GC: allocate JSStrings and string data in the Nursery.
903519 part 1: Separate out AllocKinds for nursery-allocatable strings.

Rest of part TBD: Need  1350760 Atomizing strings needs to be faster first.
2026-02-10 22:26:57 +02:00
win7-7 35eea7ce13 60 level before nursery strings.
1421319 - Split out GCManagedDeletePolicy into its own header.

1434622 - Use a separate lock to protect the shared script data table.
2026-02-10 22:26:56 +02:00
win7-7 ed011d45a0 Compiles, links, does not crash. 59 GC.
Compiles, links, does not crash. 59 GC.
2026-02-10 22:26:54 +02:00
win7-7 c62b20a346 Fixes.
Mostly taking care of headers splitting.
2026-02-10 22:26:53 +02:00
win7-7 5dbc398c70 59 GC.
59 GC.
2026-02-10 22:26:52 +02:00
win7-7 8b65d92b16 58 GC no crashing.
Compiles link no crashing.
2026-02-10 22:26:51 +02:00
win7-7 162164d696 58 a1 GC. Trying see when issue with atoms started.
58 a1 GC. Trying see when issue with atoms started.
2026-02-10 22:26:50 +02:00
win7-7 0b62fbca1b Now it compiles, links and works, apparently 56 GC is stable, 57 next.
Now it compiles, links and works, apparently 56 GC is stable, 57 next.
2026-02-10 22:26:49 +02:00
win7-7 4fd23ad171 This does work.
This should work. Test gains.
2026-02-10 22:26:48 +02:00
Jon Coppeard 0029ce68f7 Bug 1369748 - Refactor GCRuntime::beginMarkPhase r=sfink 2026-02-10 22:26:47 +02:00
win7-7 6fde6918ca 56 GC fixes.
56 GC fixes.
2026-02-10 22:26:45 +02:00
win7-7 748cda448b 56 GC.
Trying narrow when atom crash started between 55 and 60 and if its easy to revert.
2026-02-10 22:26:45 +02:00
win7-7 7ee316e222 1345427 - Assertion failure: ins->type() == inputType, at js/src/jit/Lowering.cpp:1440
1345427: Effectively change output type of MNearbyInt when specializing to float32;
2026-02-10 22:26:44 +02:00
win7-7 a30748b6c1 1324566 - Inspector support for GlobalNameGetter, error fixed, march 28th 2024, there was backport of this but return false was accidentally leftover.
1324566 - Inspector support for GlobalNameGetter, error fixed, march 28th 2024, there was backport of this but return false was accidentally leftover.
2026-02-10 22:26:43 +02:00
win7-7 5ca4973c24 1344173 - Fix performance cliff involving OBJECT_FLAG_ITERATED and array natives also includes 1323782.
1344173 - Fix performance cliff involving OBJECT_FLAG_ITERATED and array natives.

1323782: Check iterated-flag before proceeding to fast path in Array.prototype.unshift.
2026-02-10 22:26:42 +02:00
win7-7 6cf9b4f1cc 1370210 - obj_propertyIsEnumerable calls non-inlined IsSymbolOrSymbolWrapper
1370210 - Optimize ValueToId and ValueToIdPure to check the common cases first
2026-02-10 22:26:41 +02:00
André Bargull a9e9f17f21 Bug 1379222 - Avoid [[Get]] for "prototype" property when calling builtin constructors. r=jandem 2026-02-10 22:26:40 +02:00
win7-7 60ce685877 Accidental addition/regression from may 2025 merge. Took what was not needed and caused multi-threading regression for parsing.
Accidental addition/regression from may 2025 merge. Took what was not needed and caused multi-threading regression for parsing.
2026-02-10 22:26:39 +02:00
win7-7 04543c9a5f Security fixes toward 105 version.
Security fixes toward 105 version.
2026-02-10 22:26:38 +02:00
win7-7 1c4079afa1 Security fixes toward 71 version.
Security fixes toward 71 version.
2026-02-10 22:26:38 +02:00
win7-7 8c2b265a8b More security fixes toward 67 version.
More security fixes toward 67 version.
2026-02-10 22:26:37 +02:00
win7-7 17041fdc63 Somewhat 60 level of security.
Somewhat 60 level of security.
2026-02-10 22:26:35 +02:00
win7-7 03c84bbbca Security fixes toward Firefox 58 level but might miss some. Check later.
Security fixes toward Firefox 58 level but might miss some. Check later.
2026-02-10 22:26:35 +02:00
win7-7 f6850a589b 1354527 - Crash [@ js::jit::RInstructionResults::operator[]]
1354527 - Recover the iterator object when closing during exception handling.
2026-02-10 22:26:34 +02:00
win7-7 1588f2afa2 1352506 - Ion: Automatically call gen->setPerformsCall() if a LIR instruction performs a call
1352506: Remove dead code in the backtracking allocator;

1352506: Automatically setPerformsCall for LIR call instructions.

1352506: Don't conflate need for overrecursed check and static alignment in MIRGenerator;
2026-02-10 22:26:34 +02:00
win7-7 033215e209 1331900 - Delete Label's assignment operator.
Hiding it => linking error.
Deleting it => compilation error.
2026-02-10 22:26:33 +02:00
win7-7 898ed3bc61 Bug 1405457 - Scalar replacement for call objects. r=nbp
Scalar replacement for call objects, should make arrow-declare six-speed test faster.
2026-02-10 22:26:32 +02:00
win7-7 8ea5bb28b7 1355155 - Scalar replacement for arrow functions.
1355155 - Scalar replacement for arrow functions.
2026-02-10 22:26:31 +02:00
win7-7 fb2b365c6c 1358599 - Use runtime guards for jitcode pre-barriers instead of patchable jumps, leftover/accidental reintroduction by CacheIR backporting.
1358599  - Use runtime guards for jitcode pre-barriers instead of patchable jumps, leftover/accidental reintroduction by CacheIR backporting.
2026-02-10 22:26:30 +02:00
win7-7 08306d01aa 1325480 - Baldr: make WasmInstanceObject::ExportMap a strong edge
1325480 - Baldr: make WasmInstanceObject::ExportMap a strong edge
2026-02-10 22:26:29 +02:00
win7-7 ceeb83c9fc 1339089 - Inline floor/ceil/trunc/nearest for floating-point values when we have adequate SSE support
1339089: Inline floor/ceil/trunc/nearest in Ion when we have sse4.

1339089: Inline wasm::floor/trunc/nearest/round in the baseline compiler too;
2026-02-10 22:26:28 +02:00
win7-7 927c8dba60 1316831 - Wasm baseline: Disable bounds checking on constant accesses below the minimum heap length
1316831 - wasm baseline, omit known-good bounds checks

Also includes 1353347 - wasm baseline, properly chop int32 constants to 32 bits.
2026-02-10 22:26:27 +02:00
win7-7 ad71c61e5c 1337444 - wasm: runtime crash involving i64 globals
1337444: Fix regalloc of load/store i64 globals;
2026-02-10 22:26:26 +02:00
win7-7 b11a859e6d 1335068 - Wasm: Split the global allocation out of the CodeSegment
1335068 - Break wasm globals out of the code segment.
2026-02-10 22:26:25 +02:00
win7-7 0ab393bd49 Bug 1312751 - Merge ARM load and store code for Wasm
1312751 - Refactor wasm{Load,Store}{,I64} to MacroAssembler-arm.

1312751 - Wasm baseline, use refactored ARM load/store methods.
2026-02-10 22:26:25 +02:00
win7-7 cb552b8657 1330339 - Assertion failure: !done() && debugEnabled(), at js/src/wasm/WasmFrameIterator.cpp:223
1330339 - Ensure wasm debug is enabled when observesFrame is queried.
2026-02-10 22:26:24 +02:00
win7-7 5a11af8bcb 1330491 - Assertion failure: maybeBytecode, at js/src/wasm/WasmCode.cpp:581 with Debugger
1330491 - Always provide wasm bytecode for debuggable instance.
2026-02-10 22:26:23 +02:00
win7-7 e2de83aad8 1331064 - Assertion failure: throwing, at js/src/jscntxt.cpp:946 with wasm and Debugger
1331064 - Ignore wasm onExceptionUnwind events in JSTRAP_ERROR state.
2026-02-10 22:26:23 +02:00
win7-7 2df733d7fd 1331592 - Assertion failure: data_.state_ == INTERP, at js/src/vm/Stack.cpp:495 with Debugger and wasm
1331592 - Skipping wasm frames during debugger eval.
2026-02-10 22:26:22 +02:00
win7-7 7ac82abc5c 1332493- Crash [@ js::wasm::Instance::object]
1332493 - Initialize wasm::DebugFrame before stack overflow check.
2026-02-10 22:26:21 +02:00
win7-7 6478698341 1342497 - Baldr: store current frame, not previous frame, in wasm::FrameIterator
1342497 - Baldr: store current frame, not previous frame, in wasm::FrameIterator.
2026-02-10 22:26:21 +02:00
win7-7 7b321d26d9 1330489 - Crash [@ mozilla::UniquePtr<JS::ubi::EdgeRange, JS::DeletePolicy<JS::ubi::EdgeRange> >::operator->] with wasm and Debugger
1330489 - Ignore imports for wasm debug frames and discard frames in activation on throw.
2026-02-10 22:26:19 +02:00
win7-7 1e51d96f98 1331452 - jit-test/tests/debug/wasm-06.js failures with CGC builds
1331452 - Keep scope in a slot in WasmFunctionCallObjects.

1331452 - Followup: hazard fix.
2026-02-10 22:26:18 +02:00
win7-7 a5b5abc4f6 1286948
1286948 - Adds debug mode for WASM baseline compiler.

1286948 - Adds scope and environment for wasm calls (Adds artificial JS scope and environment for wasm frames. That allows
debugger to properly handle call stack).

1286948 - Adds prolog and epilog debug traps and handlers (Using toggled call/traps to invoke handler to process enter and leave
frame events).

1286948 - onEnterFrame/onLeaveFrame wasm events and callstack (Handles onEnterFrame and onLeaveFrame trap handling. The FrameIter is used in
the DebuggerFrame instead of ScriptFrameIter. The debug wasm frame is created
and can be found on callstack during those event).

Does not compile without 1331452 - Keep scope in a slot in WasmFunctionCallObjects along with 1335773 - Inspects wasm function locals to build
2026-02-10 22:26:18 +02:00
win7-7 e246906797 1326027: Remove RawF32 and RawF64;
1326027: Remove RawF32 and RawF64;

I did not do 1326027: include SSE2 flags in autospider due they were not even in js/src/moz.build so does SSE2 matter to UXP?
2026-02-10 22:26:17 +02:00
win7-7 a950eb10bd 1342045: Allow wasm::Memory of size 2**32
1342045: Allow wasm::Memory of size 2**32
2026-02-10 22:26:16 +02:00
win7-7 d763fb962f Bug 1332772 - Baldr: tweak memory/table limits
1332772 - Baldr: tweak memory/table limits
2026-02-10 22:26:14 +02:00
win7-7 10f707a3a1 Bug 1324008 Baldr: tweak internal limits to match other browsers
1324008 - Baldr: tweak internal limits to match other browsers.
2026-02-10 22:26:14 +02:00
win7-7 897f7ba4e0 1329096 + 1316814
1316814 - Split wasm iterator's readEnd and popEnd.

1316814 - wasm baseline, use the iterator's control stack.

1329096 - Wasm baseline, remove the label pool and use NonAssertingLabel instead.

 1316814 is for preparation later for 1277562 (
Wasm: tiered compiler).
2026-02-10 22:26:13 +02:00
win7-7 f3b6294930 1326160 Wasm baseline: Division by nonzero constants can omit divide-by-zero check
1326160 - Omit divide by zero and overflow checks for some constants
2026-02-10 22:26:12 +02:00
win7-7 666c465c6e 1316803 Wasm baseline: fold constant rhs into integer operations
1316803 part 1 - fold constant rhs for add/sub/shift/rotate/bitwise-ops.

1316803 part 2 - optimize division for constant rhs.
2026-02-10 22:26:12 +02:00
win7-7 60dd4c4aea 1318252 - Baldr: Serialize Import's DefinitionKind
Otherwise, all imports are treated as function imports after deserialization. Fixes crash with 1321122.
2026-02-10 22:26:11 +02:00
win7-7 b70f7c449f 1329018 Wasm: Move validation to helper threads, also 1317678
1329018 - Part 1: Wasm: Add plumbing for compile threads to report validation errors.

1329018 - Part 2: Wasm: Move function validation to helper threads.

Also: 1317678 - don't unconditionally unroll stack probe loop
2026-02-10 22:26:11 +02:00
win7-7 3a91992122 1321122 - Baldr: add Module.customSections.
1321122 - Baldr: add Module.customSections.

As added here:
  https://github.com/WebAssembly/design/pull/877
2026-02-10 22:26:10 +02:00
win7-7 8792e5f907 Don't undo progress on batch compilation accidentally.
Don't undo progress on batch compilation accidentally.
2026-02-10 22:26:09 +02:00
win7-7 d265ecf533 1316634 - Implement efficient WebAssembly.validate
1316634: Use ModuleEnvironment in the FunctionDecoder.

1316634: Move function validation to WasmBinaryFormat.h/cpp && rename it WasmValidate.

1316634: Implement efficient WebAssembly.validate

1316634: Use CheckedInt before checking against maximum limits
2026-02-10 22:26:07 +02:00
win7-7 a8ac2d6ccf 1455703: Check for OOM in AstDecodeModuleTail
1455703: Check for OOM in AstDecodeModuleTail.
2026-02-10 22:26:06 +02:00
win7-7 003da6a7e4 1317319 wasm: Factor out section decoding, Part 2
1317319: Factor out Table section decoding.

1317319: Factor out Global section decoding.

1317319: Factor out Export section decoding.

1317319: Factor out Start section decoding.

1317319: Factor out Elem section decoding.

1317319: Move sections decoding around to follow their order in the binary.

1317319: Rename ModuleGeneratorData to ModuleEnvironment.

1317319: Embed most section decoding under DecodeModuleEnvironment.

1317319: Account imported globals when checking against the maximum number of globals.

1317319: Fix BinaryToAST function validation.

Fix error losing PrevEncodingVersion when refactoring for 1317319  part 2.

1317319: Tweak AstDecodeFunctionBody;
2026-02-10 22:26:05 +02:00
win7-7 55c9947973 1298139 - Make LoopUnroller code handle OOM correctly
1298139 - Make LoopUnroller code handle OOM correctly
2026-02-10 22:26:04 +02:00
win7-7 9ea9b8793a 1331414: Adding javascript.options.jit.full_debug_checks in about:config for people that want to use debug builds for surfing with less slowdown
1331414: Adding javascript.options.jit.full_debug_checks in about:config for people that want to use debug builds for surfing with less slowdown
2026-02-10 22:26:03 +02:00
win7-7 fed7baf263 Stability fixes backporting.
1438645 - Prevent XDR from reading past its buffer.,

1325345 - Add compartment asserts to JS_FireOnNewGlobalObject and other APIs.

1339411 - Rewrite and optimize object allocation paths, NatibeObject.h, NativeObject-inl.h and jsiter.cpp were not updated use  JS::Result for stability, do that now.
2026-02-10 22:26:02 +02:00
win7-7 9e75845266 1370922 - [Ion] Handle allocation failure when generating Math.min.
1370922 - [Ion] Handle allocation failure when generating Math.min.
2026-02-10 22:26:01 +02:00
win7-7 e45cb88878 This change to add 1316078 part 4 - Add a script decoder as a valid off-main-thread parse-task was missed.
This change to add 1316078 part 4 - Add a script decoder as a valid off-main-thread parse-task was missed.
2026-02-10 22:26:00 +02:00
win7-7 4a99d09f02 Typo fix.
Typo fix.
2026-02-10 22:25:58 +02:00
win7-7 757f24959b Mix 55 js engine backporting mostly bugfixes.
1369337 - Forcibly create length and @@iterator properties for arguments when redefining.

1369680 - Use HasOwnProperty when resolving lazy properties to avoid triggering proxy traps in the proto-chain.

1319443 - Fix GlobalScopes XDR to encode global function bindings.

1335571 - Use template craziness to allow covering more cases with compartment asserts.
2026-02-10 22:25:58 +02:00
win7-7 dc85af6ba8 Performance improvements jit
1322724: IonMonkey - Add the hit count information on the extra false branch blocks

1322932: IonMonkey - Only iterate the backedge of the inner-loop when it has already be visited

1329901 - Remove expensive isObservableOperand() loop guards.

1330667: IonMonkey - Create a new constant for every optimized arguments use.

1342016 - Fast-path for isObservableSlot().

1388045 - Branch Pruning: Check the compile info associated with the resume point.
2026-02-10 22:25:57 +02:00
win7-7 fca751f98e 1357680 and followup security fixes.
1357680 part 1 - Track Ion-inlined scripts explicitly so we can inline functions with unknown properties.

1357680 part 2 - Remove unnecessary setNewGroupUnknown call in SetClassAndProto.

1357680 part 3 - Don't mark the new group as having unknown properties when changing an object's proto.

1365518 - Fix polymorphic inlining to work correctly for functions that had their group/proto changed.

1368570 - Fix js::FinishCompilation to handle OOM correctly.

1395919 - Don't copy the unknown-properties flag in AddPropertyTypesAfterProtoChange.

1544386 part 1 - Call ElementAccessHasExtraIndexedProperty instead of ArrayPrototypeHasIndexedProperty when inlining array natives.

1538006 - Propagate unknownProperties when changing prototype.

1538006 - Don't emit unbarriered writes to an object if its group might change.
2026-02-10 22:25:56 +02:00
win7-7 436cac2aae Two lines in this file were missed when doing 1342856 - Optimize volatile register spilling for C++ calls from IC stubs
Two lines in this file were missed when doing 1342856 - Optimize volatile register spilling for C++ calls from IC stubs, fixed now.
2026-02-10 22:25:55 +02:00
win7-7 a14efb1be1 Performance not previously done CacheIR changes.
1331136 - Handle more StringChar cases with ropes in CacheIR.

1325358 - Reuse stack-slots, that we couldn't pop, for spilling in CacheIR.
2026-02-10 22:25:55 +02:00
win7-7 1e31121536 Assert fixes and sec-fix.
Bug 1335146: IonMonkey - Don't do flow-aa on blocks without entry predecessor.

1329665 - Use fallible allocator in FlowAliasAnalysis::saveStoreDependency.

1329651: IonMonkey - Ensure ballast in EliminateDeadResumePointOperands.

Sec-fix: 1355050 - Root the RegExpShared in RegExpMacroAssembler

1375436: Assertion failure: throwing, at js/src/jscntxt.cpp:1466 with Debugger and async

Fix typo while at it in CodeGenerator.cpp
2026-02-10 22:25:53 +02:00
win7-7 4b67182981 Master merge.
Master merge. .setStreams(streams) was missing Issue #1442 - Part 2: Add a run-time preference for toggling the streams API one part somehow get that in now also.
2026-02-10 22:25:52 +02:00
win7-7 376878aa66 Fixes.
Fixes.
2026-02-10 22:25:51 +02:00
win7-7 acd54a760f Master merge.
Master merge.
2026-02-10 22:25:49 +02:00
win7-7 4ae3992196 Part of previous merge.
Part of previous merge.
2026-02-10 22:25:47 +02:00
win7-7 04ff0b2684 Merge remote-tracking branch 'Upstream/master' into scheduling-alternative-approach-to-idle-runnables-performance-gains-if-this-works 2026-02-10 22:25:47 +02:00
win7-7 3ca0db054d Fix.
Fix.
2026-02-10 22:25:44 +02:00
win7-7 294e90ec3a Merge branch 'master' into scheduling-alternative-approach-to-idle-runnables-performance-gains-if-this-works 2026-02-10 22:25:44 +02:00
win7-7 650c4920b6 Merge branch 'master' into scheduling-alternative-approach-to-idle-runnables-performance-gains-if-this-works 2026-02-10 22:25:43 +02:00
win7-7 3b78615f67 Merge branch 'master' into Try-increase-CC-timing 2026-02-10 22:25:41 +02:00
win7-7 8f8e0099ce Revert "1294042 - Implement the folding of MPow"
This reverts commit 68518438a3.

Major performance regression, not worth of taking in.
2026-02-10 22:25:40 +02:00
win7-7 09543f3b58 1388014 - LIRGenerator/CodeGenerator snapshot code should be faster
1388014 part 1 - IonMonkey: Devirtualize MResumePoint::getOperand function calls.

1388014 part 2 - IonMonkey: Simplify RValueAllocation hash function.
2026-02-10 22:25:39 +02:00
win7-7 9e075cd1be 1294042 - Implement the folding of MPow
1294042 - Implement constant folding for MPow.

Fold MPow instructions that have constant `x` and `p` arguments.
2026-02-10 22:25:39 +02:00
win7-7 37fe0a8196 1368626 - NativeSetProperty should have a fast-path when adding a new property to avoid unnecessary property lookups
1368626 - Avoid duplicate lookups when setting a new property.
2026-02-10 22:25:38 +02:00
win7-7 ff4a5cc5a3 1367815, only GC was added assert but ProxyObject.cpp was not changed.
Testing.1367815, only GC was added assert but ProxyObject.cpp was not changed.
2026-02-10 22:25:37 +02:00
win7-7 7535b80380 1400278 - Fix non-unified build bustage.
1400278 - Fix non-unified build bustage.

Style check bustage fix also.
2026-02-10 22:25:37 +02:00
win7-7 b543fdae43 1333757 - one assert was missed.
1333757 - one assert was missed.
2026-02-10 22:25:36 +02:00
win7-7 477c3e35d2 1324002 - two missed assert changes.
1324002 - two missed assert changes.
2026-02-10 22:25:36 +02:00
win7-7 4b01dc6395 1360372 - Avoid rooting hazard when entering atoms compartment
This patch avoids a rooting hazard involving the atoms compartment. There is code in jsatom.cpp that enters the atoms compartment while unrooted pointers are on the stack. Now that enterZoneGroup can potentially yield, this leads to a rooting hazard. This patch avoids the hazard by using a totally separate path that avoids enterZoneGroup when entering the atoms compartment.
2026-02-10 22:25:35 +02:00
win7-7 abd5276c61 1455709 - Assertion failure: bytes_ >= bytesAtStartOfGC_, at js/src/gc/GC.cpp:2040
1455709 - Assertion failure: bytes_ >= bytesAtStartOfGC_, at js/src/gc/GC.cpp:2040
2026-02-10 22:25:34 +02:00
win7-7 4176ed9098 Fixes crash with one website. Found reproducible crash. This fixes it.
Fixes crash with one website. Found reproducible crash. This fixes it.
2026-02-10 22:25:34 +02:00
win7-7 9cbfc62d2a Revert "1376614 - Pass budget to forgetSkippable and return early when budget has been used"
This reverts commit d28a0aef50.
2026-02-10 22:25:33 +02:00
win7-7 43df3239b7 Compiles with idle runnables.
Compiles with idle runnables.
2026-02-10 22:25:33 +02:00
win7-7 c61a6fa2bf Revert part 5 also. It does depends on part 4.
Revert part 5 also. It does depends on part 4.
2026-02-10 22:25:32 +02:00
win7-7 3660d00404 Compiles, crashes.
Compiles, crashes.
2026-02-10 22:25:31 +02:00
win7-7 33418ae43e Trying adjust some functions. nsIEventTarget does not exists until later due xpcom changes that are not ported.
Trying adjust some functions. nsIEventTarget does not exists until later due xpcom changes that are not ported.
2026-02-10 22:25:31 +02:00
win7-7 30d6409291 Removing #ifdef RELEASE_OR_BETA.
Removing  #ifdef RELEASE_OR_BETA.
2026-02-10 22:25:30 +02:00
win7-7 1e6b2b95a5 Seems overrides are not necessary for this version unlike for Mozilla since they do not override base class memebers anyway?
Seems overrides are not necessary for this version unlike for Mozilla since they do not override base class memebers anyway?
2026-02-10 22:25:30 +02:00
win7-7 c46e5b2b93 Fix idle runnable DOM issues 1367905 fixes.
Fix idle runnable DOM issues 1367905 fixes.

Sadly this still does not compile. It just get further.

nsThreadUtils.cpp is still not fully fixed and nsCOMPtr.h has some conversion errors.
2026-02-10 22:25:29 +02:00
win7-7 bcf0f04055 Fix compilation of do_CreateInstance
Fix compilation of do_CreateInstance.
2026-02-10 22:25:29 +02:00
win7-7 1a5ec9e224 Fallout from mozilla version of file.
Fallout from mozilla version of file.
2026-02-10 22:25:28 +02:00
win7-7 a009851751 Part 4 reverting. UniquePtr breaks compilation.
Part 4 reverting. UniquePtr breaks compilation.
2026-02-10 22:25:27 +02:00
win7-7 dedd55b991 1325254 - optimize TimerThread data structures
1325254 P1 Make TimerThread::mTimers store RefPtr<nsTimerImpl> objects.

1325254 P2 Make TimerThread list store an entry struct and just drop nsTimerImpl ref on cancel.

1325254 P3 Sort TimerThread list as a binary heap.

1325254 P4 Dynamically allocate Entry structs stored in TimerThread::mTimers.

1325254 P5 Make nsITimer::Cancel() O(c).
2026-02-10 22:25:27 +02:00
win7-7 2bf997c51c Need 1325254 and get rid of Value without part 4.
Need 1325254 and not have Value without part 4.
2026-02-10 22:25:26 +02:00
win7-7 254f564e3a Just import file from Mozilla.
Just import file from Mozilla.

It does help with templates but of course there is another issue.
2026-02-10 22:25:26 +02:00
win7-7 41b2b25fba 1358476, add support for timeout when doing idle dispatch
Templates suck. I cannot make this work likely.
2026-02-10 22:25:25 +02:00
win7-7 6c5b21a797 1311425 - Make requestIdleCallback aware of timeouts.
Prepare for handling several sources of idleness.

Make idle callbacks aware of nsITimers.

Add pref for how far into the timer queue.

1311425 - Avoid expiration timers when scheduling idle runnables.

review comment fix to ensure low priority timers aren't taken into account when calling NS_GetTimerDeadlineHintOnCurrentThread.
2026-02-10 22:25:24 +02:00
win7-7 bf3e7af29f 1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable
1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable.
2026-02-10 22:25:24 +02:00
win7-7 9646b840ef 1371242 - Investigate if CC slices could use idle periods more likely
1371242, try to run CC slices more likely during idle periods.
2026-02-10 22:25:23 +02:00
win7-7 2a1c4025e1 I might revert this depending what it does on outside Android in memory usage since its Android relevant.
1397864, put back the higher GC budget when GC is triggered by a timer
2026-02-10 22:25:23 +02:00
win7-7 0a0fef3558 1368972 - Increase slice time for long-running incremental GCs
1368972 - Increase slice time for long-running incremental GCs when CC has tried to run.
2026-02-10 22:25:22 +02:00
win7-7 161fdb9678 1376614 - Pass budget to forgetSkippable and return early when budget has been used
1376614 - Pass budget to forgetSkippable and return early when budget has been used,
2026-02-10 22:25:22 +02:00
win7-7 0ce44a4d85 1373067 - Ensure CC isn't started too often
1373067 - Ensure CC isn't started too often.
2026-02-10 22:25:21 +02:00
win7-7 18cb298419 1367905 - Try to run GC/CC slices, including forgetSkippable, during idle time
1367905 - Try to run GC/CC slices, including forgetSkippable, during idle time.

1367905 - Try to run GC/CC slices, including forgetSkippable, during idle time, tweaks to keep reftest memory usage lower.
2026-02-10 22:25:20 +02:00
win7-7 9792c469dc 1436697 - Heap growth factor limits are too low
1436697 - Fix GC heap growth factor limits.
2026-02-10 22:25:20 +02:00
win7-7 0ef44cdb4d 1314169 - Move the WasmFaultHandler to last priority on Windows ASan builds.
Fix ASAN. It no longer crashes at start.

Win64 ASan relies on a VectoredExceptionHandler to create shadow memory regions on demand.

If WasmFaultHandler gets the exception first, it can itself fault while looking at shadow memory, leading to an infinite recursion.

Unfortunately, due to an ordering problem, we also have to disable the MemoryProtectionExceptionHandler when we do this.
2026-02-10 22:25:19 +02:00
win7-7 e3ab588bf5 1341889 - Add some other checks to determine where realloc is going wrong
1341889 - Part 1: Add more checks during reallocation to rule out other possibilities.

1341889 - Part 2: Add a hazard suppression for malloc_usable_size.
2026-02-10 22:25:19 +02:00
win7-7 a05a915234 1329499 - Extend PageProtectingVector to detect poison patterns + 1332594 - Detect poison in AssemblerBuffer resulting from calling realloc
1329499 - Part 1: Detect the jemalloc freed memory poison pattern during append calls.

1329499 - Part 2: Keep outside actors from messing with our old buffer during realloc.

1332594 - Part 1: Simplify PageProtectingVector and make it initialize new buffers.

1332594 - Part 2: Check AssemblerBuffer for corruption during realloc.
2026-02-10 22:25:18 +02:00
win7-7 da0a89706f Revert "1675153"
This reverts commit dc6b803b6a222646a517caed538a64ebb2db2b64.
2026-02-10 22:25:17 +02:00
win7-7 6fb1553f34 1341093 - Some of this was missed when working on malloc incremental trigger while taking one part.
1341093 - Transfer malloc bytes when zones are merged.
2026-02-10 22:25:17 +02:00
win7-7 025d9cd3b6 1393597 - NotifyOffThreadScriptLoadCompletedRunnable hangs a lot
1393597 - Remove FinishIncrementalGC when merging compartments.
2026-02-10 22:25:16 +02:00
win7-7 6f870e6621 1371908 - GlobalHelperThreadState::mergeParseTaskCompartment finishes GC at random times
1371908 - When merging compartments only finish an ongoing GC if it affects the destination compartment.
2026-02-10 22:25:16 +02:00
win7-7 58247b5a5d 1406438 - GCRuntime::allNonEmptyChunks should be called under the GC lock
1406438 - Ensure GC lock held when iterating all non-empty chunks.
2026-02-10 22:25:15 +02:00
win7-7 070e541e22 1343363 - RegExp.prototype[@@replace] needs to clone input regexp for elem-base path
1343363 - Check RegExp wasn't modified in RegExp.p.@@replace global elem-base optimized path.
2026-02-10 22:25:15 +02:00
win7-7 df66d12e2c 1359421 - Simplify/optimize SharedContext::isFunctionBox
1359421 - Simplify/optimize SharedContext::isFunctionBox by removing an unnecessary virtual call.
2026-02-10 22:25:14 +02:00
win7-7 104315b443 1371097 - String.replace() could be faster
1371097 - Change sRopeMatchThresholdRatioLog2 from 5 to 4 to flatten less eagerly.
2026-02-10 22:25:13 +02:00
win7-7 8995f0e3c7 1371215 - Some string matching improvements
1371215 part 1 - Use the memchr optimization on OS X too, as it's fast now.

1371215 part 2 - Remove FirstCharMatcher16bit as it's not used much and has some perf issues.

1371215 part 3 - Optimize and simplify Matcher a bit more.
2026-02-10 22:25:13 +02:00
win7-7 5b8dee7d63 1370208 - Inline Boolean when called as a function
1370208 - Inline Boolean constructor when called as a function.
2026-02-10 22:25:12 +02:00
win7-7 38b1d92694 1351947 - Skiplist tower height probability distribution is skewed
1351947 - Remove bias in skiplist tower height.

This was generating a random int, counting number of consecutive low-order bits, and returning max(that, 1), which would result in a 3/4 chance of returning 1, 1/8 of returning 2, 1/16 of returning 3, etc. But we don't want the spike in probably at height 1. So instead, just add one to the number of bits to get a plain ½^i distribution of i=1..MAX_HEIGHT.
2026-02-10 22:25:12 +02:00
win7-7 fbbc365add 1365793 - JSONParser::readString() is slower than it needs to be on Windows because of isxdigit()
1365793 - JSONParser::readString() is slower than it needs to be on Windows because of isxdigit().
2026-02-10 22:25:11 +02:00
win7-7 5f0e784b0d 1346543.
1346543.
2026-02-10 22:25:11 +02:00
win7-7 36507d038e 1356207 - Optimize ToLength better with Ion
1356207 - Optimize self-hosted ToLength better with Ion.
2026-02-10 22:25:10 +02:00
win7-7 a5ad431906 1354974 - Array.slice(2**31) is always an empty array
1354974: Handle array indices greater than 2^31-1 when collecting indices for Array.prototype.slice.
2026-02-10 22:25:09 +02:00
win7-7 cc2924c849 1344476 - Add helper function to emit JSOP_POP or JSOP_POPN for given amount
1344476 - Add BytecodeEmitter::emitPopN to emit shorter bytecode for given pop count.

Actually use this helper function instead just having added it before already.
2026-02-10 22:25:09 +02:00
win7-7 51ec51fba4 1354554 - Remove iterator result object from the stack before the back edge in for-of loop to optimize more in JIT
1354554 - Remove iterator result object from the stack and place IteratorNext at the top of the loop to avoid having unnecessary values at the backedge.
2026-02-10 22:25:08 +02:00
win7-7 8493e93420 1354212: Fix source representation for async generators created through AsyncGenerator intrinsic.
1354212: Fix source representation for async generators created through AsyncGenerator intrinsic.

For ASAN testing. I don't care fixing tests.
2026-02-10 22:25:07 +02:00
win7-7 5af12f8590 1357330.
1357330.
2026-02-10 22:25:07 +02:00
win7-7 05b75de999 1358300 - Harmless (?) underflow in ArrayBufferObject::create()
1358300 - Fix underflow resulting in wasted space for 0-byte ArrayBuffer.

Hoping this fixes ASAN, if not back it out.
2026-02-10 22:25:05 +02:00
win7-7 4e5573177f 1366696 - Small performance improvements for RegExp.prototype.@@split and RegExp.prototype.@@replace
1366696 - Part 1: Only create new splitter if sticky flag is present in input regexp.

1366696 - Part 2: Improve performance of RegExp.prototype.@@replace with non-global regexp.

1366696 - Part 3: Improve performance of RegExp.prototype.@@replace with global regexp.

1366696 - Part 4: Remove unnecessary rooting in SelfHosting.cpp for return values
2026-02-10 22:25:04 +02:00
win7-7 4a5169f35f 1368344 - Disable GC zeal in testUnbarrieredEquality.
1368344 - Disable GC zeal in testUnbarrieredEquality.
2026-02-10 22:25:04 +02:00
win7-7 61d3bf5a30 1352006 - Inline NewArrayIterator in Ion + 1367088 - Improve StringIterator performance
1352006 - Inline NewArrayIterator in Ion.

1367088 - Part 1: Generalize NewArrayIterator so it can be reused for other iterator types.

1367088 - Part 2: Inline NewStringIterator in Ion.

1367088 - Part 3: Add inline paths when calling String.fromCodePoint with non-Latin1 code points.
2026-02-10 22:25:03 +02:00
win7-7 d4cfc39e33 1329113 - AutoCloseIterator::~AutoCloseIterator ignores the return value of CloseIterator
1329113 - Use PropertyIteratorObject* in AutoCloseIterator.
2026-02-10 22:25:02 +02:00
win7-7 bb237b05c1 1331350 - IonMonkey: Fuse BitAnd, Compare and Test into BitAndAndBranch
1331350 - Fuse BitAnd, Compare and Test into BitAndAndBranch.
2026-02-10 22:25:02 +02:00
win7-7 f0ac2503f2 1354275 - Ion: Inlining native calls need resume points if they throw
1354275 - Fix handling of Array() throwing in Ion
2026-02-10 22:25:01 +02:00
win7-7 95e29fd08f 1343723 - Crash [@ js::jit::MachineState::read] involving Promise
1343723 - ResumePoint not needed for MNewLexicalEnvironmentObject.
2026-02-10 22:24:59 +02:00
win7-7 395ce4e9a0 1273858 - Ion-compile JSOP_PUSHLEXICALENV/JSOP_POPLEXICALENV
1273858 - Support LexicalEnvironmentObjects during Ion bailout.

1273858 - Ion-compile JSOP_PUSHLEXICALENV/JSOP_POPLEXICALENV.

1273858 - Ion-compile JSOP_FRESHENLEXICALENV/JSOP_RECREATELEXICALENV.
2026-02-10 22:24:59 +02:00
win7-7 e11ad6dd6f 1318677 part 4.
1318677 part 4 - Use a smaller enum representation for js::jit::AbortReason. Part 4 was missed before.
2026-02-10 22:24:58 +02:00
win7-7 f62d50d496 1356424 - Assertion failure: numFailures_ > 0 (numFailures_ should not overflow), at js/src/jit/ICState.h:113
1356424 - Fix DoSetElemFallback to try to transition before attaching an add-slot stub.
2026-02-10 22:24:58 +02:00
win7-7 d3e2ebdaac 1335862 - Implement mayResolve for arguments objects
1335862 - Implement mayResolve for arguments objects.
2026-02-10 22:24:57 +02:00
win7-7 341dae41de Try adjust CC also.
See if this changes pausing or not if you delay CC after major GC to start also after 1 minute instead 6 seconds.

Combination of CC with GC.
2026-02-10 22:24:56 +02:00
win7-7 0b7c335dac 1675153
1675153. In UXP settings is in DOM.

Try increase delay to 5 min.

It does work to stop pausing for 5 minutes but causes even bigger pausing after delay period ends.
2026-02-10 22:24:56 +02:00
win7-7 a5bee9e3f7 1575895 - Don't start GC slices due to malloc allocation if we're already collecting the zone.
At some point we can think about triggering incremental slices here the way we do for the GC heap allocations but for now it's simplest to just not trigger any more slices if we're already allocating.

 This is different to what happens in maybeAllocTriggerZoneGC where we have a delay between triggering slices implemented with gcDelayBytes.

We don't check this threshold on every malloc allocation, but this could still result in us doing back-to-back slices, effectively a non-incremental GC.
2026-02-10 22:24:55 +02:00
win7-7 7cae1264bc 1384010 - Create prefs for allocation threshold factors.
1384010 - Create prefs for allocation threshold factors.
2026-02-10 22:24:55 +02:00
win7-7 115ebe32c9 1554954 + 1570905
1570905 - Rework the GC triggers to make the incremental trigger the default and the non-incremental trigger some factor of this.
2026-02-10 22:24:54 +02:00
win7-7 585b9773f5 Testing performance impact of increasing this further. 2026-02-10 22:24:53 +02:00
win7-7 3de58bc317 1373214 - missing part for hybrid js engine.
1373214 - missing part for hybrid js engine.
2026-02-10 22:24:53 +02:00
win7-7 8fa9405fb2 627220 - Finalize external strings in the background
627220 part 1 - Remove unused Zone* argument from external string finalizers.

627220 part 2 - Finalize external strings in the background.
2026-02-10 22:24:52 +02:00
win7-7 91ac42a2c9 1382275 + 1385833 + 1409751 (part 1 and 3)
1382275 - Refactor incremental sweeping to more clearly express the control flow.

1385833 - Simplify incremental sweeping and combine script and JIT code finalization phases.

1409751 part 1 - Make incremental sweep actions call a method on GCRuntime rather than a function. (skipped part 2/renaming).

1409751 part 3 - Move sweep group iteration inside the sweep action tree

Rename to not confuse with existing ZoneGroupIter.
2026-02-10 22:24:51 +02:00
win7-7 447c732ea1 1390087 - Assertion failure: zone->isGCScheduled(), at js/src/jsgc.cpp:6785
1390087 - Ignore zones that we can't collect when scheduling zones for GC.
2026-02-10 22:24:51 +02:00
win7-7 24b959d14e Fixes.
Fixes.
2026-02-10 22:24:50 +02:00
win7-7 d0d78f4635 Fixes to 1367900 and 1408375
Fixes to 1367900 and 1408375.
2026-02-10 22:24:49 +02:00
win7-7 777806f274 1367900 - Record the values and thresholds for GC triggers
1367900 - Record the values and thresholds for GC triggers.
2026-02-10 22:24:48 +02:00
win7-7 cd1157791d 1386660
1386660.
2026-02-10 22:24:46 +02:00
win7-7 d9268a666a 1408375
1408375.
2026-02-10 22:24:45 +02:00
win7-7 8bf3603324 1384049 - Trigger an incremental GC based on malloc memory counters
1384049 - Trigger an incremental GC based on malloc memory counters.
2026-02-10 22:24:44 +02:00
win7-7 2fee8e39ec 1405980 - Intermittent GECKO(4316) | Assertion failure: zone->isGCScheduled(), at z:/build/build/src/js/src/jsgc.cpp:7046
1405980 - Dump debugging information if zones are not scheduled as expected
2026-02-10 22:24:43 +02:00
win7-7 59ad19875d 1405274 - Improve our malloc memory accounting framework
1405274 - Always update runtime malloc counter too when malloc memory is associated with a zone.

1405274 - Make malloc counters count up instead of down.

1405274 - Add a dynamic malloc bytes threshold.
2026-02-10 22:24:42 +02:00
win7-7 48a227c289 1376954 - consider marking NodeList [isProbablyShortLivingObject]
1376954 part 1. Ensure that we don't try to nursery-allocate non-wrappercached DOM objects.

1376954 part 2. Support nursery allocation of DOM proxy objects.

1376954 part 3. Allow nursery allocation of DOM nodelists.
2026-02-10 22:24:41 +02:00
win7-7 60e0780856 1377055 - Disallow setting JSCLASS_SKIP_NURSERY_FINALIZE on proxies
1377055. Assert that JSCLASS_SKIP_NURSERY_FINALIZE is not used on proxies.
2026-02-10 22:24:41 +02:00
win7-7 3fba6d22ca 1377368 - ProxyObject::New won't create foreground finalized proxies in the nursery
1377368 - Support allocating foreground finalized proxies in the nursery.
2026-02-10 22:24:40 +02:00
win7-7 3e0c43a49b 1377056 - Fix broken support for nursery-allocated proxies with objectMoved hooks
1377056. Ensure that the objectMoved hook, if any, is called when tenuring a nursery-allocated proxy.
2026-02-10 22:24:40 +02:00
win7-7 08bf8f1ff6 1378717
1378717 - Speed up gray root buffering tracer by removing a virtual dispatch and some release asserts.

1378717 - Allow inlining of TraceEdge API's null check.

1378717 - Store JS holders in a vector for faster iteration.
2026-02-10 22:24:39 +02:00
win7-7 bfed8b87c0 1384047
1384047 - Relax assertion that zones are empty when they are deleted
2026-02-10 22:24:37 +02:00
win7-7 227d16c3a3 1366340
1366340 - Delete parsing zones immediately after their contents are merged.
2026-02-10 22:24:36 +02:00
win7-7 e3ee0a4a9d 1377466 + 1380387.
1377466 - Rename PokeGC and add a reason code for GCs triggered by this.

Also includes:

1380387 - Only repeat shutdown GCs for removed roots.
2026-02-10 22:24:36 +02:00
win7-7 02f8f3dcb9 Fallout from 1351107
Fallout from 1351107.
2026-02-10 22:24:35 +02:00
win7-7 9596942c7b Sigh..
Sigh.. I don't like doing this but it won't compile otherwise even if it does to Mozilla. Its not ideal include this back.
2026-02-10 22:24:33 +02:00
win7-7 69205e4443 1225031
1225031.
2026-02-10 22:24:32 +02:00
win7-7 2c255a55b2 1351107 - Move RegExpFlags, RegExpShared, and RegExpCompartment out of RegExpObject.h, into the more minimal vm/RegExpShared.h
Some fixes.

This actually makes regexp zone compile but not other newer commit..

Also safer part of those bigger changes to take.
2026-02-10 22:24:31 +02:00
win7-7 2e2f8d325e 1400278
1400278 - Move definition of ZoneAllocPolicy to jsalloc.h

1400278 - Fix compilation errors to do with unreachable return statements

1400278 - Replace use of RuntimeAllocPolicy with ZoneAllocPolicy

1400278 - Replace runtime allocation with system or zone allocation where possible.

1400278 - Remove RuntimeAllocPolicy now it's no longer used.
2026-02-10 22:24:29 +02:00
win7-7 308b5a42f7 1378740 - Share RegExpShareds across compartments within a zone. Retry.
1378740 - Share RegExpShareds across compartments within a zone. Retry.
2026-02-10 22:24:29 +02:00
win7-7 9abff404cb 1353420: Register the JIT region with mozglue so it can avoid stack-walking that code.
https://hg.mozilla.org/mozilla-central/rev/3586c6c537791ff194d10746ee54e5836e2c23c4, stability fix.
2026-02-10 22:24:28 +02:00
win7-7 f9362b4b1c 1364120 - Remove FINISH_LARGE_EVALUATE gc.
This change reverts the modification added in Bug 852331. It is outdated for
or multiple reasons:
 - We no longer have the bytecode analysis straight after the full parse.
   - We have Lazy parsing now.
   - We replaced the analysis by using IonBuilder at the time of the first Baseline
     compilation which uses a LifoAlloc, and which are discarded right
     away. (almost as mentioned in Bug 852331 comment 1)
 - LARGE_SCRIPT_LENGTH is above the HUGE_LENGTH heuristics of the
   CanCompileOffThread function, which takes another path for executing the
   code compiled off-main-thread.
2026-02-10 22:24:26 +02:00
win7-7 309bd63c29 Fix some gray marking + void is still used not undefined.
Fix some gray marking + void is still used not undefined.
2026-02-10 22:24:25 +02:00
win7-7 9256e4a06c 1410370 - Fix zone scheduling in incremental GC to continue collection of previously collected zones
1410370 - Fix zone scheduling in incremental GC to continue collection of previously collected zones
2026-02-10 22:24:24 +02:00
win7-7 1ba99aa464 1396936 - Simplify tenuring of objects with unique IDs
1396936 - Simplify tenuring of objects with unique IDs and remove hash table lookup for every tenured object.

Hoping removing hash table lookup has performance gain.
2026-02-10 22:24:23 +02:00
win7-7 c7296620d2 1396931 - Simplify sweeping nursery allocated dictionary mode objects
1396931 - Simplify sweeping of dictionary mode objects allocated in the nursery
2026-02-10 22:24:22 +02:00
win7-7 2ae3cdb43e 1407314 - Optimise nursery collection for most common cases
1407314 - Improve tenuring performance by rearranging allocKindForTenure() methods and adding fast path for plain objects

Fix rooting hazards by updating annotations for renamed function.

Fix remaning rooting hazards by telling the analysis that the object moved hook can't GC.
2026-02-10 22:24:21 +02:00
win7-7 89e26e209d Further changes again.
Further changes again. I have revert some changes temporary to be able compare to 55 js engine.
2026-02-10 22:24:20 +02:00
win7-7 2a0b0c020d Further changes.
Further changes.
2026-02-10 22:24:19 +02:00
win7-7 825d181351 JSONPrinter.cpp and .h
JSONPrinter.cpp and .h addition to VM (1322560).

Also:

1322560 - Convert GC statistics over to JSONPrinter.

1322560 - Add APIs for retrieving major GC timing info.
2026-02-10 22:24:17 +02:00
win7-7 802a60351a 1362977 - Rename CellSize to CellAlignBytes and improve the naming of related constants
1362977 - Rename CellSize to CellAlignBytes and improve the naming of related constants. Outside GC.
2026-02-10 22:24:16 +02:00
win7-7 9cbbfd5755 55 js GC for most part.
55 js GC for most part.

ZoneGroup naming is kept since this seems for once pure renaming without functional change when other one changed method.
2026-02-10 22:24:16 +02:00
win7-7 4e70b84e85 Multi-threading dynamic import.
Multi-threading dynamic import.
2026-02-10 22:24:14 +02:00
win7-7 bafc80db3c 1334409 - TraceLogging: Add memory reporter for TraceLogging
1334409 - TraceLogging: Add memory reporter for TraceLogging.
2026-02-10 22:24:13 +02:00
win7-7 37b92402d2 1326096 - Add memory reporter for external strings
1326096 part 1. Add a way to set an external string memory runtime callback.

1326096 part 2. If there is an external string memory runtime callback, call it from memory reporting code.

1326096 part 3. Pass a useful external string memory reporter to SpiderMonkey from Gecko code.

1326096 followup. Suppress the false-positive GC analysis failure due to us doing an indirect call that the static analysis doesn't understand.

1326096 another followup: fix build bustage on CLOSED TREE.

Also includes 1336957, use diagnostic assert for wrapper existence.
2026-02-10 22:24:12 +02:00
win7-7 f4e5a2d0fc 1359436 - Add leak checking to CycleCollectedJSContext and related classes.
1359436 - Add leak checking to CycleCollectedJSContext and related classes.
2026-02-10 22:24:12 +02:00
win7-7 e78002912a Only taking this in due existing in 55 also. 1359653 was backed out in 55 already..
1363301 - Always provide live wrappers for ScriptSourceObjects.
2026-02-10 22:24:10 +02:00
win7-7 9105b8d20d 55 js xpconnect.
55 js xpconnect:

1332172 - Remove XPC_MAP_WANT_*. (touches dom, toolkit, storage also (Use XPC_SCRIPTABLE mentioned))

1325542 - Remove XPCNativeScriptableFlags (js xpconnect only)

1324330 (part 2) - Make XPC_MAP_FLAGS non-optional when using xpc_map_end.h.

1324330 (part 5) - Remove nsDOMClassInfo::mName.

1324330 (part 1) - Mark js::Class and related types as NONHEAP.

Use XPC_SCRIPTABLE

Use XPC_SCRIPTABLE in toolkit.

Use XPC_SCRIPTABLE in storage.

use XPC_SCRIPTABLE in DOM.

1329846 (part 1) - Remove XPCNativeScriptableInfo.

1335654 part 1. Propagate AutoEnterPolicy's mayThrow argument to the enter() methods of proxy handlers, so they know whether it's OK to throw some sort of custom exception or whether they should just silently deny.

1306538 - Move js::ReportASCIIErrorWithId to AddonWrapper.cpp.
2026-02-10 22:24:09 +02:00
win7-7 bdf104ddc0 1318627 - Remove Zone::active
1318627 - Remove Zone::active and related infrastructure.
2026-02-10 22:24:09 +02:00
André Bargull 78477efb65 Bug 1380344 - Add Ion support for IsPackedArray. r=jandem 2026-02-10 22:24:08 +02:00
win7-7 37644c297d 1358135 - Preserve code also when running Baseline code
1358135 part 1 - Fix some browser tests to trigger a shrinking GC instead of a normal GC.

1358135 part 2 - Preserve a Zone's JIT code also when it has Baseline code on the stack.
2026-02-10 22:24:07 +02:00
win7-7 da9f0e2068 Bug 1429783 - Reset frozen state in nsIScriptElement::LoseParserInser… …tedness() r=smaug
Bug 1429783 - Reset frozen state in nsIScriptElement::LoseParserInsertedness() r=smaug
2026-02-10 22:24:06 +02:00
André Bargull 34658ca277 Bug 1372081 - Ion-inline FinishBoundFunctionInit for normal and bound functions
Bug 1372081 - Ion-inline FinishBoundFunctionInit for normal and bound functions
2026-02-10 22:24:05 +02:00
win7-7 be5e54ff0f 1368446 - Fix gray marking assertion failures by calling ExposeObjectToActiveJS in UncheckedUnwrap
1368446 - Fix gray marking assertion failures by calling ExposeObjectToActiveJS in UncheckedUnwrap
2026-02-10 22:24:05 +02:00
win7-7 28e2cae6e3 1343590 - Improve CallArgs gray marking assertions
1343590 - Improve CallArgs gray marking assertions
2026-02-10 22:24:04 +02:00
win7-7 2b677755c6 1340604 - Add more test code for weak map gray marking behaviour
1340604 - Add more test code for weak map gray marking behaviour
2026-02-10 22:24:03 +02:00
win7-7 434900643a 1339770 - Add tests for gray marking of CCWs , partially only, add test later.
1339770 - Add tests for gray marking of CCWs
2026-02-10 22:24:03 +02:00
win7-7 5650f3dfc3 1339770 - Add jsapi tests for weak map gray marking.
1339770 - Add jsapi tests for weak map gray marking.
2026-02-10 22:24:02 +02:00
win7-7 e002123a72 1334433 - Add gray marking jsapi tests
1334433 - Add gray marking jsapi tests
2026-02-10 22:24:00 +02:00
win7-7 ba6e08aa1d 1322648 - Assertion failure: js::CurrentThreadCanAccessRuntime(runtime_), at dist/include/js/HeapAPI.h:135
1322648 - Don't start parse task if its zone is being collected
2026-02-10 22:23:59 +02:00
win7-7 723c47b1dc 1338623 - Investigate making gray marking assertions run all the time again
1338623 - Add a slower but more exact gray marking check for checking correctness.

Reorder. 1337502  first.
2026-02-10 22:23:58 +02:00
win7-7 83b4ecde9c 1333757 - Add same-compartment and not-marked-gray asserts to JSFunction's initExtendedSlot and setExtendedSlot and NativeObject's initFixedSlot and setFixedSlot
1333757 - Add some asserts to slot-setting functions on JSFunction and NativeObject.
2026-02-10 22:23:57 +02:00
win7-7 5df7a9385f 1337502 - js::AutoCompartment should assert the same things JSAutoCompartment does
1337502 - AutoCompartment should have the same asserts as JSAutoCompartment.
2026-02-10 22:23:56 +02:00
win7-7 8ba139d8c7 1332321 - The *SKIPPABLE_*_INHERITED macros are footguns
1332321. Make all cycle collection participants explicitly say whether they need skippability themselves, or just want whatever skippability their descendants want.

This way we can't end up with a situation in which an ancestor doesn't care about skippability but a descendant does and doesn't get it, because the ancestor just claimed no skippability was needed.
2026-02-10 22:23:56 +02:00
win7-7 1a34525f40 1333391 - Move GetCPUCount to threading layer
1333391 - move GetCPUCount to the threading layer.

For background see bug 1333059.  The JS engine does not use PR_GetProcessorCount, because it does not use NSPR, instead it has its own definition (GetCPUCount) tucked away in the garbage collector.
2026-02-10 22:23:55 +02:00
win7-7 8c27fccef0 Missing pieces due zeal having still some relevance in UXP.
1352430 - Add zeal mode to exercise incremental foreground finalization
2026-02-10 22:23:54 +02:00
win7-7 bd46ec06d5 Multi-threading misses.
Multi-threading misses, lack of ActiveThreadOrGCTaskData in four locations where it should be used like 55 js engine had.
2026-02-10 22:23:54 +02:00
win7-7 5facb815d9 1354733 - Avoid wrapping dead wrappers into CCWs
1354733: Part 1 - Allow creating DeadObjectProxies directly.

1354733: Part 2 - Never rewrap dead wrappers.
2026-02-10 22:23:53 +02:00
win7-7 9b89a34160 1370823 - Don't evict the nursery in NukeCrossCompartmentWrappers and RecomputeWrappers
1370823 - Don't evict the nursery in NukeCrossCompartmentWrappers and RecomputeWrappers.
2026-02-10 22:23:51 +02:00
win7-7 cace35a668 816784 - Lots of time spent in WindowDestroyedEvent::Run/js::NukeCrossCompartmentWrappers when closing tabs/windows
816784 part 1 - Use a 2d hashmap to store cross compartment wrappers.

816784 part 2 - Optimize NukeCrossCompartmentWrappers() to iterate only the targetting wrappers.

816784 part 3 - Optimize the other places that iterate CCWs.

816784 part 4 - Fix the rooting hazards that the analysis report.
2026-02-10 22:23:51 +02:00
win7-7 3ebe72f117 Bug 1369533: Return dead wrappers rather than null for dead CallbackObject values
We don't have access to an appropriate context to create the dead wrapper in when the callback is nuked, so instead, this patch creates a new dead wrapper in the caller compartment each time the property is accessed. This is the same behavior we'd get when trying to re-wrap a cross-compartment dead wrapper, so it's consistent with the way we handle these situations elsewhere.
2026-02-10 22:23:50 +02:00
win7-7 b8e4e81395 1369367 - Crash in mozilla::dom::WindowBinding::get_onunload
1369367. DOM callbacks can now store a null object; teach codegen to handle that.
2026-02-10 22:23:49 +02:00
win7-7 0177aa8a63 1322273 - Return DeadObjectProxy when attempting to wrap object for a nuked compartment
1322273 - Cut wrappers that point out of a browser compartment when nuking it.

1322273 - Return DeadObjectProxy when wrapping for nuked compartment.
2026-02-10 22:23:49 +02:00
win7-7 65246a5ac2 1336988 - Crash in JSAutoCompartment::JSAutoCompartment | mozilla::dom::CallbackObjectHolderBase::ToXPCOMCallback
1336988: Correctly handle dead callback objects when iterating over event listeners.
2026-02-10 22:23:48 +02:00
win7-7 51da3c489d 1273251 - Remove cross-compartment event handlers and observers when nuking wrappers
1273251: Part 1 - Mark nuked sandboxes as nuked and non-scriptable.

1273251: Part 2 - Mark extension window compartments as nuked, and nuke all wrappers.

1273251: Part 3 - Allow CallbackObject to contain a null callable.

1273251: Part 4 - Drop CallbackObject's JS objects for nuked compartments during CC.

1273251: Part 5 - Add tests for event listeners in nuked sandboxes.

Part 6 dropped due webextensios. I'm taking this to test CC performance impact combined with later porting.
2026-02-10 22:23:47 +02:00
win7-7 d58d440935 Fix assert.
Fix assert.
2026-02-10 22:23:47 +02:00
win7-7 4d9533e1a7 1376961 - Compartment checks do a slow TLS lookup
1376961 - Inline CurrentThreadIsHeapBusy in START_ASSERT_SAME_COMPARTMENT to avoid a TLS lookup for each compartment check.
2026-02-10 22:23:45 +02:00
win7-7 8e6999c1e8 Fix long time ago missed change.
Fix long time ago missed change.
2026-02-10 22:23:44 +02:00
win7-7 26ded2623c Fix crash hopefully.
Fix crash hopefully.
2026-02-10 22:23:43 +02:00
win7-7 657ca93d0c Revert "Bug 1378740 - Share RegExpShareds across compartments within a zone. r=jonco"
This reverts commit 744b3a2029a59bab9d4ff10f79fc4396bd315b04.
2026-02-10 22:23:42 +02:00
win7-7 034285b42c 1368325 - js::gc::BarriersAreAllowedOnCurrentThread() shows up in performance profiles
1368325 - Remove JSContext::allowGCBarriers and related code as it's not used anywhere.
2026-02-10 22:23:41 +02:00
win7-7 df796f6497 1328252 - Always unbox NewArray/NewObject cached optimizations.
1328252 - IonMonkey: Always unbox NewArray/NewObject cached optimizations
2026-02-10 22:23:40 +02:00
win7-7 295363334d 1382023 - Pull some irregexp patches
1382023 - Fold repeated assertions.

This is a pull of v8 commit c8e4c8b9263b5009716804f06f39225a9dd7fc68, reviewed at https://codereview.chromium.org/2768443003.

1382023 - Optimize better in presence of lookaround.

This is a pull of v8 commit 8df7c2a21b07174c3704894ca1d149b2711dfa58, reviewed at https://codereview.chromium.org/2777583003.
2026-02-10 22:23:39 +02:00
win7-7 a93f42d07c 1368461 - Allow nursery-allocating most RegExp objects
1368461 part 1 - Allow nursery allocation for RegExps allocated by CloneRegExpObject.

1368461 part 2 - Pass NewObjectKind to RegExpAlloc so most callers can use nursery allocation.
2026-02-10 22:23:38 +02:00
win7-7 2203cd2c14 Bug 1379980 - Clean up RegExp code a bit. r=jonco
Clean up RegExp code a bit.

This removes some unnecessary roots and makes sure we fire the pre-barrier in initIgnoringLastIndex by using sharedRef instead of NativeObject::setPrivate(nullptr). Before bug 1378736 we didn't have that pre-barrier.
2026-02-10 22:23:37 +02:00
Jan de Mooij 7db4a1e44a Bug 1115355 - Optimize RegExpObject allocation in Ion. r=evilpie 2026-02-10 22:23:36 +02:00
win7-7 2b1861ac32 Bug 1379936 - Make sure lastIndex slot is always initialized to 0 when cloning regexps in Ion. r=nbp
Make sure lastIndex slot is always initialized to 0 when cloning regexps in Ion
2026-02-10 22:23:34 +02:00
Jan de Mooij c603bbfe39 Bug 1378740 - Share RegExpShareds across compartments within a zone. r=jonco 2026-02-10 22:23:34 +02:00
win7-7 d2f01839b8 Bug 1373290 - Move object/string pre-barrier null check to JIT code. r=nbp
Speedometer gains to test.
2026-02-10 22:23:33 +02:00
win7-7 8fa897390e 1366263
RegExpMatcher, RegExpSearcher, and RegExpTester not always inlined in Speedometer

Focusing to optimize Speedometer, so more ports to optimize that.
2026-02-10 22:23:32 +02:00
win7-7 2686410e1a Bug 1384318 - Inline native check for emitMegamorphicLoadSlot variants. r=jandem
Inline native check for emitMegamorphicLoadSlot variants
2026-02-10 22:23:32 +02:00
André Bargull 4e6261b466 Bug 1381891 - Inline IsTypedArray even when non-TypedArrays were observed. r=jandem 2026-02-10 22:23:31 +02:00
win7-7 363a6f9c33 Bug 1373615 - Clean up and optimize property enumeration code. r=evilpie
Hopefully to speed up Speedometer further
2026-02-10 22:23:31 +02:00
win7-7 5767feec1c Bug 1169746 - Don't use templateObjects for derived constructor calls. r=jandem
Missed one part of changes in make SuperCall work in the JITs while doing others.
2026-02-10 22:23:30 +02:00
Jan de Mooij e901593496 Bug 1383343 part 2 - Add a cache for Function.prototype.toString. r=anba 2026-02-10 22:23:30 +02:00
Jan de Mooij d1599efcb7 Bug 1383343 part 1 - Avoid StringBuffer overhead in FunctionToString in the common case. r=anba 2026-02-10 22:23:29 +02:00
Ted Campbell 888785b421 Bug 1377051 - Support JSOP_SETELEM_SUPER in Baseline r=jandem
MozReview-Commit-ID: 5YycYP7J2w0

--HG--
extra : rebase_source : 7fc00a2d18055149ea179dba0227275f1cffcca8

# Conflicts:
#	js/src/jit/BaselineCompiler.cpp
#	js/src/vm/Interpreter.cpp
2026-02-10 22:23:28 +02:00
Ted Campbell 51d5dd75b7 Bug 1377051 - Support JSOP_SETPROP_SUPER in Baseline r=jandem
MozReview-Commit-ID: LNOVCntYDsM

--HG--
extra : rebase_source : 987cd42d72fc3beca649025295a9ac725c31b88b
2026-02-10 22:23:28 +02:00
Iain Ireland e2cfc09e98 Bug 1709328: Fix baseline IC register assignment for GetElemSuper r=jandem
When bug 1472211 reordered the operands of GetElemSuper, we got our register assignments out of sync. Our GetElemSuper baseline ICs have been silently failing ever since.

This patch re-establishes a consistent assignment between BaselineCodeGen::emit_GetElemSuper, GetPropIRGenerator, and BaselineCacheIRCompiler::init:
  obj = input operand 0 = baseline frame slot 0
  id/key = input operand 1 = R1
  receiver = input operand 2 = R0

We have a testcase for megamorphic GetElemSuper, but it didn't catch this bug because our ICs just failed silently (either because a property name is not a valid receiver, or because the superbase object is not a valid property name) and let the fallback handle it. The testcase I've attached to this bug doesn't fail prior to bug 1661211 part 1, where we added support for non-object receivers for GetElemSuper, but I checked out old revisions immediately before and after bug 1472211 and verified in rr that GetNativeDataPropertyByValuePure was passed the correct id before, and the receiver object after.

Drive-by: while investigating this bug, I realized that `attachMegamorphicNativeSlot` had an unused argument left over from TI removal.

Differential Revision: https://phabricator.services.mozilla.com/D114513

[Waterfox note: That last comment regarding `attachMegamorphicNativeSlot` isn't
actually true in Waterfox, so that part of the patch has been left out.]
2026-02-10 22:23:27 +02:00
win7-7 98275fc5b7 Restore super for BytecodeEmitter.h
Restore super for BytecodeEmitter.h
2026-02-10 22:23:27 +02:00
André Bargull f3637cd044 Bug 1472211 - Part 2: Reorder operands in Super-Elem bytecode operations. r=arai 2026-02-10 22:23:26 +02:00
Jan de Mooij 156630a805 Bug 1410683 - Adjust BaselineFrame frameSize when pushing extra value for JSOP_GETELEM_SUPER. r=evilpie 2026-02-10 22:23:26 +02:00
Tom Schuster 41320cda10 Bug 1378186 - Implement super.property in Ion. r=jandem 2026-02-10 22:23:25 +02:00
Tom Schuster 4465c4dd67 Bug 1378186 - Fix GetElemSuper stack handling in baseline. r=jandem 2026-02-10 22:23:24 +02:00
Ted Campbell 6d23236138 Bug 1169745 - Support JSOP_GETELEM_SUPER in Baseline. r=jandem
MozReview-Commit-ID: BDrZvZ5n3Q4
2026-02-10 22:23:24 +02:00
Ted Campbell 9e83256325 Bug 1169745 - Support JSOP_GETPROP_SUPER in Baseline. r=jandem
MozReview-Commit-ID: KTeUTsRpDWq
2026-02-10 22:23:23 +02:00
Ted Campbell 527060a98f Bug 1169745 - Fix vm/Opcodes.h for JSOP_GETPROP_SUPER / JSOP_GETELEM_SUPER. r=jandem
MozReview-Commit-ID: 88UehsiXP0i
2026-02-10 22:23:23 +02:00
Ted Campbell be45a8eff5 Bug 1169746 - Handle JSOP_SPREADSUPERCALL correctly in ICCall_Native. r=sstangl
MozReview-Commit-ID: KEWS1s4Y9dL
2026-02-10 22:23:22 +02:00
Ted Campbell 14150b5970 Bug 1169746 - Support |super()| in Baseline. r=jandem
- Update BaselineIC for JSOP_SUPERCALL / JSOP_SPREADSUPERCALL
    - Support JSOP_SUPERFUN
    - Support JSOP_CHECKTHISREINIT

MozReview-Commit-ID: BlWsaUGeBqS
2026-02-10 22:23:21 +02:00
Ted Campbell b8edd200e8 Bug 1169746 - Disable JSOP_SUPERCALL in IonBuilder. r=jandem
This opcode has been blocked on other missing opcodes for a long
    time and requires further testing before it is unblocked again.

MozReview-Commit-ID: 7oKkJwxjVu5
2026-02-10 22:23:20 +02:00
Ted Campbell a7dc113308 Bug 1169745 - Support JSOP_SUPERBASE in Baseline. r=jandem
MozReview-Commit-ID: QA2j2Wsrs8
2026-02-10 22:23:19 +02:00
win7-7 b3eeebc46f 1169743 - Make classes with extends work in the Jits
1169743 - Rework JSOP_CLASSHERITAGE to be jit-friendly.

1169743 - Implement class decls with extends in Baseline

1169743 - Implement class decls with extends in Baseline (cont.)

 Add baseline support for
JSOP_INITHOMEOBJECT
JSOP_CLASSCONSTRUCTOR
SOP_DERIVEDCONSTRUCTOR

Include IfEmitter.h for ObjectEmitter.cpp for ifThenElse.
2026-02-10 22:23:18 +02:00
Ted Campbell e89e3221b7 Bug 1169745 - JSOP_GETPROP_SUPER should Typescript::Monitor. r=jandem
MozReview-Commit-ID: IRRNhDBzMAF
2026-02-10 22:23:18 +02:00
Shu-yu Guo 95295e4ebf Bug 1374462 - Fix super getprop and super getelem to not box 'this' values. (r=jorendorff) 2026-02-10 22:23:17 +02:00
André Bargull fef0147f37 Bug 1379639 - Move Number.isInteger to self-hosted code and avoid bailouts in isSafeInteger. r=jandem 2026-02-10 22:23:16 +02:00
win7-7 7d3ac36c2d Bug 1377489 - Eliminate unnecessary string allocation + copy under FunctionToString.
Bug 1377489 - Eliminate unnecessary string allocation + copy under FunctionToString. r=luke

--HG--
extra : rebase_source : 5d37fa9645ca8eed4bd0228d5a739f04878de979

https://github.com/WaterfoxCo/Waterfox-Classic/commit/96bad8f8fc16b8c389cbc1441d8e174239cad986
2026-02-10 22:23:15 +02:00
Kannan Vijayan a3533b2459 Bug 1366377 - Optimize single-char splitting in VM. r=jorendorff. 2026-02-10 22:23:14 +02:00
Kannan Vijayan 1afa33f59f Bug 1366377 - Unify StringSplitString ObjectGroup and fix Ion MCallOptimize. r=tcampbell
# Conflicts:
#	js/src/jit/MIR.h
2026-02-10 22:23:13 +02:00
Kannan Vijayan 32e0762a91 Bug 1366377 - Add CacheIR stub for String_split. r=tcampbell 2026-02-10 22:23:12 +02:00
Jan de Mooij 1e3567063c Bug 1397071 - Call InitElemOperation in IonSetPropertyIC::update to support more cases. r=anba 2026-02-10 22:23:12 +02:00
Tom Schuster 9417b367f2 Bug 1344483 - Remove MInitProp from Ion. r=jandem 2026-02-10 22:23:11 +02:00
Tom Schuster b8a972af47 Bug 1344483 - Use an IC for JSOP_INITPROP in Ion. r=jandem 2026-02-10 22:23:09 +02:00
Tom Schuster 5e679fb8d5 Bug 1344483 - Nop jsop_toid for string/symbol. r=jandem 2026-02-10 22:23:09 +02:00
Jan de Mooij 354c562e96 Bug 1423139 - Don't attach a SetArrayLength stub for JSOP_INITELEM. r=evilpie 2026-02-10 22:23:08 +02:00
Jan de Mooij 482f73dfbb Bug 1397026 - Make sure JSOP_INIT* IC behavior matches [[DefineOwnProperty]] instead of [[Set]]. r=anba 2026-02-10 22:23:06 +02:00
Jan de Mooij 08a5c5a21b Bug 1376691 - Improve Ion-inlining of Array.isArray. r=nbp 2026-02-10 22:23:05 +02:00
Jan de Mooij 42d89d2a04 Bug 1385215 part 2 - Inline Object.prototype.toString in Ion. r=evilpie 2026-02-10 22:23:04 +02:00
Jan de Mooij 6c6ef91ab2 Bug 1385215 part 1 - Ion-inline native calls in jsop_funcall/jsop_funapplyarguments. r=nbp 2026-02-10 22:23:03 +02:00
Jan de Mooij d28bbdc80d Bug 1376799 - Optimize Object.prototype.toString. r=evilpie
--HG--
extra : rebase_source : 01f1dfcdf9bb991c8c40cf8dc9b521501456350f
2026-02-10 22:23:02 +02:00
André Bargull bd5aaeb65a Bug 1383644 - Inline ToObject when called with MIRType::Value. r=jandem 2026-02-10 22:23:00 +02:00
André Bargull 784ca768d4 Bug 1303335: Move parts of Object.getOwnProperty and Object.defineProperty to self-hosted code. r=till 2026-02-10 22:23:00 +02:00
win7-7 b7b1508fde 1353358 - Support JSOP_OPTIMIZE_SPREADCALL in Ion
1353358 - Use IfThenElseEmitter when optimizing spreadcall

1353358 - Support JSOP_OPTIMIZE_SPREADCALL in Ion
2026-02-10 22:22:59 +02:00
win7-7 c76acde7fe 1342882 - Hit MOZ_CRASH(unexpected type) at js/src/jit/Lowering.cpp:2323
1342882: IonMonkey - Don't allow magic types for concatenation
2026-02-10 22:22:57 +02:00
win7-7 9ea2349594 1328148 - Use MConcat for more cases
1328148: IonMonkey - Use MConcat for more cases.
2026-02-10 22:22:57 +02:00
win7-7 3ec529d6e4 Bug 1505385: Fix exception handling in IsDuckTypedErrorObject r=tcampbell
Fix exception handling in IsDuckTypedErrorObject
2026-02-10 22:22:56 +02:00
win7-7 7bf23242fc 1338920 - Make spreadcall work in Ion
1338920 - Support JSOP_SPREADCALLARRAY in Ion.

1338920 - Support JSOP_SPREADCALL in Ion.
2026-02-10 22:22:55 +02:00
win7-7 79f641eddf 1346028 - Ion: Implement INITELEM_INC
1346028 - Allow MCallInitElementArray to take dynamic index.

1346028 - Support JSOP_INITELEM_INC in Ion.
2026-02-10 22:22:54 +02:00
win7-7 4f05859f17 1355058 - Fix some minor perf issues in IonBuiler
1355058 part 1 - Try the TypedObject optimizations last as typed objects are disabled by default.

1355058 part 2 - Avoid creating unnecessary type constraints in IonBuilder::typedObjectPrediction.
2026-02-10 22:22:54 +02:00
win7-7 ba0dc37141 1353679 - Optimize the Object case in obj_toString
1353679 part 1 - Optimize the Object case in Object.prototype.toString because it's very common.

1353679 part 2 - Atomize strings returned from Object.prototype.toString to avoid allocating duplicate strings.
2026-02-10 22:22:52 +02:00
win7-7 56a4c4dfb1 1345205 - Zen Garden Wasm demo runs 2.22x slower and starts up 4.49x slower in 32-bit Firefox compared to 64-bit
1345205 - Bump MaxCodeBytesPerProcess to 140mb on 32-bit and decrease BufferSize to 8mb.

Zen Garden Wasm demo is no longer available even so this should be ported.
2026-02-10 22:22:51 +02:00
win7-7 6c6ccab2da 1369042 - Optimize the @@toStringTag and @@toPrimitive lookups
1369042 - Optimize @@toStringTag and @@toPrimitive property lookups in the VM.
2026-02-10 22:22:50 +02:00
win7-7 cda1788e78 1341263 - Optimize null/undefined comparisons more in CompareIC
1341263 - Optimize null/undefined comparisons more in CompareIC.
2026-02-10 22:22:49 +02:00
win7-7 2cb1ded653 1341087 - Optimize symbol equality operations
1341087 - Implement symbol equality comparison in Ion.

1341087 - Implement bitwise symbol equality comparison in Ion.

1341087 - Implement symbol equality comparison in SharedIC.
2026-02-10 22:22:48 +02:00
win7-7 264affd5b4 1336216 - IONFLAGS=logs Does not work on Win32
1336216 - Fix JIT_SPEW_DIR on Win32.
2026-02-10 22:22:47 +02:00
win7-7 836a5b1397 1339481 - Structured clone can be really slow
1339481 - Specialize writing bytes in structured clone
2026-02-10 22:22:47 +02:00
win7-7 215fe01338 1372956 - Assertion failure: !denseElementsAreFrozen(), at js/src/vm/NativeObject-inl.h:266
1372956 - Fix unshift fast path to check for frozen elements.
2026-02-10 22:22:46 +02:00
win7-7 6736e40aef 1373356 - Assertion failure: getDenseCapacity() == 0, at js/src/vm/NativeObject-inl.h:310
1373356 - Fix NativeObject::sparsifyDenseElements to discard shifted elements.
2026-02-10 22:22:45 +02:00
win7-7 ccc0606ca9 1364346 - Optimize Array.prototype.unshift
1364346 part 1 - Optimize Array.prototype.unshift fast path and use it more.

1364346 part 2 - Rename unshiftElements to moveShiftedElements, tweak heuristics.

1364346 part 3 - Optimize Array.prototype.unshift by taking advantage of shifted elements.
2026-02-10 22:22:43 +02:00
win7-7 354fde7024 1350864 - Freezing an array does not set non-writable length correctly
1350864 - Fix SetIntegrityLevel to set non-writable length correctly when freezing arrays.
2026-02-10 22:22:43 +02:00
win7-7 cc64b81425 1348772 - Optimize Array.prototype.shift to be O(1) instead of O(n)
1348772 - Optimize Array.prototype.shift to have O(1) perf instead of O(n).

JS code often uses arrays as queues, with a loop to shift() all items, and this resulted in quadratic behavior for us. That kind of code is much faster now.
2026-02-10 22:22:42 +02:00
win7-7 3ee9f906b4 1383648 - Measure if it's useful to keep the Array.prototype.sort entry point in self-hosted code
1383648 - Move the Array.prototype.sort entry point to self-hosted code.
2026-02-10 22:22:40 +02:00
win7-7 6fcfab8377 1302441 - Break assertion down into smaller assertions.
1302441 - Break assertion down into smaller assertions.

For 1348772.
2026-02-10 22:22:39 +02:00
win7-7 f71d5c9eed 1350286 - Memory allocated by NurseryAwareHashMap is not tracked in about:memory (detected by DMD in heap-unclassifieds)
1350286 - Report size of nursery entries vector for NurseryAwayreHashMap.
2026-02-10 22:22:39 +02:00
win7-7 15b839ff36 1355065 - Remove public read barrier API
1355065 - Remove unused read barrier API.

Following bug 1353758 can remove the public read barrier API, since it was only used for the external string cache.
2026-02-10 22:22:38 +02:00
win7-7 96226e9fdc 1341367 assertion fix.
1341367 assertion fix.
2026-02-10 22:22:37 +02:00
win7-7 2e98f7017f 1360961 - Crash in js::GetPrototype during cross-compartment hasInstance
1360961 - Assert that dying objects are not passed into the JSAPI

1360961 - Add a barrier to the plugin object wrapper table to handle incrementally finalized JSObjects

1360961 - Fix spurious rooting hazard
2026-02-10 22:22:36 +02:00
win7-7 2948fd0f68 1352430 - Sweep foreground objects incrementally
1352430 - Finalize foreground objects incrementally.

1352430 - Update the GC finalize callback to communicate the new state.

1352430 - Update XPConnect sweeping to handle incrementally finalized objects.

1352430 - Add barrier to wrapper cache to clear dying objects that have not yet been finalized.

1352430 - Add barrier to CPOWs table to remove dying objects.
2026-02-10 22:22:35 +02:00
win7-7 7cf2983373 1359001 - AutoAssertGCCallback calls into the JS engine in opt builds
1359001 - Make AutoAssertGCCallback a no-op in opt builds.

This class is used to assert that we're currently running inside a GC callback.  It doesn't do anything in opt builds, but currently it calls into the JS engine anyway.

Preparation for 1352430.
2026-02-10 22:22:34 +02:00
win7-7 aca6d20422 1337414 - Crash [@ js::AutoClearTypeInferenceStateOnOOM::AutoClearTypeInferenceStateOnOOM] or Assertion failure: CurrentThreadCanAccessZone(zone), at vm/TypeInference.cpp:4536
1337414 - Don't trace into GC things owned by other runtimes in CheckHeapTracer
2026-02-10 22:22:34 +02:00
win7-7 469d752868 1341752 - js::TraceChildren should assert that it's not called with a GC thing from another runtime
1341752 - Assert that thing has correct runtime in js::TraceChildren.
2026-02-10 22:22:32 +02:00
Jon Coppeard 8e2c0d5949 Bug 1402649 - Fix valid GC cell pointer asserts and error handling in module instantiation r=sfink 2026-02-10 22:22:31 +02:00
Jon Coppeard 70ac3a595d Bug 1399944 - Check for valid GC cell pointers in various places r=sfink 2026-02-10 22:22:30 +02:00
Jon Coppeard af6fc902fc Bug 1399933 - Replace use of ObjectValueCrashOnTouch with PoisonedObjectValue r=sfink 2026-02-10 22:22:28 +02:00
win7-7 1146e069e9 1317761 - Prefer use of 'trace' to 'mark'
1317761 - Standardise names of tracing methods.

The rule will be:
 - a method that traces all contained GC things will be called 'trace' and take a JSTracer*
 - a method that's specific to GC marking will have the word 'mark' in the name and take a GCMarker*

Hopefully this solves debug crash when done completely.
2026-02-10 22:22:28 +02:00
win7-7 1aefb21507 Fix debug revealed error.
Fix debug revealed error.
2026-02-10 22:22:27 +02:00
win7-7 12f6d46422 Bug 1506524: Handle LambdaArrow in MFunctionEnvironment::foldsTo. r=nbp
Handle LambdaArrow in MFunctionEnvironment::foldsTo.
2026-02-10 22:22:26 +02:00
win7-7 2ac0f7ce2d 1336579 - [meta] Attach SetProp Function prototype
1336579 - Attach AddSlot stubs for setting function.prototype.
2026-02-10 22:22:26 +02:00
André Bargull 65e733e4c7 Bug 1380111 - Inline iterator code into Map/Set forEach to avoid extra allocations. r=till
--HG--
extra : rebase_source : 1244d9d9b19b25b19728da4b94ce0c391cab8ad2
extra : histedit_source : c6b736c9f005e51cb366a0f241be2b4a5dcdf2c3
2026-02-10 22:22:25 +02:00
win7-7 41a12dd2d0 1366372 - Array.from is way too slow
1366372 - Remove performance pitfalls in Array.from method.
2026-02-10 22:22:25 +02:00
win7-7 b1dcb4efcb 1350896 - Use Ion GetElem/SetElem ICs in more cases
1350896 - Use Ion GetElem/SetElem ICs in more cases.
2026-02-10 22:22:24 +02:00
win7-7 f8c123fc03 1340496 - CacheIR: Add SetProp/SetElem WindowProxy stubs
1340496 - Add IC support for setting existing properties on WindowProxies.
2026-02-10 22:22:24 +02:00
win7-7 163966f560 1133423 - setting an already-existing expando property on document is very slow
1133423 - Optimize sets of expando properties and expando setter calls on DOM proxies.
2026-02-10 22:22:23 +02:00
win7-7 d6768154ee 1337773 - Add an Ion IC for JSOP_IN
1337773 - Add IonInIC

1337773 - Use IonInIC for MIn and rename to MInCache
2026-02-10 22:22:22 +02:00
win7-7 9c29397bb5 1359952 - [JITs] Unify InIRGenerator and HasOwnIRGenerator
1359952 - Fix CacheIRCompiler handling of boolean results.

1359952 - Remove shape arg from TestMatchingReceiver.

1359952 - Add ownProp flag to CanAttachDenseElementHole.

1359952 - Add HasPropIRGenerator.

Fix.

Fix.
2026-02-10 22:22:22 +02:00
win7-7 05566f1f66 1351388 - InIRGenerator::tryAttachNativeIn should handle non-data properties
1351388 - Allow non-data properties in InIRGenerator::tryAttachNativeIn
2026-02-10 22:22:21 +02:00
André Bargull 2fbc6af72f Bug 1380087 - Add an intrinsic to test for Map and Set objects. r=till 2026-02-10 22:22:21 +02:00
Tom Schuster d728a1c8ea Bug 1383646 - Optimize x.indexOf(x) for AngularJS. r=anba 2026-02-10 22:22:20 +02:00
André Bargull c60db5da52 Bug 1430800: Optimize String.raw by avoiding rest-parameter array allocation. r=evilpie 2026-02-10 22:22:19 +02:00
Jan de Mooij e675b628b2 Bug 1388354 - Optimize ToPropertyKey a bit. r=anba 2026-02-10 22:22:19 +02:00
Jan de Mooij 4b4e8fdffb Bug 1388354 - Optimize ToPropertyKey a bit. r=anba 2026-02-10 22:22:18 +02:00
Jon Coppeard df555350e1 Bug 1380778 - Fixup shape pointers into the nursery using a dedicated list r=sfink
1380778 - Fix review comment I missed
2026-02-10 22:22:18 +02:00
win7-7 fd67ffd7ba 1381058 - Report which store buffer fills up for FULL_STORE_BUFFER minor GCs
1381058 - Split full store buffer reasons into a separate reason for each store buffer
2026-02-10 22:22:17 +02:00
Jon Coppeard 5936715e14 Bug 1367795 - Use multiple parallel tasks for weak cache sweeping r=sfink 2026-02-10 22:22:16 +02:00
Jon Coppeard 3183391837 Bug 1367795 - Use a single parallel task for weak cache sweeping r=sfink 2026-02-10 22:22:16 +02:00
Jon Coppeard 39abcc4f4e Bug 1367795 - Add tests for incremental weak cache sweeping r=sfink 2026-02-10 22:22:15 +02:00
Jon Coppeard 2c8b114982 Bug 1367795 - Move weak cache sweeping out of the initial slice for the sweep group r=sfink 2026-02-10 22:22:14 +02:00
Jon Coppeard 3b7e8f58ed Bug 1367795 - Allow movable cell hashing to handle matching against a dead table entry r=sfink 2026-02-10 22:22:13 +02:00
Jon Coppeard 4721d8d2fb Bug 1367795 - Refactor movable cell hashing methods to move them to MovableCellHasher<T> r=sfink 2026-02-10 22:22:12 +02:00
Jon Coppeard 07f787ee27 Bug 1367795 - Add barriers to JS::WeakCache for GCHashMap r=sfink 2026-02-10 22:22:11 +02:00
Jon Coppeard 164788f217 Bug 1367795 - Add barriers to JS::WeakCache for GCHashSet r=sfink 2026-02-10 22:22:11 +02:00
Jon Coppeard eded9e1016 Bug 1367795 - Specialise JS::WeakCache for GCHashMap so we can add barriers r=sfink 2026-02-10 22:22:10 +02:00
Jon Coppeard eac131636c Bug 1367795 - Specialise JS::WeakCache for GCHashSet so we can add barriers r=sfink 2026-02-10 22:22:09 +02:00
Jon Coppeard ce0e5f834d Bug 1367795 - Refactor some use of WeakCache r=sfink 2026-02-10 22:22:09 +02:00
Jon Coppeard a59b75c720 Bug 1376096 - Add per-sweep-group actions in addition to per-zone actions r=sfink 2026-02-10 22:22:08 +02:00
Jon Coppeard f52ada6da9 Bug 1376101 - Remove some unnecessary read barriers r=sfink 2026-02-10 22:22:07 +02:00
Jon Coppeard cc8cab0c0a Bug 1373209 - Use non-mutating iterator when checking tables after moving GC r=sfink 2026-02-10 22:22:05 +02:00
Jon Coppeard 51fcc8c4a4 Bug 1372524 - Add missing explicit keywords r=me 2026-02-10 22:22:05 +02:00
Jon Coppeard de48f8af35 Bug 1371234 - Clear GC edges when deleting a GC managed object outside a GC r=sfink 2026-02-10 22:22:03 +02:00
Jon Coppeard 352510546c Bug 1372569 - Skip sweeping empty weak caches r=sfink 2026-02-10 22:22:02 +02:00
Jon Coppeard 8b8ed126c4 Bug 1372524 - Refactor WeakCache implementation a little r=sfink 2026-02-10 22:22:01 +02:00
win7-7 081cba78a0 1370069 - Crash [@ js::GCMarker::eagerlyMarkChildren] and various other crashes and assertions involving gczeal(17)
1370069 - Fix several issues with incremental atom sweeping
2026-02-10 22:22:00 +02:00
win7-7 2e25b5269e 1369444 - Sweep the atoms table incrementally
1369444 - Sweep the atoms table incrementally.
2026-02-10 22:21:59 +02:00
win7-7 2702c0b2a4 Add newline back to end.
Add newline unsure when this get accidentally removed. Figure out order later.
2026-02-10 22:21:58 +02:00
Jan de Mooij f78d280122 Bug 1372182 part 9 - Inline more functions. r=anba 2026-02-10 22:21:57 +02:00
Jan de Mooij c995ab5b36 Bug 1372182 part 8 - Optimize AddTypePropertyId. r=evilpie 2026-02-10 22:21:56 +02:00
Jan de Mooij 0503cd238d Bug 1372182 part 7 - Inline some more functions. r=anba 2026-02-10 22:21:55 +02:00
Jan de Mooij 12b4a8376e Bug 1372182 part 6 - Inline PurgeEnvironmentChain. r=anba 2026-02-10 22:21:54 +02:00
Jan de Mooij a20e695465 Bug 1372182 part 5 - Inline PropertyTree::getChild in NativeObject::getChildProperty. r=evilpie 2026-02-10 22:21:54 +02:00
Jan de Mooij 3c9a9e2c85 Bug 1372182 part 4 - Refactor/optimize PropertyTree::getChild a bit. r=jonco 2026-02-10 22:21:53 +02:00
Jan de Mooij 48940a67d4 Bug 1372182 part 3 - Merge jspropertytree.* with vm/Shape.* r=evilpie 2026-02-10 22:21:53 +02:00
Jan de Mooij 5c63067803 Bug 1372182 part 2 - Refactor NativeObject::allocSlot to make things faster for non-dictionary objects. r=anba 2026-02-10 22:21:52 +02:00
Jan de Mooij b0d286bc4a Bug 1372182 part 1 - Inline NativeObject::dynamicSlotsCount and related methods. r=anba 2026-02-10 22:21:52 +02:00
win7-7 8db3c1f9ad 1386685 Inline StackDefs and StackUses
Inline StackDefs and StackUses, Speedometer.
2026-02-10 22:21:51 +02:00
win7-7 14dbd9245d 1339535 - JSObject::setHadElementsAccess happens too early
1339535 - Set the hadElementsAccess flag less eagerly to avoid unnecessary Shape changes.
2026-02-10 22:21:50 +02:00
win7-7 68c524a303 1414238 - Optimize BaselineCompiler::emitBody a bit
1414238 - Optimize BaselineCompiler::emitBody a bit.
2026-02-10 22:21:50 +02:00
win7-7 41c903caae 1354582 - call/apply inlining should support non-singleton callees
1354582 - Support non-singleton functions in IonBuilder::getSingleCallTarget.
2026-02-10 22:21:49 +02:00
win7-7 a6a70816a6 1326302 - More changes to PageProtectingVector
1326302 - Part 1: Redesign PageProtectingVector for minimum overhead.

1326302 - Part 2: Expose the ability to fully or partially disable protection and use it for WASM.

1326302 - Part 3: Guard against reentrancy in PageProtectingVector.

1326302 - Part 4: Guard against reentrancy when patching jumps as well.
2026-02-10 22:21:49 +02:00
win7-7 c9a0af53ba 1322445 - Switch PageProtectingVector from protecting fully used pages to fully unused pages.
1322445 - Extend PageProtectingVector to protect unused pages as well.
2026-02-10 22:21:48 +02:00
win7-7 7a17dc4f64 1358596 - Check for sanity in DOM slot handling got removed
1358596. Restore check for sanity of slot indices on DOM objects that got lost.

https://hg.mozilla.org/mozilla-central/rev/35ba8c31d7f3 removes js::shadow::Object::MAX_FIXED_SLOTS and the DOM assert that used it.

But that assert is critical: We have jit code that depends on it.  Specifically, CodeGenerator::visitGetDOMMemberV and CodeGenerator::visitGetDOMMemberT both assume the slot is a fixed slot.  The assert used to assert that the slot index was small enough that this was true.  At the moment nothing prevents the DOM from ending up with a slot index that doesn't fit in fixed slots here...
2026-02-10 22:21:48 +02:00
win7-7 8ca7ff0375 1364288 - TSan: thread races on global TestingFunctions state vars
1364288 - Fix thread races on global JS shell vars
2026-02-10 22:21:47 +02:00
win7-7 29888489d1 1456524 - Assertion failure: !cycleEnd_, at js/src/jit/MoveResolver.h:286 with OOM
1456524 - Maintain MoveResolver invariants.

The MoveResolver is a persistent data structure that requires state to not leak between borrowers. An early-exit optimization in the case of OOM allows for state to leak, leading to impossible move list inputs, tripping assertions.
2026-02-10 22:21:46 +02:00
win7-7 eb57713afe 1337367 - Postpone spilling bundles till end of register allocation's main loop
1337367 - Postpone spilling bundles till after regalloc main loop

1299147 is already in currently.
2026-02-10 22:21:46 +02:00
win7-7 ec7588f6e7 1346191 - Some Speedometer tests spend a lot of time in IonBuilder
1346191 - Change Ion warmup threshold for small functions to be the same as the one for other functions.
2026-02-10 22:21:45 +02:00
win7-7 adbb570040 1346217 - Optimize adding/defining new properties on native objects
1346217 part 1 - Remove IsExtensible check from NativeObject::addProperty.

1346217 part 2 - Remove IsExtensible check from NativeObject::putProperty.

1346217 part 3 - Optimize UpdateShapeTypeAndValue.

1346217 part 4 - Optimize CallAddPropertyHook*.

1346217 part 5 - Optimize AddOrChangeProperty to call addProperty instead of putProperty when possible.

1346217 part 6 - Inline NativeObject::getChildPropertyOnDictionary into its only caller.

1346217 part 7 - Ensure NativeObject::updateSlotsForSpan and NativeObject::setLastProperty get inlined.

1346217 part 8 - Optimize IdIsIndex to check the first character before calling StringIsArrayIndex.

1346217 part 9 - Enable some assertions that were commented out a long time ago.
2026-02-10 22:21:43 +02:00
win7-7 35410dd47c 1373094 - Assertion failure: MIR instruction returned object with unexpected type, at js/src/jit/MacroAssembler.cpp:1695
1373094 - Fix ICUpdatedStub::addUpdateStubForValue to use the correct group.
2026-02-10 22:21:42 +02:00
win7-7 f08e7380cc 1369774 - Assertion failure: types, at js/src/jit/SharedIC.cpp:2560 with TypedObject
1369774 - Fix ICUpdatedStub::addUpdateStubForValue to handle TypedObjects correctly.
2026-02-10 22:21:42 +02:00
win7-7 548f87290c 1368509 - Generalize Baseline type update stubs
1368509 part 1 - Clean up DoTypeUpdateFallback a bit.

1368509 part 2 - Generalize Baseline unknown/unknownObject type update stubs.
2026-02-10 22:21:41 +02:00
win7-7 a2ff3e5ef8 1350263 - Port Baseline TypeOf IC to CacheIR
1350263 - Primitive typeof CacheIR support.

1350263 - Ion/MacroAssembler typeof object improvements.

1350263 - Typeof object CacheIR support.
2026-02-10 22:21:41 +02:00
win7-7 920ccb68c6 1358047 - Move Baseline CacheIR stubcode map from JitCompartment to JitZone
1358047 - Move Baseline CacheIR code map from JitCompartment to JitZone.
2026-02-10 22:21:40 +02:00
win7-7 1300e854a5 1357468 - Optimize Object.hasOwnProperty on Speedometer
1357468 - More Object.hasOwnProperty optimizations for Speedometer.
2026-02-10 22:21:38 +02:00
win7-7 18a8c7f0f9 1356822 - Assertion failure: self->template is<U>(), at js/src/jsobj.h:612
1356822 - Fix IonBuilder::jsop_bindname to pass the global lexical to the IC in the BINDGNAME case.
2026-02-10 22:21:37 +02:00
win7-7 43ff04ded1 1353359 - Port BindName IC to CacheIR
1353359 part 1 - Add BindNameIRGenerator and use it in Baseline.

1353359 part 2 - Add BindName stub for global (BINDGNAME) lookups.

1353359 part 3 - Add BindName stub for non-global (BINDNAME) lookups.

1353359 part 4 - Use BindName IC in Ion and remove the old IonCache infrastructure.
2026-02-10 22:21:36 +02:00
win7-7 b4e15d137b 1348905 - Fix Octane-TypeScript regression from bug 1328140
1348905 part 1 - Remove unnecessary IsPreliminaryObject check so we attach megamorphic setprop stubs in more cases.

1348905 part 2 - Clean up and fix HasTypePropertyId.

1348905 part 3 - Make SetNativeDataProperty skip the type barrier if the IC knows we don't need one.

I read that some functions that weren't being inlined by Clang according to the profiler but really should be. I think taking this across is good idea.
2026-02-10 22:21:35 +02:00
win7-7 91bee27493 1491350 - Assertion failure: !JS_IsExceptionPending(cx), at js/src/jsexn.h:130 with OOM and hasOwnProperty
1491350: Clear pending OOM exceptions before returning from hasNativeProperty / getNativePropertyByValue.
2026-02-10 22:21:34 +02:00
win7-7 010af0db91 1344469 - Optimize Object.hasOwnProperty
1344469 - Part 1 - Add JSOP_HASOWN to Interpreter and BytecodeEmitter.

1344469 - Part 2 - Baseline fallback support for HasOwn.

1344469 - Part 3 - CacheIR for HasOwn with baseline support.

1344469 - Part 4 - Megamorphic stub.

1344469 - Part 5 - CacheIR HasOwn in Ion.

1344469 - Part 6 - Port not defined property optimzation to HasOwn.
2026-02-10 22:21:32 +02:00
win7-7 5bf2b0326e 1345160 - Assertion failure: maybeTempDouble != InvalidFloatReg, at js/src/jit/IonCacheIRCompiler.cpp:1367
1345160 - Fix LIRGenerator::visitSetPropertyCache to consider INITELEM* ops too.
2026-02-10 22:21:31 +02:00
win7-7 290f9e7a8e 1344463 - Emit JSOP_INITELEM for _DefineDataProperty calls in self-hosted code
1344463 - Optimize JSOP_INITELEM in Ion and emit it for 3-arguments _DefineDataProperty in self-hosted code.

1344463 followup - Fix comment copy/paste issue.
2026-02-10 22:21:31 +02:00
win7-7 10315bfc2c 1350171 - Assertion failure: numFailures_ > 0 (numFailures_ should not overflow), at js/src/jit/ICState.h:113
1350171 - Try to transition IC mode before attaching AddSlot stubs.
2026-02-10 22:21:29 +02:00
win7-7 14c6fb86c1 1336580 - AddSlot ICs fail because of unperformed new script analysis
1336580 - Attach AddSlot stubs before we run the new-script analysis.
2026-02-10 22:21:28 +02:00
win7-7 0680913590 1337763 - Attach In stub for DenseElementHole
1337763 - Factor out GeneratePrototypeHoleGuards

1337763 - Add DenseInHole IC to CacheIR
2026-02-10 22:21:28 +02:00
win7-7 95b8434318 Fix errors.
Fix obvious errors.

Devtools work and javascript engine seems stable. Seems be issue that 1323854 was not done fully for some reason and was incomplete.
2026-02-10 22:21:26 +02:00
win7-7 afbcc019cd 1326213 - Unneeded abort at "Cannot inspect prototype chain."
1326213 - IonMonkey: Don't abort when trying to speculate on unstable proto.
2026-02-10 22:21:25 +02:00
win7-7 b7c39d8445 1341071 - Fix Ion IC post write barriers
1341071 - Fix Ion IC post barriers to be part of the IC stubs instead of adding them in IonBuilder.
2026-02-10 22:21:24 +02:00
win7-7 4f32494afa 1307651 - Assertion failure: fallibleScope_ ([OOM] Cannot allocate a new chunk in an infallible scope.), at js/src/ds/LifoAlloc.cpp:105
1307651 - IonMonkey - Ensure ballast in jsop_rest,
2026-02-10 22:21:24 +02:00
win7-7 78d8c019b6 1328133 - Assertion failure: fallibleScope_ ([OOM] Cannot allocate a new chunk in an infallible scope.), at js/src/ds/LifoAlloc.cpp:105
1328133: IonMonkey - Ensure ballast in PrototypeHasIndexedProperty
2026-02-10 22:21:23 +02:00
win7-7 5bbde7ec7a Remove duplication.
Remove duplication.
2026-02-10 22:21:21 +02:00
win7-7 a88f2330b4 1342261 - Assertion failure: comp == compartment || runtime()->isAtomsCompartment(comp) || (srcKind == JS::TraceKind::Object && InCrossCompartmentMap(static_cast<JSObject*>(src), thing)), at js/src/jsgc.cpp:3725
1342261 - Permit cross-compartment edges in CacheIR stubs.
2026-02-10 22:21:21 +02:00
win7-7 ad3b84d1e1 Re-reverting 1323099 with AbortReasonOr.
Re-reverting with AbortReasonOr/reinstating 1323099 back to js engine.

Seems this does fix crash now with AbortReasonOr used.
2026-02-10 22:21:20 +02:00
win7-7 321f6d5e8b 1338825 - CacheIR: Attach the addSlot stub for Arrays
1338825 - CacheIR: Attach the addSlot stub for Arrays.
2026-02-10 22:21:19 +02:00
win7-7 c5638b89f8 338323 - CacheIR should not attach SetArrayLength stub for non-writable length
1338323 - Don't attach SetArrayLength stub if length is not writable.
2026-02-10 22:21:19 +02:00
win7-7 94ee6a6ee4 1363054 - Make type monitor stubs work with unknown objects/values
1363054 part 1 - Remove redundant addMonitorStubForValue calls.

1363054 part 2 - Remove some shared stubs code that's no longer needed.

1363054 part 3 - Pass StackTypeSet* to addMonitorStubForValue.

1363054 part 4 - Attach generalized type monitor stubs for unknown/unknownObject type sets.
2026-02-10 22:21:18 +02:00
win7-7 edf72ba085 1351951
1351951 - Cleanup InitFromBailout to fight bit-rot

1351951 - Add ICStubCompiler::assumeStubFrame

1351951 - Cleanup GetStubReturnAddress handling
2026-02-10 22:21:17 +02:00
win7-7 9333728dab Fix and back to square one.
Fix and back to square one.

Original crash is back.. AbortReasonOr did not fix it.
2026-02-10 22:21:17 +02:00
win7-7 5ff81dc1d1 Rervert Replace JSOP_POS in ++/-- with JSOP_TONUMERIC.
Rervert Replace JSOP_POS in ++/-- with JSOP_TONUMERIC.
2026-02-10 22:21:15 +02:00
win7-7 404ca28600 Revert "Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Doubles in Ion."
This reverts commit dca8417ba7.

Revert "Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Ion on Intel32/64."

This reverts commit 8f26f1a873.
2026-02-10 22:21:14 +02:00
win7-7 3ec9a95528 1318677 - Optimize Result<Ok, E> with sizeof(E) < sizeof(uintptr_t)
1318677 part 1 - Use a smaller mask to remove the error tag.

1318677 part 2 - mozilla::Result: Use a single enum to dispatch to the Result implementation.

1318677 part 3 - mozilla::Result: Add a new packing strategy to pack small enumerated values in a single word.
2026-02-10 22:21:13 +02:00
win7-7 b3f1814535 1324829 - Add mozilla::Result::andThen
1324829 - Add the `mozilla::Result::andThen` method;
2026-02-10 22:21:13 +02:00
win7-7 031d3a6ee8 Fix.
Fix.
2026-02-10 22:21:12 +02:00
win7-7 97ffb6f2ef 1392530 - Devirtualize MDefinition::op()
1392530 part 1 - Make MDefinition::Opcode an enum class.

1392530 part 2 - Devirtualize MDefinition::op() by storing the op in MDefinition.

1392530 part 3 - Make MDefinition::valueHash() overloads more consistent.
2026-02-10 22:21:12 +02:00
Jan de Mooij 910cc1e7cd Bug 1391611 - Devirtualize MNode::kind(). r=nbp
Seems  without doing 1392530 abstract class, do that next.
2026-02-10 22:21:11 +02:00
win7-7 c632728c90 Fixes.
Fixes.

Mostly BigIntl misses and various other post-AbortReason additions.
2026-02-10 22:21:11 +02:00
win7-7 e8c335f2a4 1416794 - MOZ_CRASH in js::jit::IonBuilder::inlineScriptedCall (with --ion-eager)
1416794 - InliningDecision_Error is always reported with a pending exception, use AbortReason_Error instead of _Alloc.
2026-02-10 22:21:10 +02:00
win7-7 f129bbb03d 1375435 - Assertion failure: resumePointsEmpty(), at js/src/jit/MIRGraph.cpp:1092
1375435 - Clear the GetPropertyCache prior resume-point at the end of IonBuilder build functions.
2026-02-10 22:21:09 +02:00
win7-7 17a7711e4a 1286505 part 3 - IonBuilder::jsop_getname, remove useless push & pop.
1286505 part 3 - IonBuilder::jsop_getname, remove useless push & pop.
2026-02-10 22:21:08 +02:00
win7-7 abdd059d9f 1286505 part 2 - Use Result<V,E> to report errors within IonBuilder.
1286505 part 2 - Use Result<V,E> to report errors within IonBuilder.

Hopefully did not miss anything since part 2 was so huge.
2026-02-10 22:21:07 +02:00
win7-7 f445cc0d55 1286505 part 1
1286505 part 1 - Convert AbortReason enum to an enum class.

Merge part 2 and 3 after seeing compilation and working.
2026-02-10 22:21:05 +02:00
win7-7 8f18e04d5f Revert.. 1323099
Revert.. 1323099

Yep its cause of crashing right now.
2026-02-10 22:21:04 +02:00
win7-7 afee9c3581 1360523 - Make the number of reserved slots dynamic for proxy classes
1360523 - Define number of reserved slots explicitly for each proxy js::Class.
2026-02-10 22:21:04 +02:00
win7-7 47648325f7 1360520 - Use grayLinkExtraSlot instead of hard coding 1 in ProxyObject::trace
1360520 - Add a GrayLinkReservedSlot constant and use it instead of hardcoding 1.
2026-02-10 22:21:02 +02:00
win7-7 b7189a810e 1356691 - Make DeadObjectProxies preserve IsCallable and IsConstructor statically instead of an extra slot
1356691 - Preserve DeadObjectProxy's IsCallable and IsConstructor values statically with templates.
2026-02-10 22:21:01 +02:00
win7-7 a881165fed 1237504 - Refactor proxy slot layout to allow proxies to have more than 2 slots.
The patch makes the following proxy changes: *

The number of slots in ProxyValueArray is now dynamic and depends on the number of reserved slots we get from the Class.
* "Extra slots" was renamed to "Reserved slots" to make this clearer. * All proxy Classes now have 2 reserved slots, but it should be easy to change that for proxy Classes that need more than 2 slots. * Proxies now store a pointer to these slots and this means GetReservedSlot and SetReservedSlot can be used on proxies as well. We no longer need GetReservedOrProxyPrivateSlot and SetReservedOrProxyPrivateSlot.

And some changes to make DOM Proxies work with this:

* We now store the C++ object in the first reserved slot (DOM_OBJECT_SLOT) instead of in the proxy's private slot. This is pretty nice because it matches what we do for non-proxy DOM objects. * We now store the expando in the proxy's private slot so I removed GetDOMProxyExpandoSlot and changed the IC code to get the expando from the private slot instead.
2026-02-10 22:21:00 +02:00
win7-7 9b4c40ade7 1386700 Move trivial MBasicBlock accessors to the header file
Define some trivial MBasicBlock methods in the header file so the compiler can inline them
2026-02-10 22:20:59 +02:00
win7-7 f31d4a5606 1339207 - Always build CacheIRSpewer in Nightly
1339207 - Always build CacheIRSpewer in Nightly builds.

Get this to compile.
2026-02-10 22:20:58 +02:00
win7-7 6f1ff006c6 1334590 - AddressSanitizer: heap-buffer-overflow [@ char* js::QuoteString<char16_t>] with READ of size 2 with newExternalString
1334590 - Fix QuoteString to not read a character out of bounds.
2026-02-10 22:20:57 +02:00
win7-7 12d602e9c9 1348821 - Change CacheIR spewer to log IC mode
1348821 - For MegamorphicNativeSlot differentiate between HandleMissing.

1348821 - Log CacheIR IC mode.

1348821 - Log address and shape of objects in CacheIR.

1348821 - probably fix unified build failure.

1348821 - Fix it.
2026-02-10 22:20:55 +02:00
win7-7 1ad4c85853 Various fixes
Various fixes.

Mostly misses in previous porting.
2026-02-10 22:20:54 +02:00
win7-7 e318212175 Fixes + 1341061 - Refactor NAME-related runtime functions.
1341061 - Refactor NAME-related runtime functions.
2026-02-10 22:20:53 +02:00
win7-7 ce208d9437 1337871 - Fix EmitBaselineEnterStubFrame and EmitBaselineLeaveStubFrame to not clobber the tail call register
1337871 - Clean up and optimize code for entering/leaving Baseline stub frames.

1337871 part 2 - Remove some shared IC code that's no longer used.
2026-02-10 22:20:52 +02:00
win7-7 142afd6f6a Fixes.
Fixes.
2026-02-10 22:20:51 +02:00
win7-7 5011470df7 1328140 - Handle IC failures better
1328140 - Improve handling of IC failures, add megamorphic IC stubs.
2026-02-10 22:20:50 +02:00
win7-7 40711d710b 1344198 - Inline various Shape search functions.
1344198 - Inline various Shape search functions.
2026-02-10 22:20:49 +02:00
win7-7 e77d4208ac 1349298 - Assertion failure: numOptimizedStubs_ < 16, at js/src/jit/ICState.h:104
1349298 - Add a stub limit to Baseline's TypeOf IC.
2026-02-10 22:20:49 +02:00
win7-7 a14b4a0ec4 1345707 - Assertion failure: nonProxyIsExtensible(), at js/src/vm/NativeObject.cpp:848
1345707 - Don't attach set-dense-hole stubs for non-extensible objects.
2026-02-10 22:20:48 +02:00
win7-7 8129ac1060 1344691 - CacheIR: dense element stub should support element (re)allocation
1344691 - Make add-dense-element stub support element (re)allocation.
2026-02-10 22:20:47 +02:00
win7-7 907f180622 1337024 - Convert SETELEM dense/typed array IC to CacheIR
1337024 part 1 - Convert Baseline stubs for setting dense/unboxed elements to CacheIR.

1337024 part 2 - Port Baseline stubs for adding dense/unboxed elements to CacheIR.

1337024 part 3 - Port Baseline TypedArray/TypedObject SetElem stub to CacheIR.
2026-02-10 22:20:46 +02:00
win7-7 c1423ff4e0 1344218 - Remove holder and holderShape arguments from IonBuilder::testCommonGetterSetter
1344218 - Rewrite IonBuilder::testCommonGetterSetter to search for the holder instead of taking it as argument.
2026-02-10 22:20:45 +02:00
win7-7 7f1ef3f84b 1344195 - CloneOldBaselineStub should not clone the stub if we didn't recompile the script
1344195 - Fix CloneOldBaselineStub to not clone the stub if we didn't recompile the script.
2026-02-10 22:20:44 +02:00
win7-7 94781806b0 1342856 - CacheIR: optimize volatile register spilling in IC code
1342856 - Optimize volatile register spilling for C++ calls from IC stubs.
2026-02-10 22:20:43 +02:00
win7-7 d3cedcf2a6 1333067 - Remove old Ion GetPropertyIC code
1333067 - Remove old Ion GetPropertyIC code.
2026-02-10 22:20:43 +02:00
win7-7 1c80eea635 1326437 - Use CacheIR GetName IC in Ion
1326437 part 2 - Don't shape guard non-extensible call objects.

1326437 part 3 - Port Ion GetName IC to CacheIR.
2026-02-10 22:20:42 +02:00
win7-7 00e36cf767 1357024 + 1360852.
1357024 - Fix fixupAliasedInputs to not leave an unusable register on 32-bit platforms.

1360852 - Fix emitGuardIsInt32Index to allocate input register before calling addFailurePath.
2026-02-10 22:20:41 +02:00
win7-7 5dddd47e9e 1341067 - Port Ion SetProp/SetElem IC to CacheIR
1341067 - Port Ion SetProp/SetElem IC to CacheIR.

1341067 followup - Fix non-unified build bustage.

1341067 followup - Some renaming review nits I forgot to qref.

1328140 nothing further will work without it.
2026-02-10 22:20:40 +02:00
win7-7 48dcbe8a31 1338828 - Add SetProp/SetElem stub for (DOM) Proxies
1338828 part 1 - Add CacheIR SetProp/SetElem stubs for proxies.

1338828 part 2 - Add CacheIR SetProp/SetElem stubs for shadowing DOM proxies.

1338828 part 3 - Add CacheIR SetProp/SetElem stubs for unshadowed setter calls on DOM proxies.
2026-02-10 22:20:39 +02:00
win7-7 d51650e334 1319087 - CacheIR: optimize cross-compartment wrappers
1319087 - Implement a CrossCompartmentWrapper IC stub.

1342170 - Fixes jscompartment inlines for js/src/jit files.
2026-02-10 22:20:38 +02:00
win7-7 da1552065e 1331034 - CacheIR: Debugging Tools
1331034 - Introduce a JSONPrinter class.

1331034 - Make JSONSpewer inherit from JSONPrinter.

1331034 - Introduce CacheIRSpewer.
2026-02-10 22:20:37 +02:00
win7-7 0b6aa79c6d 1334187 - Port Baseline JSOP_IN to CacheIR
1334187 - Add ICCacheIR_Regular base class.

1334187 - Add CacheIR scaffolding for JSOP_IN.

1334187 - Port In_Dense from BaselineIC to CacheIR.

1334187 - Port In_Native/In_NativePrototype from BaselineIC to CacheIR.

1334187 - Port In_NativeDoesNotExist from BaselineIC to CacheIR.
2026-02-10 22:20:35 +02:00
win7-7 444521ae5f 1335405 - Use SetPropIRGenerator for Baseline SetElem stubs
1335405 part 1 - Replace unused JOF_SET with JOF_PROPINIT and JOF_PROPSET.

1335405 part 2 - Use SetPropIRGenerator for Baseline SETELEM stubs.
2026-02-10 22:20:34 +02:00
win7-7 5e879ec6bb 1323099 - Ion GetProperty IC should be used when the input is a Value
1323099 part 1 - Use Ion GetPropertyIC also when the input is a boxed Value.
2026-02-10 22:20:33 +02:00
win7-7 d7dc0fb252 1091978 - Investigate having a Baseline IC for adding a property even if that involves slot allocation/reallocation
1091978 - Make CacheIR AddProp stub support dynamic slot (re)allocation.
2026-02-10 22:20:32 +02:00
win7-7 832d7835da 1334727 - CacheIR: Set array length IC
1334727 - CacheIR: SetProp array length IC.
2026-02-10 22:20:31 +02:00
win7-7 d9b396718e 1333690 - Port Baseline SetProp IC to CacheIR, part two
1333690 part 1 - Port Baseline setter stubs to CacheIR.

1333690 part 2 - Remove now-dead code related to ReceiverGuard.

1333690 part 3 - Port Baseline AddSlot stub to CacheIR.
2026-02-10 22:20:30 +02:00
win7-7 772054282e 1359252 - Assertion failure: [barrier verifier] Unmarked edge: Object 0x7ffff46d1070 'obj' edge to Object 0x7ffff46f4070, at js/src/gc/Verifier.cpp:379
1359252 - Add pre-write barrier for JIT writes to NativeIterator::obj.
2026-02-10 22:20:29 +02:00
win7-7 bff79d1988 1367455 - Scheduled GCs should avoid interrupting running GCs
1367455 - Attempt to avoid interrupting currently running GCs.
2026-02-10 22:20:28 +02:00
win7-7 b05b09946c 1325686: De-unify Interpreter.cpp.
1325686: De-unify Interpreter.cpp.

Increases compilation time of files its unified with.
2026-02-10 22:20:28 +02:00
win7-7 51d4df1b86 Merge branch 'build-everything-unified' into UXP-custom-new-hybrid-js-engine-IonControlFlow-splitting-unified-building-fully 2026-02-10 22:20:27 +02:00
win7-7 05df13a866 1358504 - Add a 1-entry cache to ObjectGroup::defaultNewGroup
1358504 - Add a 1-entry cache to ObjectGroup::defaultNewGroup.
2026-02-10 22:20:25 +02:00
win7-7 7e3b50cc9d 1341090 -Update malloc bytes count when allocating executable memory
1341090: Refactor malloc counters in Zone and GCRuntime.

1341090: Implement a JIT code counter.
2026-02-10 22:20:24 +02:00
win7-7 1e66b8e521 1427860 - Crash [@ JSScript::functionNonDelazifying] involving saveIncrementalBytecode
1427860 - XDR failures should leave script isUncompleted().

Failures during XDR may leave the script partially initialized in a way that confuses coverage collection. This ensures the shared script data is removed from a script if there are any XDR failures in it.
2026-02-10 22:20:23 +02:00
win7-7 2b41223b34 1351357 - OffMainThread XDR Decoding fails to decode RegExp.
1351357 - Use the ReadOnlyCompileOptions from the HelperThread while decoding RegExp.
2026-02-10 22:20:23 +02:00
win7-7 1f7a3b966c 1358521 - XDROffThreadDecoder fails to decode inner functions (Gecko)
1358521 - XDRScript: Only fail on mismatch between the top-level JSScript and the decoding CompileOption.
2026-02-10 22:20:21 +02:00
win7-7 13237107dc Decode XDR off-main-thread, missing parts.
900784 part 0.11 - Instrument XDR Encode/Decode function with the TraceLogger.

1316078 part 2 - Make XDR traceLogger work on a different thread.

Some other parts also missed functionality.
2026-02-10 22:20:21 +02:00
win7-7 ddbbbf8261 1321437 - Differential Testing: Different output message involving Object.freeze
1321437 - Fix ThrowReadOnlyError to match the error message we would throw in the VM.
2026-02-10 22:20:20 +02:00
win7-7 521b5afc1d 1324020 - Unreachable code in EnumerableOwnProperties?
1324020 - Remove unreachable code in EnumerableOwnProperties function.
2026-02-10 22:20:20 +02:00
win7-7 31e7e8e4eb 1320989 - Remove unused dead zone state in GCRuntime
1320989 - Remove unused state in GCRuntime related to dead zones
2026-02-10 22:20:19 +02:00
win7-7 e673c41450 1359093 - Inline the ToWindowProxyIfWindow is-global check
1359093 - Inline the ToWindowProxyIfWindow is-global check.
2026-02-10 22:20:19 +02:00
win7-7 0eadc041c2 1323242 - Ignore spurious wakeups when waiting for background sweeping to finish
1323242 - Ignore spurious wakeups when waiting for background thread to finish sweeping.
2026-02-10 22:20:18 +02:00
win7-7 09bda90c29 1341367 - HashTable::Ptr::isValid returns the opposite of what you expect
1341367 - Make the sense of HashTable::Ptr::isValid match its name.
2026-02-10 22:20:17 +02:00
win7-7 de3b798e70 981201 - Remove JS_IsRunning
981201 - Stop using JS_IsRunning in PreciseGCRunnable::Run and remove JS_IsRunning.
2026-02-10 22:20:17 +02:00
win7-7 b1f5a0357e 1331115 - Typo in variable name in IdToObjectMap::trace()
1331115 - Fix two typos in CPOW code.
2026-02-10 22:20:16 +02:00
win7-7 c0e8011ba1 1332946 - CacheIR: IC for function.length
1332946 - CacheIR: IC for function.length.
2026-02-10 22:20:15 +02:00
win7-7 9063aacbe0 1332593 - Optimize lookups of plain data properties on WindowProxies
1332593 - Optimize lookups of data properties on WindowProxies.
2026-02-10 22:20:15 +02:00
win7-7 c2d097f15e 1329016 - CacheIR: Allow -0 (negative zero) index
1329016 - Allow negative zero in CacheIR index check.
2026-02-10 22:20:14 +02:00
win7-7 6aab86b636 1329195 - CacheIR: Update old stubs instead of attaching a new stub when a DOM proxy's generation changes
1329195 - Update old stubs instead of attaching a new stub when a DOM proxy's generation changes.
2026-02-10 22:20:13 +02:00
win7-7 cc51344198 1330793 - Google docs regularly hangs when selecting text
1330793 - Refactor int32 index guard to not modify the input register.
2026-02-10 22:20:12 +02:00
win7-7 1498b03ac2 1326067 - Port Baseline SetProp IC to CacheIR
1326067 part 1 - Change Baseline SetProp IC to leave the RHS value on the stack instead of returning it.

1326067 part 2 - Convert Baseline setslot IC stub to CacheIR.

1326067 part 3 - Port Baseline unboxed object SetProp stub to CacheIR.

1326067 part 4 - Port Baseline TypedObject SetProp stub to CacheIR.

1326067 part 6 - Fix EmitStubGuardFailure to not clobber registers on ARM/MIPS.

1326067 part 7 - Fix type update code to use the unboxed object instead of the UnboxedExpandoObject.
2026-02-10 22:20:11 +02:00
win7-7 8f0d30d4dd 965992 - Make own property gets of expandos on DOM proxies faster
965992 part 1 - Rename some CacheIR instructions related to DOM proxies.

965992 part 2 - Add inline caches for getting DOM expando properties.

965992 part 3 - Add an is-object debug assert to GuardDOMExpandoMissingOrGuardShape.
2026-02-10 22:20:10 +02:00
win7-7 c3966437e7 1328077 - CacheIR: Attach DenseElementHole even with zero dense elements
1328077 - Attach dense element hole IC even with zero dense elements.
2026-02-10 22:20:08 +02:00
win7-7 00a1538980 1328076 - CacheIR: Attach primitive IC even for non-existant properties
1328076 - Attach primitive IC for more properties.
2026-02-10 22:20:08 +02:00
win7-7 4337af35f2 1323190 - Attach Proxy GetElem IC
1323190 - Attach Proxy GetElem IC.

1323190 - Remove Proxy friendapi.

1323190 - Inline Proxy::get into JIT VM functions.
2026-02-10 22:20:07 +02:00
win7-7 cea9fad3d1 1323096 - CacheIR: optimize more value[double] cases
1323096 - Optimize object[double] and object[string] like object[int32].
2026-02-10 22:20:06 +02:00
win7-7 0a17a23965 1476417 - Differential Testing: Different output message involving arguments
1476417: Add a resume point after assigning to a mapped argument.
2026-02-10 22:20:05 +02:00
win7-7 c76abfaf64 1326589 - Assertion failure: info.frame()->isFunctionFrame() || info.frame()->isEvalFrame(), at js/src/jit/SharedIC.cpp:2612 or Assertion failure: stub->monitorsThis() || *GetNextPc(pc) == JSOP_CHECKTHIS || *GetNextPc(pc) == JSOP_CHECKRETURN, at js/src/jit/SharedIC
1326589 - Correct CacheIR issue with uninitialized let and GetGName.
2026-02-10 22:20:04 +02:00
win7-7 7b11366269 1324566 - Port Baseline GetName IC to CacheIR
1324566 - Set available registers after initializing the input locations.

1324566 - Port Baseline GetName_Env to CacheIR.

1324566 - Port Baseline GlobalNameValue to CacheIR.

1324566 - Port Baseline GlobalNameAccessor to CacheIR.

1324566 - Inspector support for GlobalNameGetter.
2026-02-10 22:20:03 +02:00
win7-7 74fafd4630 1325361 - Optimize PropertyReadNeedsTypeBarrier for typed objects
1325361 - Remove check for typed objects from PropertyReadNeedsTypeBarrier.
2026-02-10 22:20:03 +02:00
win7-7 be6d02a128 1334356 - Crash [@ js::jit::IonCannon] or Assertion failure: Should have monitored undefined result, at js/src/jit/MacroAssembler.cpp:1597
1334356 - Don't attach a missing-property stub if extra warnings are enabled.
2026-02-10 22:20:02 +02:00
win7-7 06259ea8a9 1330248 - Assertion failure: hasIonScript(), at js/src/jsscript.h:1417
1330248 - Make sure the script still has an IonScript before attaching a stub.
2026-02-10 22:20:00 +02:00
win7-7 c38bcf4063 1326150 - Assertion failure: hasValue(), at js/src/jit/RegisterSets.h:210
1326150 - Don't attach getter stubs to IonGetPropertyIC if the IC result isn't monitored.
2026-02-10 22:19:59 +02:00
win7-7 1fd0631baf 1322093 - Generate Ion IC stubs from CacheIR
Part 1 - Split up BaselineCacheIR.{cpp,h}.

Part 2 - Add a mechanism to share codegen for cache ops between Baseline/Ion.

Part 3 - Optimize type guards if we know they always succeed.

Part 4 - Add OperandLocation::Constant since Ion ICs can have constant operands.

Part 5 - Factor out restoreInputState from emitFailurePath.

Part 6 - Add helpers for pushing/popping values.

Part 7 - Make restoreInputState work for Ion ICs.

Part 8 - Rename BaselineCacheIR.{cpp,h} to BaselineCacheIRCompiler.{cpp,h}.

Part 9 - Minor cleanup.

Part 10 - Add initInputLocation overloads for register types used by Ion.

Part 11 - GetPropIRGenerator changes to support idempotent Ion ICs.

Part 12 - Move codegen for some ops to shared code.

Part 13 - Share codegen of ops that use the output register.

Part 14 - Add MacroAssembler::storeRegsInMask.

Part 15 - Rename JitFrame_IonAccessorIC to JitFrame_IonICCall.

Part 16 - Add IonIC infrastructure.

Part 17 - Barrier reads from typed objects so we can attach a typed object IC stub.

Part 18 - Add IonCacheIRCompiler to compile Ion IC stubs from CacheIR.

Part 19 - Enable the new IonGetPropertyIC that's based on CacheIR.

Followup - Make idempotent ICs handle unshadowed DOM proxies to fix Dromaeo regressions.

Followup - Fix the --disable-ion build.

Followup - Add a missing return that got lost in the rewrite.
2026-02-10 22:19:59 +02:00
win7-7 55ab1381b6 1323037 - CacheIR: support dense elements with holes.
1323037 - CacheIR for dense elements with holes.
2026-02-10 22:19:58 +02:00
win7-7 b22653c282 1322091 - Port remaining Baseline GETELEM stubs to CacheIR
1322091 part 1 - Port Baseline string GETELEM stub to CacheIR.

1322091 part 2 - Port Baseline lazy arguments GETELEM stub to CacheIR.

1322091 part 3 - Port Baseline ArgumentsObject GETELEM stub to CacheIR.

1322091 part 4 - Port Baseline dense element GETELEM stub to CacheIR.

1322091 part 5 - Port Baseline unboxed array GETELEM stub to CacheIR.

1322091 part 6 - Port Baseline TypedArray/TypedObject GETELEM stub to CacheIR.
2026-02-10 22:19:57 +02:00
win7-7 a56f8d2962 1338374 remnants.
1338374 remnants.
2026-02-10 22:19:56 +02:00
win7-7 38f864a62a Bug 1383467 - Only cancel Ion compilations that use nursery pointers when performing a minor GC
Only cancel Ion compilations that use nursery pointers when performing a minor GC.

One part of 1338374 in js engine seems be missing by looks of it.
2026-02-10 22:19:55 +02:00
win7-7 b4241013a7 1398140: Remove the Ion helper thread pausing
We have this mechanism where we allow 1 helper thread at a time to do Ion compilation. If a higher priority task comes in, we can pause other compilation threads, process the new task on a new thread, then unpause the paused thread(s).

This adds quite a lot of complexity (to code that's already complicated enough!). It also has some issues:

* We would like to Ion-compile scripts in parallel, especially when the CPU has 4+ cores.

* Pausing compilation threads means these threads are not available for other tasks (GC, Wasm, parsing).

* IonBuilderHasHigherPriority includes the size and warm up count of the outer script, but due to inlining it's not clear whether that's very useful.
2026-02-10 22:19:54 +02:00
win7-7 4cec029265 1541580 - Cleanup ProxyObject creation
1541580 - Cleanup ProxyObject creation.
Sec-fix.
2026-02-10 22:19:53 +02:00
win7-7 bf4fb7d4a4 1358753 - Allocate ProxyValueArray inline
1358753 - Allocate ProxyValueArray inline in the object instead of using malloc.
2026-02-10 22:19:53 +02:00
win7-7 45c2f4d891 1339507 - Optimize shape/group lookups in ProxyObject::create
1339507 - Cache the shape/group lookup in ProxyObject::create.
2026-02-10 22:19:52 +02:00
win7-7 68e3ca23b2 1339411 - Rewrite and optimize object allocation paths.
1339411 - Rewrite and optimize object allocation paths.

Also includes  1342170 - Fixes NativeObject::create inlines for js/src/vm/ files.
2026-02-10 22:19:50 +02:00
win7-7 095c63382d 1347489 - Vector in StringSegmentRange should have some inline capacity
1347489 - Give StringSegmentRange stack Vector some inline capacity to avoid malloc/free overhead.
2026-02-10 22:19:49 +02:00
win7-7 6b8539a159 1331475 - Don't atomize "ArraySort" for every call to the self-hosted ArraySort function.
1331475 - Don't atomize "ArraySort" for every call to the self-hosted ArraySort function.
2026-02-10 22:19:49 +02:00
win7-7 4e99edfb72 1342439 - Clean up and optimize overrecursion checks
1342439 part 1 - Replace macros to check for overrecursion with functions.

1342439 part 2 - Optimize CheckRecursionLimit to avoid uninlined RunningWithTrustedPrincipals call.
2026-02-10 22:19:47 +02:00
win7-7 df3deef9ab 1365654 - Hash table Enum objects cannot be returned from a function.
1365654 - Add a move constructor to HashTable::Enum.

1365654 - Fix style bustage.
2026-02-10 22:19:46 +02:00
win7-7 b9ffb54e6c Fixes.
Fixes for IonControlFlow.cpp.

Do not use hard assert for now due crash.

Also fix nullish for IonControlFlow.cpp and .h and IonBuilder.cpp

 Bug 1331354 - IonMonkey: Use CopyWithNewTargets for more cases during CFG creation.

1344753 - Update for-of stack depth in ControlFlowGenerator::processWhileOrForInLoop.
2026-02-10 22:19:45 +02:00
win7-7 ff0909234e 1342345 part 2 - Use a Vector for AutoCycleDetector.
1342345 part 2 - Use a Vector for AutoCycleDetector.

Part 1 is already in by upstream but part 2 is not.
2026-02-10 22:19:45 +02:00
win7-7 d67c2e7413 1319746: Add a memory reporter for CFGGraph on BaselineScript
1319746: Add a memory reporter for CFGGraph on BaselineScript.
2026-02-10 22:19:44 +02:00
win7-7 108f2d7287 1324580: Assertion failure: fallibleScope_ ([OOM] Cannot allocate a new chunk in an infallible scope.), at js/src/ds/LifoAlloc.cpp:105
1324580: IonMonkey - Fix out of memory error in IonBuilder.
2026-02-10 22:19:42 +02:00
win7-7 3079986f03 1323854 - Assertion failure: exprStack == stackDepth, at js/src/jit/Recover.cpp:110
1323854 - IonMonkey: Part 1: Update start pc on empty backedges.

1323854 - IonMonkey: Part2: Keep the same semantics as bytecode on CFGCompare.

1323854 - Fix unused bodies variable, r=bustage on CLOSED TREE.
2026-02-10 22:19:42 +02:00
win7-7 6a5a2d03f4 1323027 - 2.64% kraken (osx-10-10) regression on push 2f96ca59484d (Thu Dec 8 2016)
1323027: IonMonkey - Remove empty blocks.
2026-02-10 22:19:41 +02:00
win7-7 0cf73ebe3d 1322774: IonMonkey - Test for OOM condition when creating cases for tableswitch
1322774: IonMonkey - Test for OOM condition when creating cases for tableswitch.
2026-02-10 22:19:41 +02:00
win7-7 299f029c28 1322900 - Firefox Nightly 53.0a1 (2016-12-10) crashes in [@ js::jit:: ... ] & [@ ComputeImmediateDominators ]
1322900 - IonMonkey: Make sure all predecessors are iterated during removal of successor blocks.
2026-02-10 22:19:40 +02:00
win7-7 56c6a0fdf0 1322932: IonMonkey - Only iterate the backedge of the inner-loop when it has already be visited
1322932: IonMonkey - Only iterate the backedge of the inner-loop when it has already be visited.

IonBuilder.cpp changes are not necessary without 1322724 (Android performance regression, nobody cares mobile on UXP).
2026-02-10 22:19:39 +02:00
win7-7 394326a6ff Remove single-threaded BigInt conditions to make it multi-threaded.
Remove single-threaded BigInt conditions to make it multi-threaded.

Fixes debug crash following Mozilla in way they did this.
2026-02-10 22:19:39 +02:00
win7-7 53baf73f30 1310155 - Split IonBuilder into cfg and the rest.
1310155 - IonMonkey, part 0.1: Make sure to report the out of memory during IonBuilder.

1310155 - IonMonkey, part 0.2: Make sure debug_check_operand works again.

1310155 - IonMonkey, part 1.0: Split graph creation from IonBuilder.

1310155 - IonMonkey, part 1.1: Use a separate allocator for all control flow graphs.

1310155: IonMonkey - Part 1.2 - Remove accidental pushed spewing.
2026-02-10 22:19:38 +02:00
win7-7 63c53e14b8 Fixes.
Fixes.
2026-02-10 22:19:37 +02:00
win7-7 8fa8502cdc 1320670 - Use CacheIR GetPropIRGenerator for Baseline's GetElement IC
1320670 part 1 - Use jsid instead of PropertyName in GetPropIRGenerator.

1320670 part 2 - Use GetPropIRGenerator for GETELEM stubs in Baseline.
2026-02-10 22:19:37 +02:00
win7-7 eeb74cb0bc 1320145 - Port remaining GETPROP stubs to CacheIR
1320145 part 1 - Port string.length stub to CacheIR.

1320145 part 2 - Port length/callee stubs on lazy arguments to CacheIR.
2026-02-10 22:19:36 +02:00
win7-7 3c1170a8cb 1320118 - Some CacheIR cleanup
1320118 part 1 - Remove emitted_ bool from GetPropIRGenerator.

1320118 part 2 - Clean up tryAttachNative to handle all cases in the switch statement.

1320118 part 3 - Introduce AutoStubFrame to emit stub frames.
2026-02-10 22:19:36 +02:00
win7-7 b98f35198c 1319087 - Introduce CacheIR for TypeMonitorResult/ReturnFromIC.
1319087 part 1: Introduce CacheIR for TypeMonitorResult/ReturnFromIC.

This fixes crash with 1319437.
2026-02-10 22:19:35 +02:00
win7-7 557f11c9d5 1322320 - CacheIR: ensure we don't attach duplicate Baseline stubs
1322320  - Ensure we don't attach duplicate Baseline stubs.

Does not fix crash.
2026-02-10 22:19:33 +02:00
win7-7 97d13487b7 1319437 - Port Baseline GETPROP DOM proxy stubs to CacheIR
1319437 part 1 - Add a generic proxy GETPROP stub to CacheIR.

1319437 part 2 - Port code for GETPROP on shadowing DOM proxies to CacheIR.

1319437 part 3 - Support 64-bit fields in CacheIR stubs.

1319437 part 4 - Port code for unshadowed GETPROP on DOM proxies to CacheIR.

1319437 part 5 - Use CustomAutoRooter for CacheIRWriter.

Some fixes. It still does not compile.
Template error.
2026-02-10 22:19:32 +02:00
win7-7 ada5b1d9ae Debug fixed assert.
Debug fixed assert.
2026-02-10 22:19:31 +02:00
win7-7 b7f8d1a425 Fixes.
Fixes + reverting part 2/simplification (Remove numFuncDefs() from the ModuleGenerator) which should not be strictly needed anyway for later parts of these changes. It was just simplification based to 1317319  (which is not in and I'm not yet sure I will take it in).
2026-02-10 22:19:30 +02:00
win7-7 5645c0a9a8 1320374 - Baldr: batch compilations
1320374: Rename THREAD_TYPE_ASMJS into THREAD_TYPE_WASM.

1320374: Remove numFuncDefs() from the ModuleGenerator.

1320374: wasm: move IonCompileTask out of FunctionGenerator.

1320374: Rename IonCompileTask to CompileTask and {Compile,Instantiate}Task to {1}PromiseTask.

1320374: Add missing null-checks.

1320374: Batch function compilations.
2026-02-10 22:19:29 +02:00
win7-7 780deaac89 1319388 - Wasm baseline: Generate function prologue in-line
1319388 - Add add32ToPtrWithPatch and patchAdd32ToPtr to MacroAssembler.

1319388 - wasm baseline: Generate function prologue in-line by patching.
2026-02-10 22:19:29 +02:00
win7-7 8665133370 1319415 - Assertion failure: isAvailable(r), at js/src/wasm/WasmBaselineCompile.cpp:692
1319415 - pop value stack on block end before attempting to capture join register.
2026-02-10 22:19:28 +02:00
win7-7 6b0cc3bda1 1316850 - Wasm baseline: Vet the 0xC changes
1316850 - check return from fallible allocator.

1316850 - no need to allow null label in pushControl.

1316850 - make sure we don't fall through into endFunction.

1316850 - reduce code duplication.

1316850 - clean up void handling.

1316850 - restore old value stack popping regime, with a twist.
2026-02-10 22:19:28 +02:00
win7-7 93b723ed8a Fixes.
1316815 followup build fix on a CLOSED TREE

This was not taken in additionally some need be r.reg instead just r like in signExtendI64_8 and signExtendI64_16.

popJoinRegUnlessVoid does not exist yet. It need be allocJoinReg. pushJoinRegUnlessVoid need be pushJoinReg.
2026-02-10 22:19:27 +02:00
win7-7 d0bc40b0c4 1322288 - Assertion failure: isAvailable(r), at js/src/wasm/WasmBaselineCompile.cpp:806
1322288 - wasm baseline, reserve float join registers in optimized control flow.

Introduced by 1286816 so fixing it now.
2026-02-10 22:19:26 +02:00
win7-7 254bbc9ef6 1316827 - Wasm baseline: Improve double stack adjustments following calls.
1316827 - WASM: the stack is now free'd once, even when an adjustment is needed.
2026-02-10 22:19:26 +02:00
win7-7 62e7c0dc83 1316848 - Wasm baseline: Avoid using a zero temp register for EqzI64
1316848 - Wasm baseline: Avoid using a zero temp register for EqzI64.
2026-02-10 22:19:25 +02:00
win7-7 ff1f2252a2 1316816 - Wasm baseline: Avoid double dispatch in popI64(), popF32(), popF64()
1316816: Refactor {load,pop}{I64,F32,F64} to avoid testing src.kind() twice.

This makes the code follow the same pattern as loadI32/popI32.
2026-02-10 22:19:25 +02:00
win7-7 4a52613847 1316815 - Wasm baseline: Make RegI32, RegI64, RegF32, RegF64 inherit from, not wrap, Register, Register64, FloatRegister
1316815 - Make RegI32, RegI64, RegF32, RegF64 inherit from, not wrap, Register, Register64, FloatRegister.
2026-02-10 22:19:24 +02:00
win7-7 3a332cf05e 1286816 - Wasm baseline: Optimize boolean evaluation for control
1286816 -  branch64(reg,reg) stub for arm64.

1286816 - InvertCondition(DoubleCondition).

1286816 - wasm baseline, simplify code generation of branches.

1286816 - wasm baseline, test cases for boolean optimization for control.

1286816 - wasm baseline, optimize boolean expressions for control.

Depedency 1316614 is already in.
2026-02-10 22:19:23 +02:00
win7-7 784ba46ced 1324989 - InvertCondition is undefined on non-jit platform.
1324989 - InvertCondition is undefined on non-jit platform.
2026-02-10 22:19:23 +02:00
win7-7 c2221a1d97 1338834 - Speed up JSContext::currentScript by doing the compartment check first
1338834 - Speed up JSContext::currentScript by doing the compartment check first.
2026-02-10 22:19:22 +02:00
win7-7 14decfa857 1350371 - jsapi-test testNewContext says about leaking JSRuntime
1350371 - Call destroyRuntime when initialization fails in js::NewContext.
2026-02-10 22:19:20 +02:00
win7-7 555d1ec3ac 1321884 - helper threads leak the HeldMutexStack
1321884 - clean up the HeldMutexStack on helper threads

The HeldMutexStack is cleaned up in JS_ShutDown() on the main thread, but since it is thread local we need to clean it up on other threads where it is used.
2026-02-10 22:19:19 +02:00
win7-7 815cab947d 1341355 - Refactor mark stack to improve type safety and allow iteration
1341355 - Refactor the mark stack.

1341355 - Add abstractions to improve type checking of mark stack contents and add iterator.
2026-02-10 22:19:19 +02:00
win7-7 b48e382e2a 1332745 - Split runtime-wide pointer updates from per-zone updates in compacting GC
1332745 - Split runtime-wide pointer updates from per-zone updates in compacting GC.

Fixes second debug crash/assert.
2026-02-10 22:19:17 +02:00
win7-7 6512db9912 Fix one of debug crash.
Fix debug crash and errors done during implementation of multi-threading.

There is second different debug crash.
2026-02-10 22:19:16 +02:00
win7-7 494fe4f553 1317703 - Port Baseline native getter stub to CacheIR.
1317703 - Port Baseline native getter stub to CacheIR.
2026-02-10 22:19:15 +02:00
win7-7 d8c29350e5 1318634 - Fix AddCacheIRGetPropFunction to add the receiver after doing other checks.
1318634 - Fix AddCacheIRGetPropFunction to add the receiver after doing other checks.
2026-02-10 22:19:14 +02:00
win7-7 ad66346b36 1310125 - Port Baseline scripted getter stub to CacheIR.
1310125 part 1 - Don't use |holder| for own property getters/setters in IonBuilder.

1310125 part 2 - Port Baseline scripted getter IC stub to CacheIR.

1310125 part 3 - Fix IsCacheableGetPropCallScripted perf regression.
2026-02-10 22:19:13 +02:00
win7-7 5a4cfe805d 1377738 - virtual memory leak in JS_DestroyContext
1377738 - Fix leak of nursery memory.
2026-02-10 22:19:12 +02:00
win7-7 b0fabbf8aa Bug 1410640 - Enable nursery allocation of arrow functions. r=jonco
Enable nursery allocation of arrow functions.
2026-02-10 22:19:12 +02:00
Jan de Mooij efd2829ab8 Bug 1415486 - Nursery allocate async functions. r=arai 2026-02-10 22:19:11 +02:00
win7-7 0c24e0fd51 867815 - Support visitIteratorStart when using generational GC.
867815 - Add post barrier for visitIteratorStart

867815 - Fix visitIteratorStart shape/group guard for unboxed objects.
2026-02-10 22:19:10 +02:00
win7-7 d4b4e36240 1359800 - Refactor some sweeping logic
1359800 - Use IsAboutToBeFinalized rather than marking state directly during sweeping.

1359800 - Check allocatedDuringIncremental flag in IsMarked functions
2026-02-10 22:19:09 +02:00
win7-7 7eb2fa0d23 1360526 - Parallelise more table sweeping
1360526 - Parallelise more table sweeping.
2026-02-10 22:19:08 +02:00
win7-7 af781018f1 1337450 - Simplify GC resets and aborts
1337450 - Simplify GC resets and aborts.

1340010 only affects ifdef GC zeal which does not exist in UXP.
2026-02-10 22:19:07 +02:00
win7-7 ea31e70224 1332357 - Fix DumpHeap to only evict the nursery if requested by caller
1332357 - Fix DumpHeap to only evict the nursery if requested by caller.
2026-02-10 22:19:07 +02:00
win7-7 e6519fdd95 1322312 - Assert that GCRuntime::enter/leaveUnsafe region is only used on the main thread, remnants.
1322312 - Assert that GCRuntime::enter/leaveUnsafe region is only used on the main thread. Before multi-threading this was done, take remaining parts.
2026-02-10 22:19:06 +02:00
win7-7 8cc2aadaf5 1321277 - Refactor arena sweeping for simplicity
1321277 - Refactor arena sweeping for simplicity.
2026-02-10 22:19:05 +02:00
win7-7 a0e4fddb87 1364051 - Make WriteBarrieredBase copy constructor protected
1364051 - Make WriteBarrieredBase copy constructor protected.
2026-02-10 22:19:05 +02:00
win7-7 0d24344fe6 1344315 - Suppress protected data checks when handing off runtimes between cooperative threads
1344315 - Suppress protected data checks when handing off runtimes between cooperative threads.
2026-02-10 22:19:04 +02:00
win7-7 acfd4c2cae 1341358 - Don't accidentally clear the incumbent global callback when finishing a cooperative thread
1341358 - Don't accidentally clear the incumbent global callback when finishing a cooperative thread.
2026-02-10 22:19:04 +02:00
win7-7 b3b1113234 1412298 - Wait for cooperative threads before worker threads when shutting down the JS shell
1412298 - Wait for cooperative threads before worker threads when shutting down the JS shell.
2026-02-10 22:19:03 +02:00
win7-7 8d510f63c7 1341321 - Require runtimes to be single threaded when using a Debugger
1341321 - Require runtimes to be single threaded when using a Debugger.
2026-02-10 22:19:02 +02:00
win7-7 7460c3d89a 1345307 - Implement runtime-wide WeakCache
1345307 - Implement runtime-wide WeakCache.
2026-02-10 22:19:01 +02:00
win7-7 e54abeba42 1338614 - Refactor incremental barrier APIs and make them call the read barrier
1338614 - Refactor incremental barrier APIs and make them call the read barrier.

Following 55 js engine.
2026-02-10 22:19:00 +02:00
win7-7 842fb935ce Debug fixes.
Also another fallout from 1334194/accidentally undone progress revealed by debug.

Also 1333000 is not in currently so undone additions, might be worth of taking in later along with 1332601.

Also debug found fixes.
2026-02-10 22:18:58 +02:00
win7-7 8e80bd2047 Forget these changes for avoiding atoms collecting slowdown. Take them now.
1374797 - Fix logic around triggering atoms GCs.

1384550 - Skip atoms collection if it's no longer possible.

Only affect after multi-threading changes. Forget to take these fixes before.
2026-02-10 22:18:58 +02:00
win7-7 0af3daad12 Revert "1343590 - Improve CallArgs gray marking assertions"
This reverts commit f3c2006234.

This need be done later since  ValueIsNotGray does not exist yet, only in future.
2026-02-10 22:18:57 +02:00
win7-7 eb6313d181 1364014 - Remove unnecessary is-array check in GCMarker::restoreValueArray.
1364014 - Remove unnecessary is-array check in GCMarker::restoreValueArray.

7 years ago:

In restoreValueArray we fail if we have dense elements and the object is not an array. Looking at blame data this check was added 5 years ago (over 10 years ago) and it's probably from the "only arrays can have dense elements" days.

I instrumented the browser and we're hitting this case a bunch of times, sometimes for objects with more than 500 elements.
2026-02-10 22:18:56 +02:00
win7-7 d7bdccd583 1259730 + 1323083 - Change representation of GC mark state to enable incremental gray marking
1259730 - Make UnmarkGray use an explicit mark stack instead of recursion

1323083 - Change representation of GC mark state to enable incremental gray marking.
2026-02-10 22:18:55 +02:00
win7-7 1f303e4f54 1359077 - Optimize a few things in ExposeGCThingToActiveJS.
1359077 - Optimize a few things in ExposeGCThingToActiveJS.
2026-02-10 22:18:54 +02:00
win7-7 8c2b4538b2 1358599 - Use runtime guards for jitcode pre-barriers instead of patchable jumps.
1358599 - Use runtime guards for jitcode pre-barriers instead of patchable jumps.
2026-02-10 22:18:53 +02:00
win7-7 39e991ae85 1337427 - Implement GCVector::sweep
1337427 - Implement GCVector::sweep.

New functionality. Bring it in see if it impact performance of GC.
2026-02-10 22:18:53 +02:00
win7-7 7fae04506d 1342653 - Change Nursery::cellsWithUid_ from HashSet to Vector
1342653 -  Change Nursery::cellsWithUid_ from HashSet to Vector.
2026-02-10 22:18:52 +02:00
win7-7 47a4711a74 1343590 - Improve CallArgs gray marking assertions
1343590 - Improve CallArgs gray marking assertions.
2026-02-10 22:18:51 +02:00
win7-7 c0478314ca 1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers
1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers.
2026-02-10 22:18:51 +02:00
win7-7 882fae200a 1335751 - Add js::CheckGrayMarkingState friend API to check there are black to gray edges
1335751 - Add js::CheckGrayMarkingState friend API to check there are black to gray edges.

Mostly taking this in to see impact on GC and make it easier track 55 js engine GC state.

I don't care Android/old Fennec UXP does not even support Adroid, so checks are not taken in.
2026-02-10 22:18:50 +02:00
win7-7 b1b07256d1 1342181 - FinalizeDeferredThings can change gray marking state between FixGrayBits GC and start of CC
1343986 - Fix setting of gray bits valid flag after GC.
2026-02-10 22:18:50 +02:00
win7-7 15636dceb4 1343986 - Fix setting of gray bits valid flag after GC
1343986 - Fix setting of gray bits valid flag after GC.
2026-02-10 22:18:49 +02:00
win7-7 98d7f7cdac 1340537 - Don't trace parse task things if they cannot be GCed
1340537 - Don't trace parse task things if they cannot be GCed.

For  preparation of 1335751.
2026-02-10 22:18:48 +02:00
win7-7 f39f7f46fc Fixes.
Fixes.
2026-02-10 22:18:48 +02:00
win7-7 23504e546f 1361401 - Make gc::Statistics counts atomic as these can be updated by helper threads
1361401 - Make gc::Statistics counts atomic as these can be updated by helper threads.
2026-02-10 22:18:47 +02:00
win7-7 b4b3b01ed1 1335413 - Use mozilla array containers in GC statistics code
1335413 - Use mozilla array containers in GC statistics code.
2026-02-10 22:18:46 +02:00
win7-7 2711fcae56 1326343 - Do not compute with null Timestamp on OOM
1326343 - Do not compute with null Timestamp on OOM.
2026-02-10 22:18:44 +02:00
win7-7 328911ba27 1173354 - Stop tracking GC begin/end callback time since it did not handle nesting
Second part.
2026-02-10 22:18:44 +02:00
win7-7 a7f2c63c9d 1173354 - Switch GC statistics over to TimeStamp/TimeDuration.
I need this to keep track of all other GC changes between 52 and 55 so I can know what impacted GC performance.
2026-02-10 22:18:43 +02:00
win7-7 6c2c6ec010 1356631 - Change LargeAllocationCallback to be process-wide
This is necessary to allow helper threads to attempt large allocations and recover from fragmentation situations with the LargeAllocationFailureCallback.
2026-02-10 22:18:41 +02:00
win7-7 995a76f683 1353758 followup - Also purge external string cache after compacting GC
1353758 followup - Also purge external string cache after compacting GC.
2026-02-10 22:18:41 +02:00
win7-7 76cc10fe83 1353758- Move the external string cache to the JS engine and improve it also has 1352323.
First add 1352323 - Add JS_NewMaybeExternalString function that creates either an external string or returns a static string then add 1353758.

1353758-  Move the external string cache to the JS engine and improve it.
2026-02-10 22:18:40 +02:00
win7-7 12be2c8439 1357012 - Use fallible append for compression tasks and use UniquePtrs.
1357012 - Use fallible append for compression tasks and use UniquePtrs.
2026-02-10 22:18:39 +02:00
win7-7 fc0881b29e 1348134 - ScriptSource compression is often wasteful.
1348134 - Stop eagerly compressing ScriptSources.

1348134 - Handle compression tasks with major GCs instead of eagerly.

1348134 - Pin chars returned from ScriptSource as an analog to Rooted.
2026-02-10 22:18:38 +02:00
win7-7 4c651a424c 1342642 - Assertion failure: CurrentThreadCanAccessRuntime(cx->runtime()), at threading/ProtectedData.cpp:97 or Assertion failure: rt->jitRuntime()->preventBackedgePatching() || rt->activeContext()->handlingJitInterrupt(), at jit/ExecutableAllocator.cpp:330
1342642 - Don't modify jitcode when interrupting an idle cooperative thread.
2026-02-10 22:18:37 +02:00
win7-7 0095a8b05a 1527839 - Set maximum recursion limit for ExtractLinearSum
1527839 - Set maximum recursion limit for ExtractLinearSum.
2026-02-10 22:18:36 +02:00
win7-7 14ece917f5 1341326 - Set stack limit and stack size properly for helper threads
1341326 - Set stack limit and stack size properly for helper threads.
2026-02-10 22:18:35 +02:00
Jan de Mooij 73edcbdd62 Bug 1377238 - Free finished IonBuilders off-thread. r=jonco 2026-02-10 22:18:34 +02:00
win7-7 506088d7fd 1360502 - Prioritise GC parallel tasks when selecting tasks to run on helper threads
1360502 - Prioritise GC parallel tasks when selecting tasks to run on helper threads
2026-02-10 22:18:33 +02:00
win7-7 2cd6786fbf Fixes to multi-threading.
TypedObject.cpp was missing brace

1335095  accidentally changed MarkInterpreterActivations to TraceInterpreterActivations and  MarkJitActivations to TraceJitActivations.

JitFrames.h file was missed while doing 1340822 .

Fixes to multi-threading:

There is still ExclusiveContext, revealed by removing main thread from engine.

Fixes to multi-threading.

Multi-threading miss.

I have no idea why in 1334194 I accidentally undone jit multi-threading progress.. revert those unwanted changes.

Various fixes. This does compile and works without crashing also.
2026-02-10 22:18:31 +02:00
win7-7 96a617f005 1340822 - Move nursery and caches from ZoneGroup back to the runtime
1340822 - Move nursery and caches from ZoneGroup back to the runtime.

Also add back uncompressedSourceCache, it was accidentally removed in 1337070 instead just reordering it.
2026-02-09 18:03:38 +02:00
win7-7 bc0c8773ee 1337968 - Add API and shell harness for cooperative multithreading
1337968 - Add API and shell harness for cooperative multithreading.
2026-02-09 18:03:36 +02:00
win7-7 4bd3a59791 1337491 - Off thread parsing changes for multithreaded runtimes
1337491 - Off thread parsing changes for multithreaded runtimes.
2026-02-09 18:03:34 +02:00
win7-7 1c89139113 1337117 - Remove references to main thread in the JS engine
1337117 - Remove references to main thread in the JS engine.
2026-02-09 18:03:33 +02:00
win7-7 2a8c363448 1337109 - Fix some minor places where a single context/zone group per runtime is assumed
1337109 - Fix some minor places where a single context/zone group per runtime is assumed.
2026-02-09 18:03:32 +02:00
win7-7 db6f8e63a5 1337112 - Remove links from JSRuntime to its single context and zone group
1337112 - Remove links from JSRuntime to its single context and zone group.
2026-02-09 18:03:31 +02:00
win7-7 9343c44150 1337070 - Tolerate multiple zone groups and cooperating contexts in the GC
1337070 - Tolerate multiple zone groups and cooperating contexts in the GC.
2026-02-09 18:03:30 +02:00
win7-7 39847ffbb8 1337084 - Tolerate multiple threads running JS in JIT simulators
1337084 - Tolerate multiple threads running JS in JIT simulators.

Check later if 1285074 - Make ICacheMap manipulation signal-safe is necessary or not.
2026-02-09 18:03:29 +02:00
win7-7 90c4c5e411 1336603 - Move PCCounts state from ZoneGroup back to the runtime
1336603 - Move PCCounts state from ZoneGroup back to the runtime.
2026-02-09 18:03:28 +02:00
win7-7 20137626e1 1339944 - Prohibit context switches while handling OOM during type inference operations
1339944 - Prohibit context switches while handling OOM during type inference operations.
2026-02-09 18:03:28 +02:00
win7-7 494ebaeef7 1335846 - Prohibit changing the active cooperatively scheduled thread during operations that affect GC
1335846 - Prohibit changing the active cooperatively scheduled thread during operations that affect GC.
2026-02-09 18:03:27 +02:00
win7-7 aa19ceb47b 1335130 - Allow iterating over the zone groups in a runtime
1335130 - Allow iterating over the zone groups in a runtime.
2026-02-09 18:03:26 +02:00
win7-7 abe70ac92f 1334885 - Allow wasm signal handlers to work with multiple threads in a runtime
1334885 - Allow wasm signal handlers to work with multiple threads in a runtime.
2026-02-09 18:03:26 +02:00
win7-7 9d14dd464c 1337106 - Handle multiple contexts per runtime in memory reporter
1337106 - Handle multiple contexts per runtime in memory reporter.
2026-02-09 18:03:24 +02:00
win7-7 ddf549d685 1357367 - Hit MOZ_CRASH(element wasn't found in this list!) or Assertion failure: ionLazyLinkListSize_ > 0, at js/src/gc/ZoneGroup.cpp:103
1357367 - Only finish IonBuilders for the zone group a context is in.

Also includes 1351102 - Fix GetFinishedBuilder to check the runtime instead of the compartment
2026-02-09 18:03:23 +02:00
win7-7 1f9807687e 1347539 - Crash [@ js::TenuringTracer::traverse] or Assertion failure: ownerContext().context() == nullptr, at js/src/gc/ZoneGroup.cpp:55 or various crashes with use-after-free involving evalInCooperativeThread
1347539 - Keep track of the Ion lazy link list at the zone group level
2026-02-09 18:03:22 +02:00
win7-7 0b6b50f61e 1334880 - Don't use JSContext* symbolic address in wasm jitcode
1334880 - Don't use JSContext* symbolic address in wasm jitcode.
2026-02-09 18:03:21 +02:00
win7-7 d6ff840aa1 1335095 - Allow cooperating JSContexts to iterate over each others' activations.
1335095 - Allow cooperating JSContexts to iterate over each others' activations.

WasmTypes.cpp will be changed whole soon with 1334880.
2026-02-09 18:03:20 +02:00
win7-7 c91deada80 1334194 - Don't differentiate between thread kinds in the trace logger
1334194 - TraceLogger changes for multithreaded runtimes.

Also: 1334194: Follow-up fixes to tracelogger thread safety.
2026-02-09 18:03:18 +02:00
win7-7 5f9d3c9159 1334927 - Handle multiple contexts per runtime in the SPS profiler
1334927 - Handle multiple contexts per runtime in the SPS profiler.
2026-02-09 18:03:17 +02:00
win7-7 6176963e81 1334212 - Handle multiple contexts per runtime in compiled JIT code
1334212 - Handle multiple contexts per runtime in compiled JIT code.
2026-02-09 18:03:15 +02:00
win7-7 d2cf1e31a9 1334837 - Add JSContext* to runtime for the active cooperatively scheduled thread
1334837 - Add JSContext* to runtime for the active cooperatively scheduled thread
2026-02-09 18:03:14 +02:00
win7-7 ac853d696c 1334845 - Create only one JSContext per helper thread
1334845 - Create only one JSContext per helper thread.
2026-02-09 18:03:14 +02:00
win7-7 1f12bebf78 Follow-up assertion fixes.
1336866 - Lock GC while getting heap growth factor in testing function.

1336893 - Tolerate redundant writes in WriteOnceData checks.

1337324 - Fix GCManagedDeletePolicy so that it again tolerates being called off thread.
2026-02-09 18:03:13 +02:00
win7-7 8ef1875e55 1325050 - Structure reorganization for multithreaded runtimes
1325050 - Structure reorganization for multithreaded runtimes.

1465108 also.

Bug 1326501 - Baldr: optimize getFuncName  is necessary due it introducing runtime for WasmCode.h ensureProfilingState.

1329632: Add a null-check for empty filenames in wasm stack traces, follow-up crash-fix to previous.

Also reverting 1465108  for now. Might try redo later.

Generational GC is not possible keep preference same way when using multi-threaded js engine anymore.
2026-02-09 18:03:10 +02:00
win7-7 a57830cfd0 Merge branch 'master' into UXP-custom-new-GC-atom-marking-more 2024-03-11 15:02:57 +02:00
win7-7 300459ef22 bug1353694 - Adds the missing call to cx->markAtom() and changes the functions to use Atoms to match bug 1350760.
Adds the missing call to cx->markAtom() and changes the functions to use Atoms to match bug 1350760
2024-01-30 10:28:27 +02:00
win7-7 cd8a7928af Bug 1350760 - Atomizing strings needs to be faster.
Also includes: 1341033: Make sure zones mark any children of marked atoms.

1350760 part 1: Templatize and optimize AtomMarkingRuntime::markAtom.

1350760 part 2: Ensure SparseBitmap::setBit gets inlined.

1350760 part 3: Add AtomMarkingRuntime::inlinedMarkAtom to eliminate markAtom call overhead when atomizing.

1350760 part 4: Call JSString::validateLength only when we have to allocate a new atom.

1350760 part 5: Make sure various hashtable lookups get inlined when atomizing strings.

1350760 part 6: Add a Zone cache for recently atomized strings.
2024-01-29 18:45:02 +02:00
win7-7 efefc3498b Bug 1321277 - Allow incremental GC when keepAtoms is set
1213977: Don't reset an ongoing incremental GC if AutoKeepAtoms is set.

This should be safe after 1324002 atom marking + 1340597 - Avoid triggering read barrier in DumpHeap and when collecting stats as necessary for security.
2024-01-29 16:24:31 +02:00
win7-7 34f87236c6 Bug 1321277 - Collect the atoms zone in the last ditch GC.
Bug 1321277 - Remove use of AutoKeepAtoms from last ditch GC
2024-01-29 15:32:16 +02:00
win7-7 47cfbac4ed Bug 1324002 - Mark atoms separately in each zone, also includes 1328967, 1335642, 1335643, 1337578, 1341006, 1370541, 1438880.
1324002: Mark atoms separately in each zone:

Fixes: removing () reference to multi-threading in AtomMarking.cpp and fixing Scope.h to use trailingNames.start();

Also includes:

1328967: Allow GCZonesIter to be used by helper threads during GC.

1335642: Mark RegExp source atoms crossing zone boundaries in a better place.

1335643: Fix bogus assert by marking atoms when serializing cross-zone saved frames.

1337578: Mark atoms when cloning functions.

1341006: Use a sparse representation for atom mark bitmaps in zones

1370541: Always assert that the atom is marked when setting a function's name.

1438880: Add release checks before instantiating a lambda or regexp.
2024-01-29 15:08:10 +02:00
win7-7 bbb9731779 Bug 1467403 - BytecodeEmitter::finishTakingSrcNotes is quadratic, and can take multiple seconds on large JavaScript files.
Bug 1517135: Improve performance of BytecodeEmitter::finishTakingSrcNotes.

Bug 1517135: Remove dead declaration from BytecodeEmitter.h

Go to https://carnap.io/about

This website loading takes longer without these changes.
2024-01-28 23:41:26 +02:00
win7-7 b2150a8434 Bug 1467403 - Remove the source notes handling for prologue bytecode.
Bug 1467403 - Remove the source notes handling for prologue bytecode.
2024-01-28 23:41:08 +02:00
win7-7 5026ebe4fb Bug 1460385 - Don't trace propid in TraceCycleCollectorChildren.
The propid is a jsid, and a jsid can never be anything the CC cares about, so there's no reason to trace it. In at least one profile of Google Inbox, tracing shape propids is taking the majority of time in the CC and causing very long pauses.

This might be win in GC ubench benchmark. Going still test with UXP platform but mozregression suggest win.
2024-01-22 15:12:56 +02:00
win7-7 2784a7440e Bug 1520423 - Use AutoTArray in filter code
Bug 1520423 - Use AutoTArray in filter code.

Unlike 1520294 this can be done without depending on 1417699.

See:

https://compat-table.github.io/compat-table/esnext/ expand table with Feature name down arrow, notice how slow mouse-over hover is, this patch improves performance to extent, this website hovering with mouse is still slow but less than before.
2024-01-21 20:00:43 +02:00
win7-7 762ce30e9d Web compatibility backporting.
Bug 1334554: Handle the return value of nsFilterInstance::PaintFilteredFrame, needed for 1336480.

Bug 1336480 Part 1: Apply suface limitation in nsFilterInstance::ComputeNeededBoxes.

There is no need to limit output space bounds in
nsFilterInstance::OutputFilterSpaceBounds(), it's just far too early.

Bug 1336480 Part 2: Test case.

Bug 1526609: When interrupting the reflow of abspos kids, still account for the old overflow areas.

Otherwise, if we're scrolled, the scroll frame will think that our scroll range was reduced, which will in turn clamp the scroll position, which is not good.
2024-01-21 17:47:22 +02:00
win7-7 be75437f35 1110928 - Per-document GC poking should not trigger a full GC
Bug 1110928, part 1: Hoist the LOAD_END PokeGC out of nsJSContext::LoadEnd.

nsDocumentViewer knows which document is involved which will help us later.

Also, fix a typo in the comment.

Bug 1110928, part 2: Call PokeGC in nsDocumentViewer::PageHide before the call to OnPageHide.

This ensures that the document isn't destroyed when we call PokeGC, which will be useful later.

Bug 1110928, part 4: Try to pass a relevant zone to PokeGC.

Bug 1110928 part 5: trigger full GC only when closing top level outer window.

Bug 1110928 part 6: trigger ZoneGC after evicting from bfcache

Bug 1110928 part 7: ensure zone GC collects the zone from which canvas context is originated

Bug 1110928 part 8: first request GC should be a full GC
2024-01-20 18:14:32 +02:00
win7-7 7dc5fcadee Fix .html file crash with dynamic module import. 2024-01-18 16:33:29 +02:00
win7-7 d860716b9e Merge branch 'master' into UXP-custom-still-error-fix 2024-01-18 16:32:57 +02:00
win7-7 ac4213d11a MOZ_MUST_USE to C++17 [[nodiscard]] to LookupForAdd, LookupResult, EnsureInserted.
MOZ_MUST_USE to C++17 [[nodiscard]] to LookupForAdd, LookupResult, EnsureInserted.
2024-01-18 16:32:30 +02:00
win7-7 b6d012bc0d Some more hashtable changes to avoid lookups.
Bug 1372007 - Replace calls to Contains+Put with LookupForAdd and Contains+Get+Put with LookupRemoveIf to avoid unnecessary hashtable lookups.

Bug 1372048 - Use LookupForAdd instead of Contains+Get/Put to avoid an unnecessary hashtable lookup.

Bug 1372327 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups.

Bug 1376483 - Use Lookup instead of Get+Remove, and LookupForAdd instead of Get+Put, to avoid unnecessary hashtable lookups.

Bug 1376487 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups.
2024-01-18 16:32:30 +02:00
win7-7 339705a43e Remove pointless spaces accidentally added.
Remove pointless spaces accidentally added.
2024-01-18 16:32:30 +02:00
win7-7 dc8ae7d8d6 Further hashtable changes to reduce lookups.
Bug 1367209:
nsCounterManager::DestroyNodesFor does an unconditional hashtable iteration on every frame destruction

part 2,3 and 4.

Bug 1370593 - avoid redundant lookups in nsRefPtrHashtable::Remove;

We already have a handle to the entry in the hashtable, we can remove that directly, rather than implicitly looking up the entry to remove in Remove().

Bug 1371960 - Use EnsureInserted instead of Contains+PutEntry to avoid unnecessary hashtable lookups.

Bug 1372031 - Use EnsureInserted instead of Contains+PutEntry to avoid unnecessary hashtable lookups.

Bug 1374125 - Use EnsureInserted instead of Contains+PutEntry to avoid unnecessary hashtable lookups.

Bug 1376126 - Use Lookup() entry instead of Get+Remove in CycleCollectedJSRuntime::RemoveJSHolder to avoid unnecessary hashtable lookups.

Bug 1376127 - Use LookupForAdd instead of Get+Put in CycleCollectedJSRuntime::DeferredFinalize to avoid unnecessary hashtable lookups.

Bug 1376463 - Use Lookup instead of Get+Remove to avoid unnecessary hashtable lookups.
2024-01-18 16:32:30 +02:00
win7-7 70acbe0142 avoid hashtable lookup nsClassHashtable.h
make RemoveAndForget() use RemoveEntry(), not Remove(), to remove the entry to avoid a second hashtable lookup, nsClassHashtable.h back when  LookupRemoveIf() was introduced had this change, take it in.
2024-01-18 16:29:08 +02:00
win7-7 be0b87cb77 Backout vector due there is no solution to crashing yet.
Backout vector due there is no solution to crashing yet.
2024-01-18 11:48:49 +02:00
win7-7 aab43246c5 1539366 Typing or scrolling in Phabricator on long pages is super slow
Bug 1539366 - Use SetCoord to restore mPIStartBorderData's coord so that it also set mValid. r=mats a=jcristau Without this the restore doesn't have any effect as the next frame sees that coord has mIsValid=false

Bug 1539366 - Use a temporary object to compute the mPIStartBorderData coords so that we don't clobber the regular state. r=mats a=jcristau

Bug 1539366 - Avoid calling AreOnSameLine once we know we've already changed lines since it can be expensive to compute. r=mats a=jcristau

Go to https://phabricator.services.mozilla.com/D24930

Scroll all the way to the bottom of Phabricator example website, see how slow it is before these patches, it is fast after these patches.
2024-01-18 01:08:32 +02:00
win7-7 2da8928bbd Bug 1366250, don't flush layout when calling element.focus() on already focused element. Ensure layout is flushed after changing input.type, r=ehsan
don't flush layout when calling element.focus() on already focused element. Ensure layout is flushed after changing input.type

Also includes follow-up:

bug 1366517, because of XBL usage, limit not-flushing-always-during-focus() to non-chrome, r=ehsan

Improves Speedometer performance.
2024-01-18 01:08:09 +02:00
win7-7 61646c0fca Custom changes (vector, nsGenCon, hashtables performance improvements) with UXP up-to-date
Custom changes with UXP up-to-date
2024-01-18 01:07:01 +02:00
11021 changed files with 4687192 additions and 836833 deletions

No files matched your search

+1 -1
View File
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Switching to C++17 requires CLOBBER to pick up compiler conf. (Issue #2281)
Clobber for ICU 78.1
+7
View File
@@ -19,6 +19,13 @@ If you are interested in the development and building side of things, some
information will be available on the [Pale Moon developer site](http://developer.palemoon.org).
You are also always welcome to get in touch with our community on the [Pale Moon forum](https://forum.palemoon.org/).
### Code search
While our repo has basic code searching capabilities (via `git grep`), you are strongly
encouraged to instead use the dedicated code search and cross-referencing site:
[https://xref.palemoon.org/](https://xref.palemoon.org/)
This repo and a copy of the front-end are amalgamated in the `goanna-central` index.
### A note about trademarks and branding
Although this repository is primarily licensed under Mozilla Public License v2.0, the
+1 -1
View File
@@ -80,7 +80,7 @@ StyleInfo::TextIndent(nsAString& aValue)
}
void
StyleInfo::Margin(css::Side aSide, nsAString& aValue)
StyleInfo::Margin(Side aSide, nsAString& aValue)
{
MOZ_ASSERT(mElement->GetPrimaryFrame(), " mElement->GetPrimaryFrame() needs to be valid pointer");
aValue.Truncate();
+3 -3
View File
@@ -60,7 +60,7 @@
#ifdef MOZ_ENABLE_NPAPI
#include "nsPluginFrame.h"
#endif
#include "nsSVGPathGeometryFrame.h"
#include "SVGGeometryFrame.h"
#include "nsTreeBodyFrame.h"
#include "nsTreeColumns.h"
#include "nsTreeUtils.h"
@@ -1165,8 +1165,8 @@ nsAccessibilityService::CreateAccessible(nsINode* aNode,
if (!newAcc) {
if (content->IsSVGElement()) {
nsSVGPathGeometryFrame* pathGeometryFrame = do_QueryFrame(frame);
if (pathGeometryFrame) {
SVGGeometryFrame* geometryFrame = do_QueryFrame(frame);
if (geometryFrame) {
// A graphic elements: rect, circle, ellipse, line, path, polygon,
// polyline and image. A 'use' and 'text' graphic elements require
// special support.
+1 -1
View File
@@ -157,7 +157,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DocAccessible, Accessible)
tmp->mARIAOwnsHash.Clear();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DocAccessible)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DocAccessible)
NS_INTERFACE_MAP_ENTRY(nsIDocumentObserver)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
+1 -1
View File
@@ -76,7 +76,7 @@ HyperTextAccessible::NativeState()
{
uint64_t states = AccessibleWrap::NativeState();
if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_READWRITE)) {
states |= states::EDITABLE;
} else if (mContent->IsHTMLElement(nsGkAtoms::article)) {
+2 -2
View File
@@ -340,9 +340,9 @@ this.AccessFu = { // jshint ignore:line
case 'remote-browser-shown':
case 'inprocess-browser-shown':
{
// Ignore notifications that aren't from a BrowserOrApp
// Ignore notifications that aren't from a Browser
let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
if (!frameLoader.ownerIsMozBrowserFrame) {
return;
}
this._handleMessageManager(frameLoader.messageManager);
+1 -1
View File
@@ -112,5 +112,5 @@ function shutdownPromise(contentBrowser) {
*/
function forceGC() {
Cu.forceCC();
Cu.forceGC();
Cu.forceShrinkingGC();
}
+1 -1
View File
@@ -30,7 +30,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(xpcAccessibleDocument,
tmp->mCache.Clear();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(xpcAccessibleDocument)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(xpcAccessibleDocument)
NS_INTERFACE_MAP_ENTRY(nsIAccessibleDocument)
NS_INTERFACE_MAP_END_INHERITING(xpcAccessibleHyperText)
+5 -8
View File
@@ -73,7 +73,7 @@ XULTreeAccessible::~XULTreeAccessible()
NS_IMPL_CYCLE_COLLECTION_INHERITED(XULTreeAccessible, Accessible,
mTree, mAccessibleCache)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeAccessible)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(XULTreeAccessible)
NS_INTERFACE_MAP_END_INHERITING(Accessible)
NS_IMPL_ADDREF_INHERITED(XULTreeAccessible, Accessible)
@@ -709,12 +709,9 @@ XULTreeItemAccessibleBase::~XULTreeItemAccessibleBase()
NS_IMPL_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessibleBase, Accessible,
mTree)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessibleBase)
NS_INTERFACE_TABLE_INHERITED(XULTreeItemAccessibleBase,
XULTreeItemAccessibleBase)
NS_INTERFACE_TABLE_TAIL_INHERITING(Accessible)
NS_IMPL_ADDREF_INHERITED(XULTreeItemAccessibleBase, Accessible)
NS_IMPL_RELEASE_INHERITED(XULTreeItemAccessibleBase, Accessible)
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessibleBase,
Accessible,
XULTreeItemAccessibleBase)
////////////////////////////////////////////////////////////////////////////////
// XULTreeItemAccessibleBase: Accessible
@@ -1084,7 +1081,7 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessible,
XULTreeItemAccessibleBase,
mColumn)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessible)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(XULTreeItemAccessible)
NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
NS_IMPL_ADDREF_INHERITED(XULTreeItemAccessible, XULTreeItemAccessibleBase)
NS_IMPL_RELEASE_INHERITED(XULTreeItemAccessible, XULTreeItemAccessibleBase)
+2 -2
View File
@@ -263,7 +263,7 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(XULTreeGridRowAccessible,
XULTreeItemAccessibleBase,
mAccessibleCache)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeGridRowAccessible)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(XULTreeGridRowAccessible)
NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
NS_IMPL_ADDREF_INHERITED(XULTreeGridRowAccessible,
@@ -447,7 +447,7 @@ XULTreeGridCellAccessible::~XULTreeGridCellAccessible()
NS_IMPL_CYCLE_COLLECTION_INHERITED(XULTreeGridCellAccessible, LeafAccessible,
mTree, mColumn)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeGridCellAccessible)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(XULTreeGridCellAccessible)
NS_INTERFACE_MAP_END_INHERITING(LeafAccessible)
NS_IMPL_ADDREF_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
NS_IMPL_RELEASE_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
File diff suppressed because it is too large. Load diff
+80
View File
@@ -0,0 +1,80 @@
dnl Map old names of Autoconf macros to new regularized names.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl General macros.
dnl
define(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl
define(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl
AC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl
AC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl
AC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl
AC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl
AC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl
AC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl
AC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl
AC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl
AC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl
AC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl
AC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl
AC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl
AC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl
AC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl
dnl
dnl Specific macros.
dnl
AC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl
AC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl
AC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl
AC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl
AC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl
AC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl
AC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl
AC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl
AC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl
AC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl
AC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl
AC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl
AC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl
AC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl
AC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl
AC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl
AC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl
AC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl
AC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl
AC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl
AC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl
AC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl
AC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl
AC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl
AC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl
AC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl
AC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TIMEZONE])])dnl
AC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl
AC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl
AC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl
AC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl
AC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl
AC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl
AC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl
AC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl
AC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl
AC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl
AC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl
AC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl
AC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl
File diff suppressed because it is too large. Load diff
+28
View File
@@ -0,0 +1,28 @@
dnl Driver that loads the Autoconf macro files.
dnl Requires GNU m4.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl Written by David MacKenzie.
dnl
include(acgeneral.m4)dnl
builtin(include, acspecific.m4)dnl
builtin(include, acoldnames.m4)dnl
dnl Do not sinclude acsite.m4 here, because it may not be installed
dnl yet when Autoconf is frozen.
dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
+159
View File
@@ -0,0 +1,159 @@
#! @SHELL@
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# If given no args, create `configure' from template file `configure.in'.
# With one arg, create a configure script on standard output from
# the given template file.
usage="\
Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
[-l dir] [--localdir=dir] [--version] [template-file]"
# NLS nuisances.
# Only set these to C if already set. These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
: ${AC_MACRODIR=@datadir@}
: ${M4=@M4@}
: ${AWK=@AWK@}
case "${M4}" in
/*) # Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
test -f "${M4}" || M4=m4 ;;
esac
: ${TMPDIR=/tmp}
tmpout=${TMPDIR}/acout.$$
localdir=
show_version=no
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* )
echo "${usage}" 1>&2; exit 0 ;;
--localdir=* | --l*=* )
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
-l | --localdir | --l*)
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
localdir="${1}"
shift ;;
--macrodir=* | --m*=* )
AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
-m | --macrodir | --m* )
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
AC_MACRODIR="${1}"
shift ;;
--version | --v* )
show_version=yes; shift ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "${usage}" 1>&2; exit 1 ;;
* )
break ;;
esac
done
if test $show_version = yes; then
version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
$AC_MACRODIR/acgeneral.m4`
echo "Autoconf version $version"
exit 0
fi
case $# in
0) infile=configure.in ;;
1) infile="$1" ;;
*) echo "$usage" >&2; exit 1 ;;
esac
trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15
tmpin=${TMPDIR}/acin.$$ # Always set this, to avoid bogus errors from some rm's.
if test z$infile = z-; then
infile=$tmpin
cat > $infile
elif test ! -r "$infile"; then
echo "autoconf: ${infile}: No such file or directory" >&2
exit 1
fi
if test -n "$localdir"; then
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
else
use_localdir=
fi
# Use the frozen version of Autoconf if available.
r= f=
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
case `$M4 --help < /dev/null 2>&1` in
*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
*traditional*) ;;
*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
esac
$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
{ rm -f $tmpin $tmpout; exit 2; }
# You could add your own prefixes to pattern if you wanted to check for
# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do
# alternation.
pattern="AC_"
status=0
if grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then
echo "autoconf: Undefined macros:" >&2
sed -n "s/^[^#]*\\(${pattern}[_A-Za-z0-9]*\\).*/\\1/p" $tmpout |
while read macro; do
grep -n "^[^#]*$macro" $infile /dev/null
test $? -eq 1 && echo >&2 "***BUG in Autoconf--please report*** $macro"
done | sort -u >&2
status=1
fi
if test $# -eq 0; then
exec 4> configure; chmod +x configure
else
exec 4>&1
fi
# Put the real line numbers into configure to make config.log more helpful.
$AWK '
/__oline__/ { printf "%d:", NR + 1 }
{ print }
' $tmpout | sed '
/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
' >&4
rm -f $tmpout
exit $status
+10 -8
View File
@@ -179,20 +179,22 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -fno-math-errno -pipe"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe"
if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
fi
case "${host_cpu}" in
i*86)
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
;;
esac
if test -z "$CLANG_CC"; then
case "$CC_VERSION" in
4.* | 5.* | 6.*)
4.* | 5.* | 6.* | 7.* | 8.*)
AC_MSG_ERROR([Unsupported GCC version.])
;;
*)
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
# Instead of completely disabling this optimization on newer GCC's,
# we'll force them to use level 1 optimization with -flifetime-dse=1.
# Lifetime Dead Store Elimination level 2 (default in GCC) breaks Goanna.
# Instead of completely disabling this optimization, we force level 1
# optimization instead with -flifetime-dse=1.
# Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS.
CFLAGS="-flifetime-dse=1 $CFLAGS"
CXXFLAGS="-flifetime-dse=1 $CXXFLAGS"
+23 -54
View File
@@ -10,66 +10,28 @@ def encoded_open(path, mode):
return codecs.open(path, mode, encoding)
option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
m4 = check_prog(
"M4",
(
"gm4",
"m4",
),
)
@depends(mozconfig, 'AUTOCONF')
@checking('for autoconf')
@imports(_from='os.path', _import='exists')
@imports('re')
def autoconf(mozconfig, autoconf):
mozconfig_autoconf = None
if mozconfig['path']:
make_extra = mozconfig['make_extra']
if make_extra:
for assignment in make_extra:
m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
assignment)
if m:
mozconfig_autoconf = m.group(1)
autoconf = autoconf[0] if autoconf else None
for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13',
'autoconf213'):
if ac:
autoconf = find_program(ac)
if autoconf:
break
else:
fink = find_program('fink')
if fink:
autoconf = os.path.normpath(os.path.join(
fink, '..', '..', 'lib', 'autoconf2.13', 'bin', 'autoconf'))
else:
brew = find_program('brew')
if brew:
autoconf = os.path.normpath(os.path.join(
brew, '..', '..', 'Cellar', 'autoconf213', '2.13', 'bin',
'autoconf213'))
if not autoconf:
die('Could not find autoconf 2.13')
if not exists(autoconf):
die('Could not find autoconf 2.13 at %s', autoconf)
return autoconf
set_config('AUTOCONF', autoconf)
@depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
@depends('OLD_CONFIGURE', mozconfig, awk, m4, check_build_environment, shell,
old_configure_assignments, build_project)
@imports(_from='__builtin__', _import='open')
@imports(_from='__builtin__', _import='print')
@imports('glob')
@imports('sys')
@imports('itertools')
@imports('subprocess')
# Import getmtime without overwriting the sandbox os.path.
@imports(_from='os.path', _import='getmtime')
@imports(_from='os.path', _import='exists')
@imports(_from='mozbuild.shellutil', _import='quote')
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
@imports(_from='os', _import='environ')
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
old_configure_assignments, build_project):
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
# which is actually necessary because this path actually ends up literally
@@ -98,11 +60,22 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
refresh = False
if refresh:
autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
log.info('Refreshing %s with %s', old_configure, autoconf)
env = dict(environ)
env['M4'] = m4
env['AWK'] = awk
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
my_env = env
# Handle Python 2.7 not allowing unicode in the environment on Windows
if sys.platform == 'win32':
my_env = dict()
for e in env:
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
script = subprocess.check_output([
shell, autoconf,
'--localdir=%s' % os.path.dirname(old_configure),
old_configure + '.in'])
old_configure + '.in'], env=my_env)
# Make old-configure append to config.log, where we put our own log.
# This could be done with a m4 macro, but it's way easier this way
@@ -127,10 +100,6 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
for key in mozconfig[t]['removed'].keys():
inject("unset %s" % key)
# Autoconf is special, because it might be passed from
# mozconfig['make_extra'], which we don't pass automatically above.
inject('export AUTOCONF=%s' % quote(autoconf))
for assignment in old_configure_assignments:
inject(assignment)
+2 -2
View File
@@ -695,9 +695,9 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
# Check the compiler version here instead of in `compiler_version` so
# that the `checking` message doesn't pretend the compiler can be used
# to then bail out one line later.
if info.type == 'gcc' and info.version < '7.1.0':
if info.type == 'gcc' and info.version < '9.1.0':
raise FatalCheckError(
'Only GCC 7.1 or newer is supported (found version %s).'
'Only GCC 9.1 or newer is supported (found version %s).'
% info.version)
# If you want to bump the version check here search for
@@ -88,7 +88,7 @@ var decompressedJQuery = function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(par
for documentation and information on getting the source.
*/
var decompressedDojo = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(V z=="1k"){(B(){if(V D["1o"]=="1k"){D.1o={}}if((!D["1z"])||(!1z["ca"])){D.1z={}}A cn=["rA","rz","1K","ry","rx","9f","rw","rv","ru","rt","rs","rr","rq","ro","rn","rm"];A i=0,24;1s(24=cn[i++]){if(!1z[24]){1z[24]=B(){}}}if(V D["z"]=="1k"){D.z={}}z.1W=D;A d3={im:U,rl:U,rk:"",rj:"",ri:"",rh:K,rg:U};R(A 8z in d3){if(V 1o[8z]=="1k"){1o[8z]=d3[8z]}}A jK=["rf","rd","rc","rb"];A t;1s(t=jK.3a()){z["is"+t]=U}})();z.8h=1o.8h;z.cY={jJ:0,jI:9,jH:0,jG:"",jF:2V("$ra: r9 $".1f(/[0-9]+/)[0]),2i:B(){4G(z.cY){C jJ+"."+jI+"."+jH+jG+" ("+jF+")"}}};z.d1=B(jE,jD,1V){A 2h=1V||z.1W;R(A i=0,p;2h&&(p=jE[i]);i++){2h=(p in 2h?2h[p]:(jD?2h[p]={}:1k))}C 2h};z.88=B(jC,jA,jB){A d2=jC.1A("."),p=d2.8q(),M=z.d1(d2,K,jB);C(M&&p?(M[p]=jA):1k)};z.6q=B(jz,jy,jx){C z.d1(jz.1A("."),jy,jx)};z.r8=B(jw,M){C!!z.6q(jw,U,M)};z["3u"]=B(d0){C z.1W.3u?z.1W.3u(d0):3u(d0)};z.ia=B(jv,cZ,cX){A 8y="r7: "+jv;if(cZ){8y+=" "+cZ}if(cX){8y+=" -- r6 be r5 in cY: "+cX}1z.1K(8y)};z.r4=B(ju,cW){A cV="r3: "+ju+" -- r2 r1 4F r0 qZ qY.";if(cW){cV+=" "+cW}1z.1K(cV)};(B(){A cR={53:{},6p:0,1h:{},8k:{z:{1p:"z",1Z:"."},cU:{1p:"cU",1Z:"../qX/cU"},cT:{1p:"cT",1Z:"cT"}},cN:B(cS){A mp=D.8k;C jp(mp[cS]&&mp[cS].1Z)},jk:B(8x){A mp=D.8k;if(D.cN(8x)){C mp[8x].1Z}C 8x},8v:[],6t:U,56:[],8t:[],8u:U};R(A cQ in cR){z[cQ]=cR[cQ]}})();z.jg=B(8w,cP,cb){A 1g=(((8w.2s(0)=="/"||8w.1f(/^\\w+:/)))?"":D.51)+8w;if(1o.jt&&z.c8){1g+="?"+67(1o.jt).2f(/\\W+/g,"")}1u{C!cP?D.cO(1g,cb):D.jq(1g,cP,cb)}1y(e){1z.1K(e);C U}};z.cO=B(1g,cb){if(D.8v[1g]){C K}A 6u=D.iR(1g,K);if(!6u){C U}D.8v[1g]=K;D.8v.Y(1g);if(cb){6u="("+6u+")"}A jr=z["3u"](6u+"\\r\\n//@ qW="+1g);if(cb){cb(jr)}C K};z.jq=B(1g,jo,cb){A ok=U;1u{ok=D.cO(1g,cb)}1y(e){1z.1K("qV je ",1g," 4G 9f: ",e)}C jp(ok&&D.53[jo])};z.6m=B(){D.8u=K;D.6t=K;A 57=D.56;D.56=[];R(A x=0;x<57.G;x++){57[x]()}D.8u=U;if(z.6t&&z.6p==0&&D.56.G>0){z.8s()}};z.ck=B(){A 57=D.8t;1s(57.G){(57.8q())()}};z.qU=B(M,jn){A d=z;if(P.G==1){d.56.Y(M)}I{if(P.G>1){d.56.Y(B(){M[jn]()})}}if(d.6t&&d.6p==0&&!d.8u){d.8s()}};z.dW=B(M,jm){A d=z;if(P.G==1){d.8t.Y(M)}I{if(P.G>1){d.8t.Y(B(){M[jm]()})}}};z.iM=B(){if(D.6t){C}if(D.6p>0){1z.1K("qT qS in qR!");C}z.8s()};z.8s=B(){if(V 5c=="8b"||(1o["qQ"]&&z.2M)){5c("z.6m();",0)}I{z.6m()}};z.cF=B(jl){A 4v=jl.1A(".");R(A i=4v.G;i>0;i--){A 8r=4v.2w(0,i).22(".");if((i==1)&&!D.cN(8r)){4v[0]="../"+4v[0]}I{A cM=D.jk(8r);if(cM!=8r){4v.3S(0,i,cM);3f}}}C 4v};z.jj=U;z.8m=B(2T,qP,55){55=D.jj||55;A 54=D.53[2T];if(54){C 54}A cL=2T.1A(".");A 3L=D.cF(2T);A jh=((3L[0].2s(0)!="/")&&!3L[0].1f(/^\\w+:/));A ji=3L[3L.G-1];A 3m;if(ji=="*"){2T=cL.2w(0,-1).22(".");3L.8q();3m=3L.22("/")+"/"+(1o["qO"]||"qN")+".js";if(jh&&3m.2s(0)=="/"){3m=3m.2w(1)}}I{3m=3L.22("/")+".js";2T=cL.22(".")}A jf=(!55)?2T:L;A ok=D.jg(3m,jf);if((!ok)&&(!55)){2m S 1O("qM 3O 4E \'"+2T+"\'; 72 qL \'"+3m+"\'")}if((!55)&&(!D["qK"])){54=D.53[2T];if(!54){2m S 1O("qJ \'"+2T+"\' is 3O qI a8 je \'"+3m+"\'")}}C 54};z.8c=z.8m;z.1Q=B(cK){A cJ=cK+"";A 8p=cJ;A 6s=cK.1A(/\\./);if(6s[6s.G-1]=="*"){6s.8q();8p=6s.22(".")}A 8o=z.6q(8p,K);D.53[cJ]=8o;D.53[8p]=8o;C 8o};z.qH=B(8n){A jd=8n["qG"]||[];A cI=jd.3U(8n[z.j4]||8n["aY"]||[]);R(A x=0;x<cI.G;x++){A 8l=cI[x];if(8l.1P==4e){z.8m.14(z,8l)}I{z.8m(8l)}}};z.jb=B(jc,qF){if(jc===K){A cH=[];R(A i=1;i<P.G;i++){cH.Y(P[i])}z.8c.14(z,cH)}};z.qE=z.jb;z.io=B(cG,ja){D.8k[cG]={1p:cG,1Z:ja}};z.qD=B(qC,qB,qA,qz){z.8c("z.j9");z.j9.qy.14(z.qx,P)};(B(){A j7=S 9G("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?$");A j6=S 9G("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");z.4r=B(){A n=L;A 1V=P;A 1g=1V[0];R(A i=1;i<1V.G;i++){if(!1V[i]){6c}A 1t=S z.4r(1V[i]+"");A 4u=S z.4r(1g+"");if((1t.28=="")&&(!1t.4t)&&(!1t.3l)&&(!1t.1r)){if(1t.52!=n){4u.52=1t.52}1t=4u}I{if(!1t.4t){1t.4t=4u.4t;if(!1t.3l){1t.3l=4u.3l;if(1t.28.2s(0)!="/"){A j8=4u.28.21(0,4u.28.31("/")+1)+1t.28;A 1X=j8.1A("/");R(A j=0;j<1X.G;j++){if(1X[j]=="."){if(j==1X.G-1){1X[j]=""}I{1X.3S(j,1);j--}}I{if(j>0&&!(j==1&&1X[0]=="")&&1X[j]==".."&&1X[j-1]!=".."){if(j==(1X.G-1)){1X.3S(j,1);1X[j-1]=""}I{1X.3S(j-1,2);j-=2}}}}1t.28=1X.22("/")}}}}1g="";if(1t.4t){1g+=1t.4t+":"}if(1t.3l){1g+="//"+1t.3l}1g+=1t.28;if(1t.1r){1g+="?"+1t.1r}if(1t.52){1g+="#"+1t.52}}D.1g=1g.2i();A r=D.1g.1f(j7);D.4t=r[2]||(r[1]?"":n);D.3l=r[4]||(r[3]?"":n);D.28=r[5];D.1r=r[7]||(r[6]?"":n);D.52=r[9]||(r[8]?"":n);if(D.3l!=n){r=D.3l.1f(j6);D.8X=r[3]||n;D.8W=r[4]||n;D.qw=r[5];D.qv=r[7]||n}};z.4r.1C.2i=B(){C D.1g}})();z.qu=B(j5,2E){A 2B=z.cF(j5).22("/");if(!2B){C L}if(2B.31("/")!=2B.G-1){2B+="/"}A cE=2B.T(":");if(2B.2s(0)!="/"&&(cE==-1||cE>2B.T("/"))){2B=z.51+2B}C S z.4r(2B,2E)};if(V 26!="1k"){z.c8=K;z.j4="qt";(B(){A d=z;if(1q&&1q.4I){A 8j=1q.4I("ak");A j3=/z(\\.qs)?\\.js([\\?\\.]|$)/i;R(A i=0;i<8j.G;i++){A 4X=8j[i].5t("4X");if(!4X){6c}A m=4X.1fLine truncated
var decompressedDojo = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(V z=="1k"){(B(){if(V D["1o"]=="1k"){D.1o={}}if((!D["1z"])||(!1z["ca"])){D.1z={}}A cn=["rA","rz","1K","ry","rx","9f","rw","rv","ru","rt","rs","rr","rq","ro","rn","rm"];A i=0,24;1s(24=cn[i++]){if(!1z[24]){1z[24]=B(){}}}if(V D["z"]=="1k"){D.z={}}z.1W=D;A d3={im:U,rl:U,rk:"",rj:"",ri:"",rh:K,rg:U};R(A 8z in d3){if(V 1o[8z]=="1k"){1o[8z]=d3[8z]}}A jK=["rf","rd","rc","rb"];A t;1s(t=jK.3a()){z["is"+t]=U}})();z.8h=1o.8h;z.cY={jJ:0,jI:9,jH:0,jG:"",jF:2V("$ra: r9 $".1f(/[0-9]+/)[0]),2i:B(){4G(z.cY){C jJ+"."+jI+"."+jH+jG+" ("+jF+")"}}};z.d1=B(jE,jD,1V){A 2h=1V||z.1W;R(A i=0,p;2h&&(p=jE[i]);i++){2h=(p in 2h?2h[p]:(jD?2h[p]={}:1k))}C 2h};z.88=B(jC,jA,jB){A d2=jC.1A("."),p=d2.8q(),M=z.d1(d2,K,jB);C(M&&p?(M[p]=jA):1k)};z.6q=B(jz,jy,jx){C z.d1(jz.1A("."),jy,jx)};z.r8=B(jw,M){C!!z.6q(jw,U,M)};z["3u"]=B(d0){C z.1W.3u?z.1W.3u(d0):3u(d0)};z.ia=B(jv,cZ,cX){A 8y="r7: "+jv;if(cZ){8y+=" "+cZ}if(cX){8y+=" -- r6 be r5 in cY: "+cX}1z.1K(8y)};z.r4=B(ju,cW){A cV="r3: "+ju+" -- r2 r1 4F r0 qZ qY.";if(cW){cV+=" "+cW}1z.1K(cV)};(B(){A cR={53:{},6p:0,1h:{},8k:{z:{1p:"z",1Z:"."},cU:{1p:"cU",1Z:"../qX/cU"},cT:{1p:"cT",1Z:"cT"}},cN:B(cS){A mp=D.8k;C jp(mp[cS]&&mp[cS].1Z)},jk:B(8x){A mp=D.8k;if(D.cN(8x)){C mp[8x].1Z}C 8x},8v:[],6t:U,56:[],8t:[],8u:U};R(A cQ in cR){z[cQ]=cR[cQ]}})();z.jg=B(8w,cP,cb){A 1g=(((8w.2s(0)=="/"||8w.1f(/^\\w+:/)))?"":D.51)+8w;if(1o.jt&&z.c8){1g+="?"+67(1o.jt).2f(/\\W+/g,"")}1u{C!cP?D.cO(1g,cb):D.jq(1g,cP,cb)}1y(e){1z.1K(e);C U}};z.cO=B(1g,cb){if(D.8v[1g]){C K}A 6u=D.iR(1g,K);if(!6u){C U}D.8v[1g]=K;D.8v.Y(1g);if(cb){6u="("+6u+")"}A jr=z["3u"](6u+"\\r\\n//@ qW="+1g);if(cb){cb(jr)}C K};z.jq=B(1g,jo,cb){A ok=U;1u{ok=D.cO(1g,cb)}1y(e){1z.1K("qV je ",1g," 4G 9f: ",e)}C jp(ok&&D.53[jo])};z.6m=B(){D.8u=K;D.6t=K;A 57=D.56;D.56=[];R(A x=0;x<57.G;x++){57[x]()}D.8u=U;if(z.6t&&z.6p==0&&D.56.G>0){z.8s()}};z.ck=B(){A 57=D.8t;1s(57.G){(57.8q())()}};z.qU=B(M,jn){A d=z;if(P.G==1){d.56.Y(M)}I{if(P.G>1){d.56.Y(B(){M[jn]()})}}if(d.6t&&d.6p==0&&!d.8u){d.8s()}};z.dW=B(M,jm){A d=z;if(P.G==1){d.8t.Y(M)}I{if(P.G>1){d.8t.Y(B(){M[jm]()})}}};z.iM=B(){if(D.6t){C}if(D.6p>0){1z.1K("qT qS in qR!");C}z.8s()};z.8s=B(){if(V 5c=="8b"||(1o["qQ"]&&z.2M)){5c("z.6m();",0)}I{z.6m()}};z.cF=B(jl){A 4v=jl.1A(".");R(A i=4v.G;i>0;i--){A 8r=4v.2w(0,i).22(".");if((i==1)&&!D.cN(8r)){4v[0]="../"+4v[0]}I{A cM=D.jk(8r);if(cM!=8r){4v.3S(0,i,cM);3f}}}C 4v};z.jj=U;z.8m=B(2T,qP,55){55=D.jj||55;A 54=D.53[2T];if(54){C 54}A cL=2T.1A(".");A 3L=D.cF(2T);A jh=((3L[0].2s(0)!="/")&&!3L[0].1f(/^\\w+:/));A ji=3L[3L.G-1];A 3m;if(ji=="*"){2T=cL.2w(0,-1).22(".");3L.8q();3m=3L.22("/")+"/"+(1o["qO"]||"qN")+".js";if(jh&&3m.2s(0)=="/"){3m=3m.2w(1)}}I{3m=3L.22("/")+".js";2T=cL.22(".")}A jf=(!55)?2T:L;A ok=D.jg(3m,jf);if((!ok)&&(!55)){2m S 1O("qM 3O 4E \'"+2T+"\'; 72 qL \'"+3m+"\'")}if((!55)&&(!D["qK"])){54=D.53[2T];if(!54){2m S 1O("qJ \'"+2T+"\' is 3O qI a8 je \'"+3m+"\'")}}C 54};z.8c=z.8m;z.1Q=B(cK){A cJ=cK+"";A 8p=cJ;A 6s=cK.1A(/\\./);if(6s[6s.G-1]=="*"){6s.8q();8p=6s.22(".")}A 8o=z.6q(8p,K);D.53[cJ]=8o;D.53[8p]=8o;C 8o};z.qH=B(8n){A jd=8n["qG"]||[];A cI=jd.3U(8n[z.j4]||8n["aY"]||[]);R(A x=0;x<cI.G;x++){A 8l=cI[x];if(8l.1P==4e){z.8m.14(z,8l)}I{z.8m(8l)}}};z.jb=B(jc,qF){if(jc===K){A cH=[];R(A i=1;i<P.G;i++){cH.Y(P[i])}z.8c.14(z,cH)}};z.qE=z.jb;z.io=B(cG,ja){D.8k[cG]={1p:cG,1Z:ja}};z.qD=B(qC,qB,qA,qz){z.8c("z.j9");z.j9.qy.14(z.qx,P)};(B(){A j7=S 9G("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?$");A j6=S 9G("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");z.4r=B(){A n=L;A 1V=P;A 1g=1V[0];R(A i=1;i<1V.G;i++){if(!1V[i]){6c}A 1t=S z.4r(1V[i]+"");A 4u=S z.4r(1g+"");if((1t.28=="")&&(!1t.4t)&&(!1t.3l)&&(!1t.1r)){if(1t.52!=n){4u.52=1t.52}1t=4u}I{if(!1t.4t){1t.4t=4u.4t;if(!1t.3l){1t.3l=4u.3l;if(1t.28.2s(0)!="/"){A j8=4u.28.21(0,4u.28.31("/")+1)+1t.28;A 1X=j8.1A("/");R(A j=0;j<1X.G;j++){if(1X[j]=="."){if(j==1X.G-1){1X[j]=""}I{1X.3S(j,1);j--}}I{if(j>0&&!(j==1&&1X[0]=="")&&1X[j]==".."&&1X[j-1]!=".."){if(j==(1X.G-1)){1X.3S(j,1);1X[j-1]=""}I{1X.3S(j-1,2);j-=2}}}}1t.28=1X.22("/")}}}}1g="";if(1t.4t){1g+=1t.4t+":"}if(1t.3l){1g+="//"+1t.3l}1g+=1t.28;if(1t.1r){1g+="?"+1t.1r}if(1t.52){1g+="#"+1t.52}}D.1g=1g.2i();A r=D.1g.1f(j7);D.4t=r[2]||(r[1]?"":n);D.3l=r[4]||(r[3]?"":n);D.28=r[5];D.1r=r[7]||(r[6]?"":n);D.52=r[9]||(r[8]?"":n);if(D.3l!=n){r=D.3l.1f(j6);D.8X=r[3]||n;D.8W=r[4]||n;D.qw=r[5];D.qv=r[7]||n}};z.4r.1C.2i=B(){C D.1g}})();z.qu=B(j5,2E){A 2B=z.cF(j5).22("/");if(!2B){C L}if(2B.31("/")!=2B.G-1){2B+="/"}A cE=2B.T(":");if(2B.2s(0)!="/"&&(cE==-1||cE>2B.T("/"))){2B=z.51+2B}C S z.4r(2B,2E)};if(V 26!="1k"){z.c8=K;z.j4="qt";(B(){A d=z;if(1q&&1q.4I){A 8j=1q.4I("ak");A j3=/z(\\.qs)?\\.js([\\?\\.]|$)/i;R(A i=0;i<8j.G;i++){A 4X=8j[i].5t("4X");if(!4X){6c}A m=4X.1fLine truncated
/*
+21 -8
View File
@@ -343,7 +343,8 @@ OriginAttributes::IsFirstPartyEnabled()
return sFirstPartyIsolation;
}
BasePrincipal::BasePrincipal()
BasePrincipal::BasePrincipal(PrincipalKind aKind)
: mKind(aKind)
{}
BasePrincipal::~BasePrincipal()
@@ -560,6 +561,23 @@ BasePrincipal::GetCspJSON(nsAString& outCSPinJSON)
return mCSP->ToJSON(outCSPinJSON);
}
NS_IMETHODIMP
BasePrincipal::IsSameOrigin(nsIURI* aURI, bool aIsPrivateWin, bool* aRes) {
*aRes = false;
nsCOMPtr<nsIURI> prinURI;
nsresult rv = GetURI(getter_AddRefs(prinURI));
if (NS_FAILED(rv) || !prinURI) {
return NS_OK;
}
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
if (!ssm) {
return NS_ERROR_UNEXPECTED;
;
}
*aRes = NS_SUCCEEDED(ssm->CheckSameOriginURI(prinURI, aURI, aIsPrivateWin));
return NS_OK;
}
NS_IMETHODIMP
BasePrincipal::GetIsNullPrincipal(bool* aResult)
{
@@ -607,13 +625,8 @@ BasePrincipal::GetOriginSuffix(nsACString& aOriginAttributes)
NS_IMETHODIMP
BasePrincipal::GetAppStatus(uint16_t* aAppStatus)
{
if (AppId() == nsIScriptSecurityManager::UNKNOWN_APP_ID) {
NS_WARNING("Asking for app status on a principal with an unknown app id");
*aAppStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED;
return NS_OK;
}
*aAppStatus = nsScriptSecurityManager::AppStatusForPrincipal(this);
// TODO: Remove GetAppStatus.
*aAppStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED;
return NS_OK;
}
+20 -9
View File
@@ -251,7 +251,14 @@ public:
class BasePrincipal : public nsJSPrincipals
{
public:
BasePrincipal();
enum PrincipalKind {
eNullPrincipal,
eCodebasePrincipal,
eExpandedPrincipal,
eSystemPrincipal
};
explicit BasePrincipal(PrincipalKind aKind);
enum DocumentDomainConsideration { DontConsiderDocumentDomain, ConsiderDocumentDomain};
bool Subsumes(nsIPrincipal* aOther, DocumentDomainConsideration aConsideration);
@@ -282,6 +289,7 @@ public:
NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) final;
NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final;
NS_IMETHOD GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId) final;
NS_IMETHOD IsSameOrigin(nsIURI* aURI, bool aIsPrivateWin, bool* aRes) override;
bool EqualsIgnoringAddonId(nsIPrincipal *aOther);
@@ -300,17 +308,19 @@ public:
uint32_t PrivateBrowsingId() const { return mOriginAttributes.mPrivateBrowsingId; }
bool IsInIsolatedMozBrowserElement() const { return mOriginAttributes.mInIsolatedMozBrowser; }
enum PrincipalKind {
eNullPrincipal,
eCodebasePrincipal,
eExpandedPrincipal,
eSystemPrincipal
};
virtual PrincipalKind Kind() = 0;
PrincipalKind Kind() const { return mKind; }
already_AddRefed<BasePrincipal> CloneStrippingUserContextIdAndFirstPartyDomain();
/**
* Returns true if this principal's CSP should override a document's CSP for
* loads that it triggers. Currently true only for expanded principals which
* subsume the document principal.
*/
bool OverridesCSP(nsIPrincipal* aDocumentPrincipal) {
return mKind == eExpandedPrincipal && Subsumes(aDocumentPrincipal, DontConsiderDocumentDomain);
}
protected:
virtual ~BasePrincipal();
@@ -332,6 +342,7 @@ protected:
nsCOMPtr<nsIContentSecurityPolicy> mCSP;
nsCOMPtr<nsIContentSecurityPolicy> mPreloadCSP;
PrincipalOriginAttributes mOriginAttributes;
PrincipalKind mKind;
};
} // namespace mozilla
+5
View File
@@ -33,7 +33,12 @@ EXPORTS.mozilla = [
]
SOURCES += [
# Compile this separately since nsExceptionHandler.h conflicts
# with something from nsNullPrincipal.cpp.
'BasePrincipal.cpp',
]
UNIFIED_SOURCES += [
'DomainPolicy.cpp',
'nsJSPrincipals.cpp',
'nsNullPrincipal.cpp',
+6 -9
View File
@@ -223,6 +223,12 @@ interface nsIPrincipal : nsISerializable
*/
readonly attribute AUTF8String originSuffix;
/**
* Uses NS_Security Compare to determine if the
* other URI is same-origin as the uri of the Principal
*/
bool IsSameOrigin(in nsIURI otherURI, in bool aIsPrivateWin);
/**
* The base domain of the codebase URI to which this principal pertains
* (generally the document URI), handling null principals and
@@ -297,15 +303,6 @@ interface nsIPrincipal : nsISerializable
*/
[infallible] readonly attribute unsigned long privateBrowsingId;
/**
* Returns true iff the principal is inside an isolated mozbrowser element.
* <iframe mozbrowser mozapp> and <xul:browser> are not considered to be
* mozbrowser elements. <iframe mozbrowser noisolation> does not count as
* isolated since isolation is disabled. Isolation can only be disabled if
* the containing document is chrome.
*/
[infallible] readonly attribute boolean isInIsolatedMozBrowserElement;
/**
* Returns true if this principal has an unknown appId. This shouldn't
* generally be used. We only expose it due to not providing the correct
+3 -3
View File
@@ -36,7 +36,9 @@ public:
// This should only be used by deserialization, and the factory constructor.
// Other consumers should use the Create and CreateWithInheritedAttributes
// methods.
nsNullPrincipal() {}
nsNullPrincipal()
: BasePrincipal(eNullPrincipal)
{}
NS_DECL_NSISERIALIZABLE
@@ -60,8 +62,6 @@ public:
virtual nsresult GetScriptLocation(nsACString &aStr) override;
PrincipalKind Kind() override { return eNullPrincipal; }
protected:
virtual ~nsNullPrincipal() {}
+4 -4
View File
@@ -31,8 +31,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/HashFunctions.h"
#include "nsIAppsService.h"
using namespace mozilla;
static bool gCodeBasePrincipalSupport = false;
@@ -66,10 +64,11 @@ nsPrincipal::InitializeStatics()
}
nsPrincipal::nsPrincipal()
: mCodebaseImmutable(false)
: BasePrincipal(eCodebasePrincipal)
, mCodebaseImmutable(false)
, mDomainImmutable(false)
, mInitialized(false)
{ }
{}
nsPrincipal::~nsPrincipal()
{
@@ -516,6 +515,7 @@ struct OriginComparator
nsExpandedPrincipal::nsExpandedPrincipal(nsTArray<nsCOMPtr<nsIPrincipal>> &aWhiteList,
const PrincipalOriginAttributes& aAttrs)
: BasePrincipal(eExpandedPrincipal)
{
// We force the principals to be sorted by origin so that nsExpandedPrincipal
// origins can have a canonical form.
-4
View File
@@ -46,8 +46,6 @@ public:
*/
static void InitializeStatics();
PrincipalKind Kind() override { return eCodebasePrincipal; }
nsCOMPtr<nsIURI> mDomain;
nsCOMPtr<nsIURI> mCodebase;
// If mCodebaseImmutable is true, mCodebase is non-null and immutable
@@ -82,8 +80,6 @@ public:
virtual nsresult GetScriptLocation(nsACString &aStr) override;
nsresult GetOriginInternal(nsACString& aOrigin) override;
PrincipalKind Kind() override { return eExpandedPrincipal; }
protected:
virtual ~nsExpandedPrincipal();
+7 -65
View File
@@ -9,7 +9,6 @@
#include "xpcpublic.h"
#include "XPCWrapper.h"
#include "nsIAppsService.h"
#include "nsIInputStreamChannel.h"
#include "nsILoadContext.h"
#include "nsIServiceManager.h"
@@ -55,7 +54,6 @@
#include "nsIChromeRegistry.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozIApplication.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/ContentParent.h"
@@ -76,6 +74,7 @@ nsIIOService *nsScriptSecurityManager::sIOService = nullptr;
nsIStringBundle *nsScriptSecurityManager::sStrBundle = nullptr;
JSContext *nsScriptSecurityManager::sContext = nullptr;
bool nsScriptSecurityManager::sStrictFileOriginPolicy = true;
bool nsScriptSecurityManager::sSameOriginPolicy = true;
///////////////////////////
// Convenience Functions //
@@ -239,68 +238,6 @@ nsScriptSecurityManager::SecurityHashURI(nsIURI* aURI)
return NS_SecurityHashURI(aURI);
}
uint16_t
nsScriptSecurityManager::AppStatusForPrincipal(nsIPrincipal *aPrin)
{
uint32_t appId = aPrin->GetAppId();
// After bug 1238160, the principal no longer knows how to answer "is this a
// browser element", which is really what this code path wants. Currently,
// desktop is the only platform where we intend to disable isolation on a
// browser frame, so non-desktop should be able to assume that
// inIsolatedMozBrowser is true for all mozbrowser frames. Additionally,
// apps are no longer used on desktop, so appId is always NO_APP_ID. We use
// a release assertion in nsFrameLoader::OwnerIsIsolatedMozBrowserFrame so
// that platforms with apps can assume inIsolatedMozBrowser is true for all
// mozbrowser frames.
bool inIsolatedMozBrowser = aPrin->GetIsInIsolatedMozBrowserElement();
NS_WARNING_ASSERTION(
appId != nsIScriptSecurityManager::UNKNOWN_APP_ID,
"Asking for app status on a principal with an unknown app id");
// Installed apps have a valid app id (not NO_APP_ID or UNKNOWN_APP_ID)
// and they are not inside a mozbrowser.
if (appId == nsIScriptSecurityManager::NO_APP_ID ||
appId == nsIScriptSecurityManager::UNKNOWN_APP_ID ||
inIsolatedMozBrowser)
{
return nsIPrincipal::APP_STATUS_NOT_INSTALLED;
}
nsCOMPtr<nsIAppsService> appsService = do_GetService(APPS_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(appsService, nsIPrincipal::APP_STATUS_NOT_INSTALLED);
nsCOMPtr<mozIApplication> app;
appsService->GetAppByLocalId(appId, getter_AddRefs(app));
NS_ENSURE_TRUE(app, nsIPrincipal::APP_STATUS_NOT_INSTALLED);
uint16_t status = nsIPrincipal::APP_STATUS_INSTALLED;
NS_ENSURE_SUCCESS(app->GetAppStatus(&status),
nsIPrincipal::APP_STATUS_NOT_INSTALLED);
nsString appOrigin;
NS_ENSURE_SUCCESS(app->GetOrigin(appOrigin),
nsIPrincipal::APP_STATUS_NOT_INSTALLED);
nsCOMPtr<nsIURI> appURI;
NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(appURI), appOrigin),
nsIPrincipal::APP_STATUS_NOT_INSTALLED);
// The app could contain a cross-origin iframe - make sure that the content
// is actually same-origin with the app.
MOZ_ASSERT(inIsolatedMozBrowser == false, "Checked this above");
nsAutoCString suffix;
PrincipalOriginAttributes attrs;
NS_ENSURE_TRUE(attrs.PopulateFromOrigin(NS_ConvertUTF16toUTF8(appOrigin), suffix),
nsIPrincipal::APP_STATUS_NOT_INSTALLED);
attrs.mAppId = appId;
attrs.mInIsolatedMozBrowser = false;
nsCOMPtr<nsIPrincipal> appPrin = BasePrincipal::CreateCodebasePrincipal(appURI, attrs);
NS_ENSURE_TRUE(appPrin, nsIPrincipal::APP_STATUS_NOT_INSTALLED);
return aPrin->Equals(appPrin) ? status
: nsIPrincipal::APP_STATUS_NOT_INSTALLED;
}
/*
* GetChannelResultPrincipal will return the principal that the resource
* returned by this channel will use. For example, if the resource is in
@@ -607,7 +544,7 @@ nsScriptSecurityManager::CheckSameOriginURI(nsIURI* aSourceURI,
nsIURI* aTargetURI,
bool reportError)
{
if (!SecurityCompareURIs(aSourceURI, aTargetURI))
if (sSameOriginPolicy && !SecurityCompareURIs(aSourceURI, aTargetURI))
{
if (reportError) {
ReportError(nullptr, NS_LITERAL_STRING("CheckSameOriginError"),
@@ -1434,10 +1371,13 @@ nsScriptSecurityManager::CanGetService(JSContext *cx,
const char sJSEnabledPrefName[] = "javascript.enabled";
const char sFileOriginPolicyPrefName[] =
"security.fileuri.strict_origin_policy";
const char sSameOriginPolicyPrefName[] =
"security.same_origin_policy.enabled";
static const char* kObservedPrefs[] = {
sJSEnabledPrefName,
sFileOriginPolicyPrefName,
sSameOriginPolicyPrefName,
"capability.policy.",
nullptr
};
@@ -1593,6 +1533,8 @@ nsScriptSecurityManager::ScriptSecurityPrefChanged()
Preferences::GetBool(sJSEnabledPrefName, mIsJavaScriptEnabled);
sStrictFileOriginPolicy =
Preferences::GetBool(sFileOriginPolicyPrefName, false);
sSameOriginPolicy =
Preferences::GetBool(sSameOriginPolicyPrefName, true);
mFileURIWhitelist.reset();
}
+1
View File
@@ -152,6 +152,7 @@ private:
}
static bool sStrictFileOriginPolicy;
static bool sSameOriginPolicy;
static nsIIOService *sIOService;
static nsIStringBundle *sStrBundle;
+3 -3
View File
@@ -36,7 +36,9 @@ public:
NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) override;
nsresult GetOriginInternal(nsACString& aOrigin) override;
nsSystemPrincipal() {}
nsSystemPrincipal()
: BasePrincipal(eSystemPrincipal)
{}
virtual nsresult GetScriptLocation(nsACString &aStr) override;
@@ -52,8 +54,6 @@ protected:
{
return true;
}
PrincipalKind Kind() override { return eSystemPrincipal; }
};
#endif // nsSystemPrincipal_h__
-1
View File
@@ -4,7 +4,6 @@ support-files =
file_disableScript.html
!/js/xpconnect/tests/mochitest/file_empty.html
[test_app_principal_equality.html]
[test_bug246699.html]
[test_bug292789.html]
[test_bug423375.html]
@@ -1,88 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=777467
-->
<head>
<meta charset="utf-8">
<title>Test app principal's equality</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=777467">Mozilla Bug 777467</a>
<p id="display"></p>
<script>
/** Test for app principal's equality **/
SimpleTest.waitForExplicitFinish();
var permissions = new Promise(resolve => {
SpecialPowers.pushPermissions(
[{ type: "browser", allow: true, context: document },
{ type: "embed-apps", allow: true, context: document }],
resolve);
});
permissions.then(() => {
$('content').innerHTML =
'<iframe src="error404"></iframe>\n' +
'<iframe mozbrowser src="error404"></iframe>\n' +
'<iframe mozapp="http://example.org/manifest.webapp" mozbrowser src="error404"></iframe>';
var iframes = document.getElementsByTagName("iframe");
var promises = []
for (var i = 0; i < promises.length; ++i) {
promises.push(new Promise(resolve => {
iframes[i].addEventListener("load", resolve);
}));
}
return Promise.all(promises);
});
var prefs = new Promise(resolve => {
SpecialPowers.pushPrefEnv(
{ set: [[ "dom.mozBrowserFramesEnabled", true ],
[ "dom.ipc.browser_frames.oop_by_default", false ]] },
resolve);
});
</script>
<div id="content" style="display: none;">
</div>
<pre id="test">
<script type="application/javascript">
function canAccessDocument(win) {
var result = true;
try {
win.document;
} catch(e) {
result = false;
}
return result;
}
var loaded = new Promise(resolve => addLoadEvent(resolve));
Promise.all([ permissions, prefs, loaded ]).then(runTest);
function runTest() {
// Test the witness frame (we can access same-origin frame).
is(canAccessDocument(frames[0]), true,
"should be able to access the first frame");
// Test different app/browserElement frames.
for (var i=1; i<frames.length; ++i) {
is(canAccessDocument(frames[i]), false,
"should not be able to access the other frames");
}
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>
+1 -1
View File
@@ -16,7 +16,7 @@ EXPORTS.mozilla.chrome += [
'RegistryMessageUtils.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'nsChromeProtocolHandler.cpp',
'nsChromeRegistry.cpp',
'nsChromeRegistryChrome.cpp',
+20 -1
View File
@@ -18,20 +18,30 @@ sources = [
'/intl/icu/source/common/dictionarydata.cpp',
'/intl/icu/source/common/dtintrv.cpp',
'/intl/icu/source/common/edits.cpp',
'/intl/icu/source/common/emojiprops.cpp',
'/intl/icu/source/common/errorcode.cpp',
'/intl/icu/source/common/filteredbrk.cpp',
'/intl/icu/source/common/filterednormalizer2.cpp',
'/intl/icu/source/common/fixedstring.cpp',
'/intl/icu/source/common/loadednormalizer2impl.cpp',
'/intl/icu/source/common/localebuilder.cpp',
'/intl/icu/source/common/localematcher.cpp',
'/intl/icu/source/common/localeprioritylist.cpp',
'/intl/icu/source/common/locavailable.cpp',
'/intl/icu/source/common/locbased.cpp',
'/intl/icu/source/common/locdispnames.cpp',
'/intl/icu/source/common/locdistance.cpp',
'/intl/icu/source/common/locdspnm.cpp',
'/intl/icu/source/common/locid.cpp',
'/intl/icu/source/common/loclikely.cpp',
'/intl/icu/source/common/loclikelysubtags.cpp',
'/intl/icu/source/common/locmap.cpp',
'/intl/icu/source/common/locresdata.cpp',
'/intl/icu/source/common/locutil.cpp',
'/intl/icu/source/common/lsr.cpp',
'/intl/icu/source/common/lstmbe.cpp',
'/intl/icu/source/common/messagepattern.cpp',
'/intl/icu/source/common/mlbe.cpp',
'/intl/icu/source/common/normalizer2.cpp',
'/intl/icu/source/common/normalizer2impl.cpp',
'/intl/icu/source/common/normlzr.cpp',
@@ -51,6 +61,7 @@ sources = [
'/intl/icu/source/common/rbbitblb.cpp',
'/intl/icu/source/common/resbund.cpp',
'/intl/icu/source/common/resource.cpp',
'/intl/icu/source/common/restrace.cpp',
'/intl/icu/source/common/ruleiter.cpp',
'/intl/icu/source/common/schriter.cpp',
'/intl/icu/source/common/serv.cpp',
@@ -110,6 +121,8 @@ sources = [
'/intl/icu/source/common/uloc.cpp',
'/intl/icu/source/common/uloc_keytype.cpp',
'/intl/icu/source/common/uloc_tag.cpp',
'/intl/icu/source/common/ulocale.cpp',
'/intl/icu/source/common/ulocbuilder.cpp',
'/intl/icu/source/common/umapfile.cpp',
'/intl/icu/source/common/umath.cpp',
'/intl/icu/source/common/umutablecptrie.cpp',
@@ -151,6 +164,7 @@ sources = [
'/intl/icu/source/common/utext.cpp',
'/intl/icu/source/common/utf_impl.cpp',
'/intl/icu/source/common/util.cpp',
'/intl/icu/source/common/util_props.cpp',
'/intl/icu/source/common/utrace.cpp',
'/intl/icu/source/common/utrie.cpp',
'/intl/icu/source/common/utrie2.cpp',
@@ -190,7 +204,6 @@ other_sources = [
'/intl/icu/source/common/usc_impl.cpp',
'/intl/icu/source/common/ushape.cpp',
'/intl/icu/source/common/ustr_wcs.cpp',
'/intl/icu/source/common/util_props.cpp',
]
EXPORTS.unicode += [
'/intl/icu/source/common/unicode/appendable.h',
@@ -212,6 +225,8 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/icudataver.h',
'/intl/icu/source/common/unicode/icuplug.h',
'/intl/icu/source/common/unicode/idna.h',
'/intl/icu/source/common/unicode/localebuilder.h',
'/intl/icu/source/common/unicode/localematcher.h',
'/intl/icu/source/common/unicode/localpointer.h',
'/intl/icu/source/common/unicode/locdspnm.h',
'/intl/icu/source/common/unicode/locid.h',
@@ -259,6 +274,8 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/uiter.h',
'/intl/icu/source/common/unicode/uldnames.h',
'/intl/icu/source/common/unicode/uloc.h',
'/intl/icu/source/common/unicode/ulocale.h',
'/intl/icu/source/common/unicode/ulocbuilder.h',
'/intl/icu/source/common/unicode/umachine.h',
'/intl/icu/source/common/unicode/umisc.h',
'/intl/icu/source/common/unicode/umutablecptrie.h',
@@ -286,6 +303,8 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/utf32.h',
'/intl/icu/source/common/unicode/utf8.h',
'/intl/icu/source/common/unicode/utf_old.h',
'/intl/icu/source/common/unicode/utfiterator.h',
'/intl/icu/source/common/unicode/utfstring.h',
'/intl/icu/source/common/unicode/utrace.h',
'/intl/icu/source/common/unicode/utypes.h',
'/intl/icu/source/common/unicode/uvernum.h',
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+22
View File
@@ -3,12 +3,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Also see <http://www.icu-project.org/repos/icu/tags/latest/icu4c/readme.html#RecBuild> for the
# recommended build options when compiling ICU.
DEFINES.update(
# Don't use icu namespace automatically in client code.
U_USING_ICU_NAMESPACE = 0,
# Don't include obsolete header files.
U_NO_DEFAULT_INCLUDE_UTF_HEADERS = 1,
U_HIDE_OBSOLETE_UTF_OLD_H = 1,
# Remove chunks of the library that we don't need (yet).
UCONFIG_NO_LEGACY_CONVERSION = True,
@@ -17,6 +20,13 @@ DEFINES.update(
# We don't need to pass data to and from legacy char* APIs.
U_CHARSET_IS_UTF8 = True,
# Add 'explicit' keyword to UnicodeString constructors.
UNISTR_FROM_CHAR_EXPLICIT = 'explicit',
UNISTR_FROM_STRING_EXPLICIT = 'explicit',
# Disable dynamic loading of ICU data as a loadable library.
U_ENABLE_DYLOAD = 0,
)
if not CONFIG['HAVE_LANGINFO_CODESET']:
@@ -38,12 +48,24 @@ ALLOW_COMPILER_WARNINGS = True
# warnings that get triggered for every file.
if CONFIG['CLANG_CL']:
CFLAGS += [
'-Wno-c++20-compat',
'-Wno-comma',
'-Wno-implicit-const-int-float-conversion',
'-Wno-macro-redefined',
'-Wno-microsoft-include',
'-Wno-tautological-unsigned-enum-zero-compare',
'-Wno-unreachable-code-loop-increment',
'-Wno-unreachable-code-return',
]
CXXFLAGS += [
'-Wno-c++20-compat',
'-Wno-comma',
'-Wno-implicit-const-int-float-conversion',
'-Wno-macro-redefined',
'-Wno-microsoft-include',
'-Wno-tautological-unsigned-enum-zero-compare',
'-Wno-unreachable-code-loop-increment',
'-Wno-unreachable-code-return',
]
if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']:
+47 -5
View File
@@ -42,13 +42,14 @@ sources = [
'/intl/icu/source/i18n/decContext.cpp',
'/intl/icu/source/i18n/decimfmt.cpp',
'/intl/icu/source/i18n/decNumber.cpp',
'/intl/icu/source/i18n/displayoptions.cpp',
'/intl/icu/source/i18n/double-conversion-bignum-dtoa.cpp',
'/intl/icu/source/i18n/double-conversion-bignum.cpp',
'/intl/icu/source/i18n/double-conversion-cached-powers.cpp',
'/intl/icu/source/i18n/double-conversion-diy-fp.cpp',
'/intl/icu/source/i18n/double-conversion-double-to-string.cpp',
'/intl/icu/source/i18n/double-conversion-fast-dtoa.cpp',
'/intl/icu/source/i18n/double-conversion-string-to-double.cpp',
'/intl/icu/source/i18n/double-conversion-strtod.cpp',
'/intl/icu/source/i18n/double-conversion.cpp',
'/intl/icu/source/i18n/dtfmtsym.cpp',
'/intl/icu/source/i18n/dtitvfmt.cpp',
'/intl/icu/source/i18n/dtitvinf.cpp',
@@ -58,6 +59,10 @@ sources = [
'/intl/icu/source/i18n/ethpccal.cpp',
'/intl/icu/source/i18n/fmtable.cpp',
'/intl/icu/source/i18n/format.cpp',
'/intl/icu/source/i18n/formatted_string_builder.cpp',
'/intl/icu/source/i18n/formattedval_iterimpl.cpp',
'/intl/icu/source/i18n/formattedval_sbimpl.cpp',
'/intl/icu/source/i18n/formattedvalue.cpp',
'/intl/icu/source/i18n/fphdlimp.cpp',
'/intl/icu/source/i18n/fpositer.cpp',
'/intl/icu/source/i18n/gregocal.cpp',
@@ -65,16 +70,28 @@ sources = [
'/intl/icu/source/i18n/hebrwcal.cpp',
'/intl/icu/source/i18n/indiancal.cpp',
'/intl/icu/source/i18n/islamcal.cpp',
'/intl/icu/source/i18n/iso8601cal.cpp',
'/intl/icu/source/i18n/japancal.cpp',
'/intl/icu/source/i18n/listformatter.cpp',
'/intl/icu/source/i18n/measfmt.cpp',
'/intl/icu/source/i18n/measunit.cpp',
'/intl/icu/source/i18n/measunit_extra.cpp',
'/intl/icu/source/i18n/measure.cpp',
'/intl/icu/source/i18n/messageformat2.cpp',
'/intl/icu/source/i18n/messageformat2_arguments.cpp',
'/intl/icu/source/i18n/messageformat2_checker.cpp',
'/intl/icu/source/i18n/messageformat2_data_model.cpp',
'/intl/icu/source/i18n/messageformat2_errors.cpp',
'/intl/icu/source/i18n/messageformat2_evaluation.cpp',
'/intl/icu/source/i18n/messageformat2_formattable.cpp',
'/intl/icu/source/i18n/messageformat2_formatter.cpp',
'/intl/icu/source/i18n/messageformat2_function_registry.cpp',
'/intl/icu/source/i18n/messageformat2_parser.cpp',
'/intl/icu/source/i18n/messageformat2_serializer.cpp',
'/intl/icu/source/i18n/msgfmt.cpp',
'/intl/icu/source/i18n/nfrs.cpp',
'/intl/icu/source/i18n/nfrule.cpp',
'/intl/icu/source/i18n/nfsubs.cpp',
'/intl/icu/source/i18n/nounit.cpp',
'/intl/icu/source/i18n/number_affixutils.cpp',
'/intl/icu/source/i18n/number_asformat.cpp',
'/intl/icu/source/i18n/number_capi.cpp',
@@ -91,13 +108,16 @@ sources = [
'/intl/icu/source/i18n/number_modifiers.cpp',
'/intl/icu/source/i18n/number_multiplier.cpp',
'/intl/icu/source/i18n/number_notation.cpp',
'/intl/icu/source/i18n/number_output.cpp',
'/intl/icu/source/i18n/number_padding.cpp',
'/intl/icu/source/i18n/number_patternmodifier.cpp',
'/intl/icu/source/i18n/number_patternstring.cpp',
'/intl/icu/source/i18n/number_rounding.cpp',
'/intl/icu/source/i18n/number_scientific.cpp',
'/intl/icu/source/i18n/number_simple.cpp',
'/intl/icu/source/i18n/number_skeletons.cpp',
'/intl/icu/source/i18n/number_stringbuilder.cpp',
'/intl/icu/source/i18n/number_symbolswrapper.cpp',
'/intl/icu/source/i18n/number_usageprefs.cpp',
'/intl/icu/source/i18n/number_utils.cpp',
'/intl/icu/source/i18n/numfmt.cpp',
'/intl/icu/source/i18n/numparse_affixes.cpp',
@@ -107,14 +127,15 @@ sources = [
'/intl/icu/source/i18n/numparse_impl.cpp',
'/intl/icu/source/i18n/numparse_parsednumber.cpp',
'/intl/icu/source/i18n/numparse_scientific.cpp',
'/intl/icu/source/i18n/numparse_stringsegment.cpp',
'/intl/icu/source/i18n/numparse_symbols.cpp',
'/intl/icu/source/i18n/numparse_validators.cpp',
'/intl/icu/source/i18n/numrange_capi.cpp',
'/intl/icu/source/i18n/numrange_fluent.cpp',
'/intl/icu/source/i18n/numrange_impl.cpp',
'/intl/icu/source/i18n/numsys.cpp',
'/intl/icu/source/i18n/olsontz.cpp',
'/intl/icu/source/i18n/persncal.cpp',
'/intl/icu/source/i18n/pluralranges.cpp',
'/intl/icu/source/i18n/plurfmt.cpp',
'/intl/icu/source/i18n/plurrule.cpp',
'/intl/icu/source/i18n/quantityformatter.cpp',
@@ -133,6 +154,7 @@ sources = [
'/intl/icu/source/i18n/smpdtfst.cpp',
'/intl/icu/source/i18n/sortkey.cpp',
'/intl/icu/source/i18n/standardplural.cpp',
'/intl/icu/source/i18n/string_segment.cpp',
'/intl/icu/source/i18n/stsearch.cpp',
'/intl/icu/source/i18n/taiwncal.cpp',
'/intl/icu/source/i18n/timezone.cpp',
@@ -157,6 +179,10 @@ sources = [
'/intl/icu/source/i18n/uitercollationiterator.cpp',
'/intl/icu/source/i18n/ulistformatter.cpp',
'/intl/icu/source/i18n/umsg.cpp',
'/intl/icu/source/i18n/units_complexconverter.cpp',
'/intl/icu/source/i18n/units_converter.cpp',
'/intl/icu/source/i18n/units_data.cpp',
'/intl/icu/source/i18n/units_router.cpp',
'/intl/icu/source/i18n/unum.cpp',
'/intl/icu/source/i18n/unumsys.cpp',
'/intl/icu/source/i18n/upluralrules.cpp',
@@ -245,6 +271,7 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/datefmt.h',
'/intl/icu/source/i18n/unicode/dcfmtsym.h',
'/intl/icu/source/i18n/unicode/decimfmt.h',
'/intl/icu/source/i18n/unicode/displayoptions.h',
'/intl/icu/source/i18n/unicode/dtfmtsym.h',
'/intl/icu/source/i18n/unicode/dtitvfmt.h',
'/intl/icu/source/i18n/unicode/dtitvinf.h',
@@ -253,6 +280,8 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/fieldpos.h',
'/intl/icu/source/i18n/unicode/fmtable.h',
'/intl/icu/source/i18n/unicode/format.h',
'/intl/icu/source/i18n/unicode/formattednumber.h',
'/intl/icu/source/i18n/unicode/formattedvalue.h',
'/intl/icu/source/i18n/unicode/fpositer.h',
'/intl/icu/source/i18n/unicode/gender.h',
'/intl/icu/source/i18n/unicode/gregocal.h',
@@ -260,6 +289,12 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/measfmt.h',
'/intl/icu/source/i18n/unicode/measunit.h',
'/intl/icu/source/i18n/unicode/measure.h',
'/intl/icu/source/i18n/unicode/messageformat2.h',
'/intl/icu/source/i18n/unicode/messageformat2_arguments.h',
'/intl/icu/source/i18n/unicode/messageformat2_data_model.h',
'/intl/icu/source/i18n/unicode/messageformat2_data_model_names.h',
'/intl/icu/source/i18n/unicode/messageformat2_formattable.h',
'/intl/icu/source/i18n/unicode/messageformat2_function_registry.h',
'/intl/icu/source/i18n/unicode/msgfmt.h',
'/intl/icu/source/i18n/unicode/nounit.h',
'/intl/icu/source/i18n/unicode/numberformatter.h',
@@ -276,6 +311,7 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/scientificnumberformatter.h',
'/intl/icu/source/i18n/unicode/search.h',
'/intl/icu/source/i18n/unicode/selfmt.h',
'/intl/icu/source/i18n/unicode/simplenumberformatter.h',
'/intl/icu/source/i18n/unicode/simpletz.h',
'/intl/icu/source/i18n/unicode/smpdtfmt.h',
'/intl/icu/source/i18n/unicode/sortkey.h',
@@ -297,8 +333,11 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/udat.h',
'/intl/icu/source/i18n/unicode/udateintervalformat.h',
'/intl/icu/source/i18n/unicode/udatpg.h',
'/intl/icu/source/i18n/unicode/udisplayoptions.h',
'/intl/icu/source/i18n/unicode/ufieldpositer.h',
'/intl/icu/source/i18n/unicode/uformattable.h',
'/intl/icu/source/i18n/unicode/uformattednumber.h',
'/intl/icu/source/i18n/unicode/uformattedvalue.h',
'/intl/icu/source/i18n/unicode/ugender.h',
'/intl/icu/source/i18n/unicode/ulistformatter.h',
'/intl/icu/source/i18n/unicode/ulocdata.h',
@@ -306,12 +345,15 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/unirepl.h',
'/intl/icu/source/i18n/unicode/unum.h',
'/intl/icu/source/i18n/unicode/unumberformatter.h',
'/intl/icu/source/i18n/unicode/unumberoptions.h',
'/intl/icu/source/i18n/unicode/unumberrangeformatter.h',
'/intl/icu/source/i18n/unicode/unumsys.h',
'/intl/icu/source/i18n/unicode/upluralrules.h',
'/intl/icu/source/i18n/unicode/uregex.h',
'/intl/icu/source/i18n/unicode/uregion.h',
'/intl/icu/source/i18n/unicode/ureldatefmt.h',
'/intl/icu/source/i18n/unicode/usearch.h',
'/intl/icu/source/i18n/unicode/usimplenumberformatter.h',
'/intl/icu/source/i18n/unicode/uspoof.h',
'/intl/icu/source/i18n/unicode/utmscale.h',
'/intl/icu/source/i18n/unicode/utrans.h',
+2 -3
View File
@@ -41,12 +41,11 @@ if CONFIG['CPU_ARCH'] == 'arm':
if CONFIG['MOZ_FFVPX']:
external_dirs += ['media/ffvpx']
if CONFIG["MOZ_JXL"]:
external_dirs += ["media/libjxl", "media/highway"]
external_dirs += [
'media/highway',
'media/kiss_fft',
'media/libcubeb',
'media/libjxl',
'media/libnestegg',
'media/libogg',
'media/libopus',
+1 -1
View File
@@ -8,4 +8,4 @@
# Referenced by milestone.py.
#--------------------------------------------------------
6.6.0
6.8.0
-3
View File
@@ -1033,9 +1033,6 @@ X11/Xutil.h
zmouse.h
soundtouch/SoundTouch.h
soundtouch/SoundTouchFactory.h
#if MOZ_LIBAV_FFT==1
libavcodec/avfft.h
#endif
#if MOZ_SYSTEM_ZLIB==1
zlib.h
#endif
+9 -34
View File
@@ -1,39 +1,14 @@
This directory contains source code to
This is the SQLite amalgamation.
Check sqlite3.h for the version number and source id.
SQLite: An Embeddable SQL Database Engine
See http://www.sqlite.org/ for more info.
To compile the project, first create a directory in which to place
the build products. It is recommended, but not required, that the
build directory be separate from the source directory. Cd into the
build directory and then from the build directory run the configure
script found at the root of the source tree. Then run "make".
We have a UXP-specific moz.build in src/ (normally not there) that we
use to build. Additionally, src/ contains sqlite.symbols which lists
all explicitly exported symbols from the library to expose.
For example:
To move to a new version:
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
mkdir bld ;# Build will occur in a sibling directory
cd bld ;# Change to the build directory
../sqlite/configure ;# Run the configure script
make ;# Run the makefile.
make install ;# (Optional) Install the build products
Copy the sqlite3.h and sqlite3.c files from the amalgamation of sqlite.
The configure script uses autoconf 2.61 and libtool. If the configure
script does not work out for you, there is a generic makefile named
"Makefile.linux-gcc" in the top directory of the source tree that you
can copy and edit to suit your needs. Comments on the generic makefile
show what changes are needed.
The linux binaries on the website are created using the generic makefile,
not the configure script. The windows binaries on the website are created
using MinGW32 configured as a cross-compiler running under Linux. For
details, see the ./publish.sh script at the top-level of the source tree.
The developers do not use teh configure script.
SQLite does not require TCL to run, but a TCL installation is required
by the makefiles. SQLite contains a lot of generated code and TCL is
used to do much of that code generation. The makefile also requires
AWK.
Contacts:
http://www.sqlite.org/
Be sure to update SQLITE_VERSION accordingly in $(topsrcdir)/old-configure.in.
-13
View File
@@ -1,13 +0,0 @@
This is the SQLite amalgamation.
Check sqlite3.h for the version number and source id.
See http://www.sqlite.org/ for more info.
We have a mozilla-specific Makefile.in in src/ (normally no
Makefile.in there) that we use to build.
To move to a new version:
Copy the sqlite3.h and sqlite3.c files from the amalgamation of sqlite.
Be sure to update SQLITE_VERSION accordingly in $(topsrcdir)/configure.in.
+27075 -11895
View File
File diff suppressed because it is too large. Load diff
+869 -164
View File
File diff suppressed because it is too large. Load diff
+161 -161
View File
@@ -2397,7 +2397,7 @@ var Debugger =
/***/ function(module, exports, __webpack_require__) {
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
var React = __webpack_require__(2);
@@ -30019,166 +30019,166 @@ var Debugger =
/* 266 */
/***/ function(module, exports, __webpack_require__) {
(function(){
var crypt = __webpack_require__(267),
utf8 = __webpack_require__(268).utf8,
isBuffer = __webpack_require__(269),
bin = __webpack_require__(268).bin,
// The core
md5 = function (message, options) {
// Convert to byte array
if (message.constructor == String)
if (options && options.encoding === 'binary')
message = bin.stringToBytes(message);
else
message = utf8.stringToBytes(message);
else if (isBuffer(message))
message = Array.prototype.slice.call(message, 0);
else if (!Array.isArray(message))
message = message.toString();
// else, assume byte array already
var m = crypt.bytesToWords(message),
l = message.length * 8,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
// Swap endian
for (var i = 0; i < m.length; i++) {
m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
}
// Padding
m[l >>> 5] |= 0x80 << (l % 32);
m[(((l + 64) >>> 9) << 4) + 14] = l;
// Method shortcuts
var FF = md5._ff,
GG = md5._gg,
HH = md5._hh,
II = md5._ii;
for (var i = 0; i < m.length; i += 16) {
var aa = a,
bb = b,
cc = c,
dd = d;
a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
c = FF(c, d, a, b, m[i+10], 17, -42063);
b = FF(b, c, d, a, m[i+11], 22, -1990404162);
a = FF(a, b, c, d, m[i+12], 7, 1804603682);
d = FF(d, a, b, c, m[i+13], 12, -40341101);
c = FF(c, d, a, b, m[i+14], 17, -1502002290);
b = FF(b, c, d, a, m[i+15], 22, 1236535329);
a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
c = GG(c, d, a, b, m[i+11], 14, 643717713);
b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
d = GG(d, a, b, c, m[i+10], 9, 38016083);
c = GG(c, d, a, b, m[i+15], 14, -660478335);
b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
d = GG(d, a, b, c, m[i+14], 9, -1019803690);
c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
a = GG(a, b, c, d, m[i+13], 5, -1444681467);
d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
b = GG(b, c, d, a, m[i+12], 20, -1926607734);
a = HH(a, b, c, d, m[i+ 5], 4, -378558);
d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
c = HH(c, d, a, b, m[i+11], 16, 1839030562);
b = HH(b, c, d, a, m[i+14], 23, -35309556);
a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
b = HH(b, c, d, a, m[i+10], 23, -1094730640);
a = HH(a, b, c, d, m[i+13], 4, 681279174);
d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
d = HH(d, a, b, c, m[i+12], 11, -421815835);
c = HH(c, d, a, b, m[i+15], 16, 530742520);
b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
a = II(a, b, c, d, m[i+ 0], 6, -198630844);
d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
c = II(c, d, a, b, m[i+14], 15, -1416354905);
b = II(b, c, d, a, m[i+ 5], 21, -57434055);
a = II(a, b, c, d, m[i+12], 6, 1700485571);
d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
c = II(c, d, a, b, m[i+10], 15, -1051523);
b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
d = II(d, a, b, c, m[i+15], 10, -30611744);
c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
b = II(b, c, d, a, m[i+13], 21, 1309151649);
a = II(a, b, c, d, m[i+ 4], 6, -145523070);
d = II(d, a, b, c, m[i+11], 10, -1120210379);
c = II(c, d, a, b, m[i+ 2], 15, 718787259);
b = II(b, c, d, a, m[i+ 9], 21, -343485551);
a = (a + aa) >>> 0;
b = (b + bb) >>> 0;
c = (c + cc) >>> 0;
d = (d + dd) >>> 0;
}
return crypt.endian([a, b, c, d]);
};
// Auxiliary functions
md5._ff = function (a, b, c, d, x, s, t) {
var n = a + (b & c | ~b & d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._gg = function (a, b, c, d, x, s, t) {
var n = a + (b & d | c & ~d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._hh = function (a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._ii = function (a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
// Package private blocksize
md5._blocksize = 16;
md5._digestsize = 16;
module.exports = function (message, options) {
if (message === undefined || message === null)
throw new Error('Illegal argument ' + message);
var digestbytes = crypt.wordsToBytes(md5(message, options));
return options && options.asBytes ? digestbytes :
options && options.asString ? bin.bytesToString(digestbytes) :
crypt.bytesToHex(digestbytes);
};
})();
(function(){
var crypt = __webpack_require__(267),
utf8 = __webpack_require__(268).utf8,
isBuffer = __webpack_require__(269),
bin = __webpack_require__(268).bin,
// The core
md5 = function (message, options) {
// Convert to byte array
if (message.constructor == String)
if (options && options.encoding === 'binary')
message = bin.stringToBytes(message);
else
message = utf8.stringToBytes(message);
else if (isBuffer(message))
message = Array.prototype.slice.call(message, 0);
else if (!Array.isArray(message))
message = message.toString();
// else, assume byte array already
var m = crypt.bytesToWords(message),
l = message.length * 8,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
// Swap endian
for (var i = 0; i < m.length; i++) {
m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
}
// Padding
m[l >>> 5] |= 0x80 << (l % 32);
m[(((l + 64) >>> 9) << 4) + 14] = l;
// Method shortcuts
var FF = md5._ff,
GG = md5._gg,
HH = md5._hh,
II = md5._ii;
for (var i = 0; i < m.length; i += 16) {
var aa = a,
bb = b,
cc = c,
dd = d;
a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
c = FF(c, d, a, b, m[i+10], 17, -42063);
b = FF(b, c, d, a, m[i+11], 22, -1990404162);
a = FF(a, b, c, d, m[i+12], 7, 1804603682);
d = FF(d, a, b, c, m[i+13], 12, -40341101);
c = FF(c, d, a, b, m[i+14], 17, -1502002290);
b = FF(b, c, d, a, m[i+15], 22, 1236535329);
a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
c = GG(c, d, a, b, m[i+11], 14, 643717713);
b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
d = GG(d, a, b, c, m[i+10], 9, 38016083);
c = GG(c, d, a, b, m[i+15], 14, -660478335);
b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
d = GG(d, a, b, c, m[i+14], 9, -1019803690);
c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
a = GG(a, b, c, d, m[i+13], 5, -1444681467);
d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
b = GG(b, c, d, a, m[i+12], 20, -1926607734);
a = HH(a, b, c, d, m[i+ 5], 4, -378558);
d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
c = HH(c, d, a, b, m[i+11], 16, 1839030562);
b = HH(b, c, d, a, m[i+14], 23, -35309556);
a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
b = HH(b, c, d, a, m[i+10], 23, -1094730640);
a = HH(a, b, c, d, m[i+13], 4, 681279174);
d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
d = HH(d, a, b, c, m[i+12], 11, -421815835);
c = HH(c, d, a, b, m[i+15], 16, 530742520);
b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
a = II(a, b, c, d, m[i+ 0], 6, -198630844);
d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
c = II(c, d, a, b, m[i+14], 15, -1416354905);
b = II(b, c, d, a, m[i+ 5], 21, -57434055);
a = II(a, b, c, d, m[i+12], 6, 1700485571);
d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
c = II(c, d, a, b, m[i+10], 15, -1051523);
b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
d = II(d, a, b, c, m[i+15], 10, -30611744);
c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
b = II(b, c, d, a, m[i+13], 21, 1309151649);
a = II(a, b, c, d, m[i+ 4], 6, -145523070);
d = II(d, a, b, c, m[i+11], 10, -1120210379);
c = II(c, d, a, b, m[i+ 2], 15, 718787259);
b = II(b, c, d, a, m[i+ 9], 21, -343485551);
a = (a + aa) >>> 0;
b = (b + bb) >>> 0;
c = (c + cc) >>> 0;
d = (d + dd) >>> 0;
}
return crypt.endian([a, b, c, d]);
};
// Auxiliary functions
md5._ff = function (a, b, c, d, x, s, t) {
var n = a + (b & c | ~b & d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._gg = function (a, b, c, d, x, s, t) {
var n = a + (b & d | c & ~d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._hh = function (a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._ii = function (a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
// Package private blocksize
md5._blocksize = 16;
md5._digestsize = 16;
module.exports = function (message, options) {
if (message === undefined || message === null)
throw new Error('Illegal argument ' + message);
var digestbytes = crypt.wordsToBytes(md5(message, options));
return options && options.asBytes ? digestbytes :
options && options.asString ? bin.bytesToString(digestbytes) :
crypt.bytesToHex(digestbytes);
};
})();
/***/ },
-14
View File
@@ -612,7 +612,6 @@ menuseparator {
}
.autocomplete .results * {
-moz-user-select: none;
user-select: none;
}
@@ -773,7 +772,6 @@ menuseparator {
}
.tree {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
@@ -820,7 +818,6 @@ html[dir="rtl"] .tree .node > div {
}
.sources-panel * {
-moz-user-select: none;
user-select: none;
}
@@ -834,7 +831,6 @@ html[dir="rtl"] .tree .node > div {
display: flex;
align-items: baseline;
justify-content: space-between;
-moz-user-select: none;
user-select: none;
}
@@ -916,7 +912,6 @@ html[dir="rtl"] .worker svg {
.tree {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
@@ -966,7 +961,6 @@ html[dir="rtl"] .worker svg {
right: 1px;
opacity: 1;
z-index: 100;
-moz-user-select: none;
user-select: none;
}
@@ -979,7 +973,6 @@ html[dir="rtl"] .source-footer .command-bar {
}
.source-footer .command-bar * {
-moz-user-select: none;
user-select: none;
}
@@ -1186,7 +1179,6 @@ html[dir="rtl"] .editor-mount {
background-color: var(--theme-tab-toolbar-background);
font-weight: lighter;
z-index: 100;
-moz-user-select: none;
user-select: none;
}
@@ -1213,7 +1205,6 @@ html[dir="rtl"] .editor-mount {
outline-width: 0;
}
.breakpoints-list * {
-moz-user-select: none;
user-select: none;
}
@@ -1396,7 +1387,6 @@ html .arrow.expanded svg {
*/
.frames ul li * {
-moz-user-select: none;
user-select: none;
}
@@ -1449,7 +1439,6 @@ html .arrow.expanded svg {
width: 100%;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
@@ -1475,7 +1464,6 @@ html .arrow.expanded svg {
}
.right-siderbar * {
-moz-user-select: none;
user-select: none;
}
@@ -1550,7 +1538,6 @@ html[dir="rtl"] .command-bar .stepOut {
font-style: italic;
text-align: center;
padding: 0.5em;
-moz-user-select: none;
user-select: none;
}
@@ -1572,7 +1559,6 @@ span.pause-exceptions.all {
}
.source-header * {
-moz-user-select: none;
user-select: none;
}
+1 -1
View File
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
:root{
-moz-user-select: none;
user-select: none;
}
#options-panel-container {
+9 -9
View File
@@ -46,8 +46,6 @@ loader.lazyRequireGetter(this, "InspectorFront",
"devtools/shared/fronts/inspector", true);
loader.lazyRequireGetter(this, "flags",
"devtools/shared/flags");
loader.lazyRequireGetter(this, "showDoorhanger",
"devtools/client/shared/doorhanger", true);
loader.lazyRequireGetter(this, "createPerformanceFront",
"devtools/shared/fronts/performance", true);
loader.lazyRequireGetter(this, "system",
@@ -2184,14 +2182,16 @@ Toolbox.prototype = {
.then(() => {
this._removeHostListeners();
// `location` may already be null if the toolbox document is already
// in process of destruction. Otherwise if it is still around, ensure
// releasing toolbox document and triggering cleanup thanks to unload
// event. We do that precisely here, before nullifying the target as
// various cleanup code depends on the target attribute to be still
// defined.
if (win.location) {
// `location` may already be invalid if the toolbox document is
// already in process of destruction. Otherwise if it is still
// around, ensure releasing toolbox document and triggering cleanup
// thanks to unload event. We do that precisely here, before
// nullifying the target as various cleanup code depends on the
// target attribute to be still defined.
try {
win.location.replace("about:blank");
} catch (e) {
// Do nothing.
}
// Targets need to be notified that the toolbox is being torn down.
@@ -20,7 +20,7 @@
padding: 5px;
transition: all 0.25s ease;
width: 100%;
-moz-user-select: none;
user-select: none;
}
.accordion ._header:hover {
-5
View File
@@ -37,8 +37,6 @@ const {AutocompletePopup} = require("devtools/client/shared/autocomplete-popup")
const HTML_NS = "http://www.w3.org/1999/xhtml";
const PREF_UA_STYLES = "devtools.inspector.showUserAgentStyles";
const PREF_DEFAULT_COLOR_UNIT = "devtools.defaultColorUnit";
const PREF_ENABLE_MDN_DOCS_TOOLTIP =
"devtools.inspector.mdnDocsTooltip.enabled";
const FILTER_CHANGED_TIMEOUT = 150;
// This is used to parse user input when filtering.
@@ -157,11 +155,8 @@ function CssRuleView(inspector, document, store, pageStyle) {
this._prefObserver.on(PREF_ORIG_SOURCES, this._onSourcePrefChanged);
this._prefObserver.on(PREF_UA_STYLES, this._handlePrefChange);
this._prefObserver.on(PREF_DEFAULT_COLOR_UNIT, this._handlePrefChange);
this._prefObserver.on(PREF_ENABLE_MDN_DOCS_TOOLTIP, this._handlePrefChange);
this.showUserAgentStyles = Services.prefs.getBoolPref(PREF_UA_STYLES);
this.enableMdnDocsTooltip =
Services.prefs.getBoolPref(PREF_ENABLE_MDN_DOCS_TOOLTIP);
// The popup will be attached to the toolbox document.
this.popup = new AutocompletePopup(inspector._toolbox.doc, {
@@ -85,9 +85,6 @@ support-files =
[browser_rules_content_01.js]
[browser_rules_content_02.js]
skip-if = e10s && debug # Bug 1250058 - Docshell leak on debug e10s
[browser_rules_context-menu-show-mdn-docs-01.js]
[browser_rules_context-menu-show-mdn-docs-02.js]
[browser_rules_context-menu-show-mdn-docs-03.js]
[browser_rules_copy_styles.js]
subsuite = clipboard
[browser_rules_cssom.js]
@@ -1,138 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the code that integrates the Style Inspector's rule view
* with the MDN docs tooltip.
*
* If you display the context click on a property name in the rule view, you
* should see a menu item "Show MDN Docs". If you click that item, the MDN
* docs tooltip should be shown, containing docs from MDN for that property.
*
* This file tests that the context menu item is shown when it should be
* shown and hidden when it should be hidden.
*/
"use strict";
/**
* The test document tries to confuse the context menu
* code by having a tag called "padding" and a property
* value called "margin".
*/
const { PrefObserver } = require("devtools/client/shared/prefs");
const PREF_ENABLE_MDN_DOCS_TOOLTIP =
"devtools.inspector.mdnDocsTooltip.enabled";
const TEST_URI = `
<html>
<head>
<style>
padding {font-family: margin;}
</style>
</head>
<body>
<padding>MDN tooltip testing</padding>
</body>
</html>
`;
add_task(function* () {
info("Ensure the pref is true to begin with");
let initial = Services.prefs.getBoolPref(PREF_ENABLE_MDN_DOCS_TOOLTIP);
if (initial != true) {
yield setBooleanPref(PREF_ENABLE_MDN_DOCS_TOOLTIP, true);
}
yield addTab("data:text/html;charset=utf8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("padding", inspector);
yield testMdnContextMenuItemVisibility(view);
info("Ensure the pref is reset to its initial value");
let eventual = Services.prefs.getBoolPref(PREF_ENABLE_MDN_DOCS_TOOLTIP);
if (eventual != initial) {
yield setBooleanPref(PREF_ENABLE_MDN_DOCS_TOOLTIP, initial);
}
});
/**
* Set a boolean pref, and wait for the pref observer to
* trigger, so that code listening for the pref change
* has had a chance to update itself.
*
* @param pref {string} Name of the pref to change
* @param state {boolean} Desired value of the pref.
*
* Note that if the pref already has the value in `state`,
* then the prefObserver will not trigger. So you should only
* call this function if you know the pref's current value is
* not `state`.
*/
function* setBooleanPref(pref, state) {
let oncePrefChanged = defer();
let prefObserver = new PrefObserver("devtools.");
prefObserver.on(pref, oncePrefChanged.resolve);
info("Set the pref " + pref + " to: " + state);
Services.prefs.setBoolPref(pref, state);
info("Wait for prefObserver to call back so the UI can update");
yield oncePrefChanged.promise;
prefObserver.off(pref, oncePrefChanged.resolve);
}
/**
* Tests that the MDN context menu item is shown when it should be,
* and hidden when it should be.
* - iterate through every node in the rule view
* - set that node as popupNode (the node that the context menu
* is shown for)
* - update the context menu's state
* - test that the MDN context menu item is hidden, or not,
* depending on popupNode
*/
function* testMdnContextMenuItemVisibility(view) {
info("Test that MDN context menu item is shown only when it should be.");
let root = rootElement(view);
for (let node of iterateNodes(root)) {
info("Setting " + node + " as popupNode");
info("Creating context menu with " + node + " as popupNode");
let allMenuItems = openStyleContextMenuAndGetAllItems(view, node);
let menuitemShowMdnDocs = allMenuItems.find(item => item.label ===
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"));
let isVisible = menuitemShowMdnDocs.visible;
let shouldBeVisible = isPropertyNameNode(node);
let message = shouldBeVisible ? "shown" : "hidden";
is(isVisible, shouldBeVisible,
"The MDN context menu item is " + message + " ; content : " +
node.textContent + " ; type : " + node.nodeType);
}
}
/**
* Check if a node is a property name.
*/
function isPropertyNameNode(node) {
return node.textContent === "font-family";
}
/**
* A generator that iterates recursively through all child nodes of baseNode.
*/
function* iterateNodes(baseNode) {
yield baseNode;
for (let child of baseNode.childNodes) {
yield* iterateNodes(child);
}
}
/**
* Returns the root element for the rule view.
*/
var rootElement = view => (view.element) ? view.element : view.styleDocument;
@@ -1,60 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the code that integrates the Style Inspector's rule view
* with the MDN docs tooltip.
*
* If you display the context click on a property name in the rule view, you
* should see a menu item "Show MDN Docs". If you click that item, the MDN
* docs tooltip should be shown, containing docs from MDN for that property.
*
* This file tests that:
* - clicking the context menu item shows the tooltip
* - the tooltip content matches the property name for which the context menu was opened
*/
"use strict";
const {setBaseCssDocsUrl} =
require("devtools/client/shared/widgets/MdnDocsWidget");
const PROPERTYNAME = "color";
const TEST_DOC = `
<html>
<body>
<div style="color: red">
Test "Show MDN Docs" context menu option
</div>
</body>
</html>
`;
add_task(function* () {
yield addTab("data:text/html;charset=utf8," + encodeURIComponent(TEST_DOC));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
setBaseCssDocsUrl(URL_ROOT);
info("Setting the popupNode for the MDN docs tooltip");
let {nameSpan} = getRuleViewProperty(view, "element", PROPERTYNAME);
let allMenuItems = openStyleContextMenuAndGetAllItems(view, nameSpan.firstChild);
let menuitemShowMdnDocs = allMenuItems.find(item => item.label ===
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"));
let cssDocs = view.tooltips.cssDocs;
info("Showing the MDN docs tooltip");
let onShown = cssDocs.tooltip.once("shown");
menuitemShowMdnDocs.click();
yield onShown;
ok(true, "The MDN docs tooltip was shown");
info("Quick check that the tooltip contents are set");
let h1 = cssDocs.tooltip.container.querySelector(".mdn-property-name");
is(h1.textContent, PROPERTYNAME, "The MDN docs tooltip h1 is correct");
});
@@ -1,117 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the "devtools.inspector.mdnDocsTooltip.enabled" preference,
* that we use to enable/disable the MDN tooltip in the Inspector.
*
* The desired behavior is:
* - if the preference is true, show the "Show MDN Docs" context menu item
* - if the preference is false, don't show the item
* - listen for changes to the pref, so we can show/hide the item dynamically
*/
"use strict";
const { PrefObserver } = require("devtools/client/styleeditor/utils");
const PREF_ENABLE_MDN_DOCS_TOOLTIP =
"devtools.inspector.mdnDocsTooltip.enabled";
const PROPERTY_NAME_CLASS = "ruleview-propertyname";
const TEST_DOC = `
<html>
<body>
<div style="color: red">
Test the pref to enable/disable the "Show MDN Docs" context menu option
</div>
</body>
</html>
`;
add_task(function* () {
info("Ensure the pref is true to begin with");
let initial = Services.prefs.getBoolPref(PREF_ENABLE_MDN_DOCS_TOOLTIP);
if (initial != true) {
yield setBooleanPref(PREF_ENABLE_MDN_DOCS_TOOLTIP, true);
}
yield addTab("data:text/html;charset=utf8," + encodeURIComponent(TEST_DOC));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);
yield testMdnContextMenuItemVisibility(view, true);
yield setBooleanPref(PREF_ENABLE_MDN_DOCS_TOOLTIP, false);
yield testMdnContextMenuItemVisibility(view, false);
info("Close the Inspector");
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
({inspector, view} = yield openRuleView());
yield selectNode("div", inspector);
yield testMdnContextMenuItemVisibility(view, false);
yield setBooleanPref(PREF_ENABLE_MDN_DOCS_TOOLTIP, true);
yield testMdnContextMenuItemVisibility(view, true);
info("Ensure the pref is reset to its initial value");
let eventual = Services.prefs.getBoolPref(PREF_ENABLE_MDN_DOCS_TOOLTIP);
if (eventual != initial) {
yield setBooleanPref(PREF_ENABLE_MDN_DOCS_TOOLTIP, initial);
}
});
/**
* Set a boolean pref, and wait for the pref observer to
* trigger, so that code listening for the pref change
* has had a chance to update itself.
*
* @param pref {string} Name of the pref to change
* @param state {boolean} Desired value of the pref.
*
* Note that if the pref already has the value in `state`,
* then the prefObserver will not trigger. So you should only
* call this function if you know the pref's current value is
* not `state`.
*/
function* setBooleanPref(pref, state) {
let oncePrefChanged = defer();
let prefObserver = new PrefObserver("devtools.");
prefObserver.on(pref, oncePrefChanged.resolve);
info("Set the pref " + pref + " to: " + state);
Services.prefs.setBoolPref(pref, state);
info("Wait for prefObserver to call back so the UI can update");
yield oncePrefChanged.promise;
prefObserver.off(pref, oncePrefChanged.resolve);
}
/**
* Test whether the MDN tooltip context menu item is visible when it should be.
*
* @param view The rule view
* @param shouldBeVisible {boolean} Whether we expect the context
* menu item to be visible or not.
*/
function* testMdnContextMenuItemVisibility(view, shouldBeVisible) {
let message = shouldBeVisible ? "shown" : "hidden";
info("Test that MDN context menu item is " + message);
info("Set a CSS property name as popupNode");
let root = rootElement(view);
let node = root.querySelector("." + PROPERTY_NAME_CLASS).firstChild;
let allMenuItems = openStyleContextMenuAndGetAllItems(view, node);
let menuitemShowMdnDocs = allMenuItems.find(item => item.label ===
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"));
let isVisible = menuitemShowMdnDocs.visible;
is(isVisible, shouldBeVisible,
"The MDN context menu item is " + message);
}
/**
* Returns the root element for the rule view.
*/
var rootElement = view => (view.element) ? view.element : view.styleDocument;
@@ -25,9 +25,6 @@ const STYLE_INSPECTOR_PROPERTIES = "devtools/shared/locales/styleinspector.prope
const {LocalizationHelper} = require("devtools/shared/l10n");
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
const PREF_ENABLE_MDN_DOCS_TOOLTIP =
"devtools.inspector.mdnDocsTooltip.enabled";
/**
* Style inspector context menu
*
@@ -56,7 +53,6 @@ function StyleInspectorMenu(view, options) {
this._onCopySelector = this._onCopySelector.bind(this);
this._onCopyUrl = this._onCopyUrl.bind(this);
this._onSelectAll = this._onSelectAll.bind(this);
this._onShowMdnDocs = this._onShowMdnDocs.bind(this);
this._onToggleOrigSources = this._onToggleOrigSources.bind(this);
}
@@ -229,19 +225,6 @@ StyleInspectorMenu.prototype = {
});
menu.append(menuitemAddRule);
// Show MDN Docs
let mdnDocsAccessKey = "styleinspector.contextmenu.showMdnDocs.accessKey";
let menuitemShowMdnDocs = new MenuItem({
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"),
accesskey: STYLE_INSPECTOR_L10N.getStr(mdnDocsAccessKey),
click: () => {
this._onShowMdnDocs();
},
visible: (Services.prefs.getBoolPref(PREF_ENABLE_MDN_DOCS_TOOLTIP) &&
this._isPropertyName()),
});
menu.append(menuitemShowMdnDocs);
// Show Original Sources
let sourcesAccessKey = "styleinspector.contextmenu.toggleOrigSources.accessKey";
let menuitemSources = new MenuItem({
@@ -407,16 +390,6 @@ StyleInspectorMenu.prototype = {
clipboardHelper.copyString(message);
}),
/**
* Show docs from MDN for a CSS property.
*/
_onShowMdnDocs: function () {
let cssPropertyName = this.styleDocument.popupNode.textContent;
let anchor = this.styleDocument.popupNode.parentNode;
let cssDocsTooltip = this.view.tooltips.cssDocs;
cssDocsTooltip.show(anchor, cssPropertyName);
},
/**
* Add a new rule to the current element.
*/
@@ -18,7 +18,6 @@ const {
} = require("devtools/client/inspector/shared/node-types");
const { getColor } = require("devtools/client/shared/theme");
const { getCssProperties } = require("devtools/shared/fronts/css-properties");
const CssDocsTooltip = require("devtools/client/shared/widgets/tooltip/CssDocsTooltip");
const { HTMLTooltip } = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
const {
getImageDimensions,
@@ -82,9 +81,6 @@ TooltipsOverlay.prototype = {
this.previewTooltip.startTogglingOnHover(this.view.element,
this._onPreviewTooltipTargetHover.bind(this));
// MDN CSS help tooltip
this.cssDocs = new CssDocsTooltip(toolbox.doc);
if (this.isRuleView) {
// Color picker tooltip
this.colorPicker = new SwatchColorPickerTooltip(toolbox.doc,
@@ -120,10 +116,6 @@ TooltipsOverlay.prototype = {
this.cubicBezier.destroy();
}
if (this.cssDocs) {
this.cssDocs.destroy();
}
if (this.filterEditor) {
this.filterEditor.destroy();
}
@@ -151,7 +143,7 @@ TooltipsOverlay.prototype = {
// Font preview tooltip
if (type === VIEW_NODE_VALUE_TYPE && prop.property === "font-family") {
let value = prop.value.toLowerCase();
if (value !== "inherit" && value !== "unset" && value !== "initial") {
if (value !== "inherit" && value !== "unset" && value !== "initial" && value !== "revert") {
tooltipType = TOOLTIP_FONTFAMILY_TYPE;
}
}
@@ -191,10 +183,6 @@ TooltipsOverlay.prototype = {
this.cubicBezier.hide();
}
if (this.isRuleView && this.cssDocs.tooltip.isVisible()) {
this.cssDocs.hide();
}
if (this.isRuleView && this.filterEditor.tooltip.isVisible()) {
this.filterEditor.revert();
this.filterEdtior.hide();
@@ -295,10 +283,6 @@ TooltipsOverlay.prototype = {
this.cubicBezier.hide();
}
if (this.cssDocs) {
this.cssDocs.hide();
}
if (this.filterEditor) {
this.filterEditor.hide();
}
-1
View File
@@ -117,7 +117,6 @@ devtools.jar:
content/framework/connect/connect.js (framework/connect/connect.js)
content/shared/widgets/graphs-frame.xhtml (shared/widgets/graphs-frame.xhtml)
content/shared/widgets/cubic-bezier.css (shared/widgets/cubic-bezier.css)
content/shared/widgets/mdn-docs.css (shared/widgets/mdn-docs.css)
content/shared/widgets/filter-widget.css (shared/widgets/filter-widget.css)
content/shared/widgets/spectrum.css (shared/widgets/spectrum.css)
content/aboutdebugging/aboutdebugging.xhtml (aboutdebugging/aboutdebugging.xhtml)
@@ -29,7 +29,7 @@
padding-top: 8px;
padding-bottom: 4px;
font-weight: bold;
-moz-user-select: none;
user-select: none;
}
.headersPanelBox .netInfoParamValue {
+1 -1
View File
@@ -22,7 +22,7 @@
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-moz-user-select: none;
user-select: none;
padding: 0 2px;
border-radius: 2px;
}
@@ -48,14 +48,6 @@ eyedropper.disabled.title=Unavailable in non-HTML documents
#LOCALIZATION NOTE: Used in the image preview tooltip when the image could not be loaded
eventsTooltip.openInDebugger=Open in Debugger
# LOCALIZATION NOTE (docsTooltip.visitMDN): Shown in the tooltip that displays
# help from MDN. This is a link to the complete MDN documentation page.
docsTooltip.visitMDN=Visit MDN page
# LOCALIZATION NOTE (docsTooltip.visitMDN): Shown in the docs tooltip when the MDN page
# could not be loaded (for example, because of a connectivity problem).
docsTooltip.loadDocsError=Could not load docs page.
# LOCALIZATION NOTE (inspector.collapsePane): This is the tooltip for the button
# that collapses the right panel (rules, computed, box-model, etc...) in the
# inspector UI.
@@ -130,7 +130,6 @@ marker.gcreason.label.DOM_WORKER=Periodic Worker GC
marker.gcreason.label.INTER_SLICE_GC=Periodic Incremental GC Slice
marker.gcreason.label.FULL_GC_TIMER=Periodic Full GC
marker.gcreason.label.SHUTDOWN_CC=Shutdown
marker.gcreason.label.FINISH_LARGE_EVALUATE=Large Eval
marker.gcreason.label.DOM_WINDOW_UTILS=User Inactive
marker.gcreason.label.USER_INACTIVE=User Inactive
@@ -169,6 +168,5 @@ marker.gcreason.description.DOM_WORKER=The worker was idle for a relatively long
marker.gcreason.description.INTER_SLICE_GC=There has been a relatively long time since the last incremental GC slice.
marker.gcreason.description.FULL_GC_TIMER=JavaScript returned to the event loop, and it has been a relatively long time since we performed a garbage collection.
marker.gcreason.description.SHUTDOWN_CC=The browser destroyed a JavaScript runtime or context, and this was the final garbage collection before shutting down.
marker.gcreason.description.FINISH_LARGE_EVALUATE=The browser finished evaluating a large script, and performed a GC because the script will never be run again.
marker.gcreason.description.DOM_WINDOW_UTILS=The user was inactive for a long time. Took the opportunity to perform GC when it was unlikely to be noticed.
marker.gcreason.description.USER_INACTIVE=The user was inactive for a long time. The browser took the opportunity to perform GC when it was unlikely to be noticed.
-2
View File
@@ -47,8 +47,6 @@ pref("devtools.inspector.imagePreviewTooltipSize", 300);
pref("devtools.inspector.showUserAgentStyles", false);
// Show all native anonymous content (like controls in <video> tags)
pref("devtools.inspector.showAllAnonymousContent", false);
// Enable the MDN docs tooltip
pref("devtools.inspector.mdnDocsTooltip.enabled", false);
// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);
+4 -4
View File
@@ -140,7 +140,7 @@ select > option.divider {
margin: 0 0 15px 0;
padding: 4px 5px;
display: inline-flex;
-moz-user-select: none;
user-select: none;
}
#global-toolbar > .title {
@@ -196,7 +196,7 @@ select > option.divider {
#global-dpr-selector {
margin: 0 8px;
-moz-user-select: none;
user-select: none;
color: var(--viewport-color);
font-size: 11px;
height: 15px;
@@ -295,7 +295,7 @@ select > option.divider {
.browser {
display: block;
border: 0;
-moz-user-select: none;
user-select: none;
}
.browser:-moz-focusring {
@@ -383,7 +383,7 @@ select > option.divider {
}
.viewport-dimension-separator {
-moz-user-select: none;
user-select: none;
}
/**
@@ -8,7 +8,6 @@ const Cu = Components.utils;
var {loader, require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Telemetry = require("devtools/client/shared/telemetry");
var {showDoorhanger} = require("devtools/client/shared/doorhanger");
var {TouchEventSimulator} = require("devtools/shared/touch/simulator");
var {Task} = require("devtools/shared/task");
var promise = require("promise");
+3
View File
@@ -209,6 +209,9 @@ SplitView.prototype = {
this._nav.appendChild(aSummary);
aSummary.addEventListener("click", (aEvent) => {
if (aEvent.button != 0) {
return;
}
aEvent.stopPropagation();
this.activeSummary = aSummary;
}, false);
@@ -97,6 +97,9 @@ AutocompletePopup.prototype = {
},
onClick: function (e) {
if (e.button != 0) {
return;
}
let item = e.target.closest(".autocomplete-item");
if (item && typeof item.dataset.index !== "undefined") {
this.selectedIndex = parseInt(item.dataset.index, 10);
@@ -85,7 +85,7 @@
.treeTable .treeHeaderCell {
cursor: pointer;
-moz-user-select: none;
user-select: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
padding: 0 !important;
background: linear-gradient(
+2 -1
View File
@@ -9,7 +9,8 @@ const {CSS_ANGLEUNIT} = require("devtools/shared/css/properties-db");
const SPECIALVALUES = new Set([
"initial",
"inherit",
"unset"
"unset",
"revert"
]);
const {getCSSLexer} = require("devtools/shared/css/lexer");
+65 -62
View File
@@ -8,7 +8,7 @@
* Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2009 Mozilla Foundation. All rights reserved.
* Copyright (C) 2022, 2023 Moonchild Productions. All rights reserved.
* Copyright (C) 2022, 2023, 2025 Moonchild Productions. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -60,17 +60,11 @@ const Curl = {
generateCommand: function (data) {
const utils = CurlUtils;
let command = ["curl"];
let commandParts = [];
// Make sure to use the following helpers to sanitize arguments before execution.
const addParam = value => {
const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
command.push(safe);
};
const addPostData = value => {
const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
postData.push(safe);
const escapeStringifNeeded = value => {
return /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
};
let ignoredHeaders = new Set();
@@ -81,7 +75,13 @@ const Curl = {
utils.escapeStringWin : utils.escapeStringPosix;
// Add URL.
addParam(data.url);
commandParts.push(data.url);
// Disable globbing if the URL contains brackets.
// cURL also globs braces but they are already percent-encoded.
if (data.url.includes("[") || data.url.includes("]")) {
commandParts.push("--globoff");
}
let postDataText = null;
let multipartRequest = utils.isMultipartRequest(data);
@@ -91,15 +91,16 @@ const Curl = {
if (utils.isUrlEncodedRequest(data) ||
["PUT", "POST", "PATCH"].includes(data.method)) {
postDataText = data.postDataText;
addPostData("--data-raw");
addPostData(utils.writePostDataTextParams(postDataText));
postData.push("--data-raw");
let text =utils.writePostDataTextParams(postDataText);
postData.push(escapeStringifNeeded(text));
ignoredHeaders.add("content-length");
} else if (multipartRequest) {
postDataText = data.postDataText;
addPostData("--data-binary");
postData.push("--data-binary");
let boundary = utils.getMultipartBoundary(data);
let text = utils.removeBinaryDataFromMultipartText(postDataText, boundary);
addPostData(text);
postData.push(escapeStringifNeeded(text));
ignoredHeaders.add("content-length");
}
@@ -107,15 +108,15 @@ const Curl = {
// For GET and POST requests this is not necessary as GET is the
// default. If --data or --binary is added POST is the default.
if (!(data.method == "GET" || data.method == "POST")) {
addParam("-X");
addParam(data.method);
commandParts.push("-X");
commandParts.push(data.method);
}
// Add -I (HEAD)
// For servers that supports HEAD.
// This will fetch the header of a document only.
if (data.method == "HEAD") {
addParam("-I");
commandParts.push("-I");
}
// Add http version.
@@ -126,7 +127,7 @@ const Curl = {
// data.httpVersion are HTTP/1.0, HTTP/1.1 and HTTP/2.0
// So in case of HTTP/2.0 (which should ideally be HTTP/2) we are using
// only major version, and full version in other cases
addParam("--http" + (version == "2.0" ? version.split(".")[0] : version));
commandParts.push("--http" + (version == "2.0" ? version.split(".")[0] : version));
}
// Add request headers.
@@ -145,14 +146,26 @@ const Curl = {
if (ignoredHeaders.has(header.name.toLowerCase())) {
continue;
}
addParam("-H");
addParam(header.name + ": " + header.value);
commandParts.push("-H");
let text = header.name + ": " + header.value;
commandParts.push(escapeStringifNeeded(text));
}
// Add post data.
command = command.concat(postData);
commandParts = commandParts.concat(postData);
return command.join(" ");
// Format with line breaks if the command has more than 2 parts
// e.g
// Command with 2 parts - curl https://foo.com
// Commands with more than 2 parts -
// curl https://foo.com
// -X POST
// -H "Accept : */*"
// -H "accept-language: en-US"
const joinStr = Services.appinfo.OS == "WINNT" ? " ^\n " : " \\\n ";
return (
"curl " + commandParts.join(commandParts.length >= 3 ? joinStr : " ")
);
}
};
@@ -400,53 +413,43 @@ const CurlUtils = {
* Escape util function for Windows systems.
*/
escapeStringWin: function (str) {
/*
Because the cmd.exe parser and the MS Crt arguments parsers use some
of the same escape characters, they can interact with each other in
terrible ways, meaning the order of operations is critical here.
1. Replace \ with \\ first, because it is an escape character for
certain conditions in both parsers.
2. Replace double quote chars with two double quotes (not by escaping
with \") because it is recognized by both the cmd.exe and MS Crt
arguments parsers.
3. Escape ` and $ so commands do not get executed, e.g $(calc.exe) or
`\$(calc.exe)
4. Escape all characters we are not sure about with ^, to ensure it
gets to the MS Crt arguments parser safely.
5. The % character is special because the MS Crt arguments parser will
try and look for environment variables and fill them in, in-place. We
cannot escape them with % and cannot escape them with ^ (because it's
cmd.exe's escape, not the MS Crt arguments parser). So, we can get the
cmd.exe parser to escape the character after it, if it is followed by
a valid starting character of an environment variable.
This ensures we do not try and double-escape another ^ if it was placed
by the previous replace.
6. We replace \r and \r\n with \n; this allows us to consistently
escape all new lines in the next replace.
7. Lastly, we replace new lines with ^ and TWO new lines, because the
first new line is there to enact the escape command, and the second is
the character to escape (in this case new line).
The extra " enables escaping new lines with ^ within quotes in cmd.exe.
*/
const encapsChars = '"';
return (
encapsChars +
str
// Replace \ with \\ first because it is an escape character for certain
// conditions in both parsers.
.replace(/\\/g, "\\\\")
// Replace double quote chars with two double quotes (not by escaping with \")
// because it is recognized by both cmd.exe and MS CRT arguments parser.
.replace(/"/g, '""')
// Escape ` and $ so commands do not get executed e.g $(calc.exe) or `\$(calc.exe)
.replace(/[`$]/g, "\\$&")
.replace(/[^a-zA-Z0-9\s_\-:=+~\/.',?;()*\$&\\{}\"`]/g, "^$&")
// Then escape all characters we are not sure about with ^ to ensure it
// gets to the MS CRT parser safely.
// Note: Do not escape unicode control non-printable characters (0000-001f + 007f-009f)
.replace(/[^a-zA-Z0-9\s_\-:=+~\/.',?;()*\$&\\{}\"`\u0000-\u001f\u007f-\u009f]/g, "^$&")
// The % character is special because MS CRT parser will try and look for
// ENV variables and fill them in its place. We cannot escape them with %
// and cannot escape them with ^ (because it's cmd.exe's escape not MS CRT
// parser); So we can get cmd.exe parser to escape the character after it,
// if it is followed by a valid beginning character of an ENV variable.
// This ensures we do not try and double escape another ^ if it was placed
// by the previous replace.
.replace(/%(?=[a-zA-Z0-9_])/g, "%^")
.replace(/\r\n?/g, "\n")
.replace(/\n/g, '"^\r\n\r\n"')
+ encapsChars);
// All other whitespace characters are replaced with a single space, as there
// is no way to enter their literal values in a command line, and they do break
// the command sequence, allowing for injection.
// Since want to keep line breaks, we need to exclude them in the regex (`[^\r\n]`),
// and use double negations to get the other whitespace chars (`[^\S]` translates
// to "not not whitespace")
.replace(/[^\S\r\n]/g, " ")
// Lastly we replace new lines with ^ and TWO new lines because the first
// new line is there to enact the escape command the second is the character
// to escape (in this case new line).
.replace(/\r?\n|\r/g, "^\n\n")
+ encapsChars
);
}
};
-137
View File
@@ -1,137 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Ci, Cc } = require("chrome");
const Services = require("Services");
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
const { Task } = require("devtools/shared/task");
const defer = require("devtools/shared/defer");
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const LOCALE = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry)
.getSelectedLocale("global");
var TYPES = {
// We don't support any doorhanger types at the moment.
// This is vestigial from the FF dev edition promo.
};
var panelAttrs = {
orient: "vertical",
hidden: "false",
consumeoutsideclicks: "true",
noautofocus: "true",
align: "start",
role: "alert"
};
/**
* Helper to call a doorhanger, defined in `TYPES`, with defined conditions,
* success handlers and loads its own XUL in a frame. Takes an object with
* several properties:
*
* @param {XULWindow} window
* The window that should house the doorhanger.
* @param {String} type
* The type of doorhanger to be displayed is, using the `TYPES`
* definition.
* @param {String} selector
* The selector that the doorhanger should be appended to within
* `window`. Defaults to a XUL Document's `window` element.
*/
exports.showDoorhanger = Task.async(function* ({ window, type, anchor }) {
let { predicate, success, url, action } = TYPES[type];
// Abort if predicate fails
if (!predicate()) {
return;
}
// Call success function to set preferences/cleanup immediately,
// so if triggered multiple times, only happens once (Windows/Linux)
success();
// Wait 200ms to prevent flickering where the popup is displayed
// before the underlying window (Windows 7, 64bit)
yield wait(200);
let document = window.document;
let panel = document.createElementNS(XULNS, "panel");
let frame = document.createElementNS(XULNS, "iframe");
let parentEl = document.querySelector("window");
frame.setAttribute("src", url);
let close = () => parentEl.removeChild(panel);
setDoorhangerStyle(panel, frame);
panel.appendChild(frame);
parentEl.appendChild(panel);
yield onFrameLoad(frame);
panel.openPopup(anchor);
let closeBtn = frame.contentDocument.querySelector("#close");
if (closeBtn) {
closeBtn.addEventListener("click", close);
}
let goBtn = frame.contentDocument.querySelector("#go");
if (goBtn) {
goBtn.addEventListener("click", () => {
if (action) {
action();
}
close();
});
}
});
function setDoorhangerStyle(panel, frame) {
Object.keys(panelAttrs).forEach(prop => {
return panel.setAttribute(prop, panelAttrs[prop]);
});
panel.style.margin = "20px";
panel.style.borderRadius = "5px";
panel.style.border = "none";
panel.style.MozAppearance = "none";
panel.style.backgroundColor = "transparent";
frame.style.borderRadius = "5px";
frame.setAttribute("flex", "1");
frame.setAttribute("width", "450");
frame.setAttribute("height", "179");
}
function onFrameLoad(frame) {
let { resolve, promise } = defer();
if (frame.contentWindow) {
let domHelper = new DOMHelpers(frame.contentWindow);
domHelper.onceDOMReady(resolve);
} else {
let callback = () => {
frame.removeEventListener("DOMContentLoaded", callback);
resolve();
};
frame.addEventListener("DOMContentLoaded", callback);
}
return promise;
}
function getGBrowser() {
return getMostRecentBrowserWindow().gBrowser;
}
function wait(n) {
let { resolve, promise } = defer();
setTimeout(resolve, n);
return promise;
}
-1
View File
@@ -26,7 +26,6 @@ DevToolsModules(
'devices.js',
'devtools-file-watcher.js',
'DOMHelpers.jsm',
'doorhanger.js',
'file-watcher-worker.js',
'file-watcher.js',
'getjson.js',
-8
View File
@@ -13,11 +13,6 @@ support-files =
helper_color_data.js
helper_html_tooltip.js
helper_inplace_editor.js
html-mdn-css-basic-testing.html
html-mdn-css-no-summary.html
html-mdn-css-no-summary-or-syntax.html
html-mdn-css-no-syntax.html
html-mdn-css-syntax-old-style.html
leakhunt.js
test-actor.js
test-actor-registry.js
@@ -140,9 +135,6 @@ skip-if = e10s # Bug 1221911, bug 1222289, frequent e10s timeouts
skip-if = e10s # Layouthelpers test should not run in a content page.
[browser_layoutHelpers-getBoxQuads.js]
skip-if = e10s # Layouthelpers test should not run in a content page.
[browser_mdn-docs-01.js]
[browser_mdn-docs-02.js]
[browser_mdn-docs-03.js]
[browser_num-l10n.js]
[browser_options-view-01.js]
[browser_outputparser.js]
@@ -1,167 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the MdnDocsWidget object, and specifically its
* loadCssDocs() function.
*
* The MdnDocsWidget is initialized with a document which has a specific
* structure. You then call loadCssDocs(), passing in a CSS property name.
* MdnDocsWidget then fetches docs for that property by making an XHR to
* a docs page, and loads the results into the document. While the XHR is
* still not resolved the document is put into an "initializing" state in
* which the devtools throbber is displayed.
*
* In this file we test:
* - the initial state of the document before the docs have loaded
* - the state of the document after the docs have loaded
*/
"use strict";
const {setBaseCssDocsUrl, MdnDocsWidget} = require("devtools/client/shared/widgets/MdnDocsWidget");
/**
* Test properties
*
* In the real tooltip, a CSS property name is used to look up an MDN page
* for that property.
* In the test code, the names defined here is used to look up a page
* served by the test server.
*/
const BASIC_TESTING_PROPERTY = "html-mdn-css-basic-testing.html";
const BASIC_EXPECTED_SUMMARY = "A summary of the property.";
const BASIC_EXPECTED_SYNTAX = [{type: "comment", text: "/* The part we want */"},
{type: "text", text: "\n"},
{type: "property-name", text: "this"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "is-the-part-we-want"},
{type: "text", text: ";"}];
const URI_PARAMS =
"?utm_source=mozilla&utm_medium=firefox-inspector&utm_campaign=default";
add_task(function* () {
setBaseCssDocsUrl(TEST_URI_ROOT);
yield addTab("about:blank");
let [host, win] = yield createHost("bottom", "data:text/html," +
"<div class='mdn-container'></div>");
let widget = new MdnDocsWidget(win.document.querySelector("div"));
yield testTheBasics(widget);
host.destroy();
gBrowser.removeCurrentTab();
});
/**
* Test all the basics
* - initial content, before docs have loaded, is as expected
* - throbber is set before docs have loaded
* - contents are as expected after docs have loaded
* - throbber is gone after docs have loaded
* - mdn link text is correct and onclick behavior is correct
*/
function* testTheBasics(widget) {
info("Test all the basic functionality in the widget");
info("Get the widget state before docs have loaded");
let promise = widget.loadCssDocs(BASIC_TESTING_PROPERTY);
info("Check initial contents before docs have loaded");
checkTooltipContents(widget.elements, {
propertyName: BASIC_TESTING_PROPERTY,
summary: "",
syntax: ""
});
// throbber is set
ok(widget.elements.info.classList.contains("devtools-throbber"),
"Throbber is set");
info("Now let the widget finish loading");
yield promise;
info("Check contents after docs have loaded");
checkTooltipContents(widget.elements, {
propertyName: BASIC_TESTING_PROPERTY,
summary: BASIC_EXPECTED_SUMMARY,
syntax: BASIC_EXPECTED_SYNTAX
});
// throbber is gone
ok(!widget.elements.info.classList.contains("devtools-throbber"),
"Throbber is not set");
info("Check that MDN link text is correct and onclick behavior is correct");
let mdnLink = widget.elements.linkToMdn;
let expectedHref = TEST_URI_ROOT + BASIC_TESTING_PROPERTY + URI_PARAMS;
is(mdnLink.href, expectedHref, "MDN link href is correct");
let uri = yield checkLinkClick(mdnLink);
is(uri, expectedHref, "New tab opened with the expected URI");
}
/**
* Clicking the "Visit MDN Page" in the tooltip panel
* should open a new browser tab with the page loaded.
*
* To test this we'll listen for a new tab opening, and
* when it does, add a listener to that new tab to tell
* us when it has loaded.
*
* Then we click the link.
*
* In the tab's load listener, we'll resolve the promise
* with the URI, which is expected to match the href
* in the orginal link.
*
* One complexity is that when you open a new tab,
* "about:blank" is first loaded into the tab before the
* actual page. So we ignore that first load event, and keep
* listening until "load" is triggered for a different URI.
*/
function checkLinkClick(link) {
function loadListener(tab) {
let browser = getBrowser().getBrowserForTab(tab);
let uri = browser.currentURI.spec;
info("New browser tab has loaded");
gBrowser.removeTab(tab);
info("Resolve promise with new tab URI");
deferred.resolve(uri);
}
function newTabListener(e) {
gBrowser.tabContainer.removeEventListener("TabOpen", newTabListener);
let tab = e.target;
BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url => url != "about:blank")
.then(url => loadListener(tab));
}
let deferred = defer();
info("Check that clicking the link opens a new tab with the correct URI");
gBrowser.tabContainer.addEventListener("TabOpen", newTabListener, false);
info("Click the link to MDN");
link.click();
return deferred.promise;
}
/**
* Utility function to check content of the tooltip.
*/
function checkTooltipContents(doc, expected) {
is(doc.heading.textContent,
expected.propertyName,
"Property name is correct");
is(doc.summary.textContent,
expected.summary,
"Summary is correct");
checkCssSyntaxHighlighterOutput(expected.syntax, doc.syntax);
}
@@ -1,127 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the MdnDocsWidget object, and specifically its
* loadCssDocs() function.
*
* The MdnDocsWidget is initialized with a document which has a specific
* structure. You then call loadCssDocs(), passing in a CSS property name.
* MdnDocsWidget then fetches docs for that property by making an XHR to
* a docs page, and loads the results into the document.
*
* In this file we test that the tooltip can properly handle the different
* structures that the docs page might have, including variant structures and
* error conditions like parts of the document being missing.
*
* We also test that the tooltip properly handles the case where the page
* doesn't exist at all.
*/
"use strict";
const {
setBaseCssDocsUrl,
MdnDocsWidget
} = require("devtools/client/shared/widgets/MdnDocsWidget");
const BASIC_EXPECTED_SUMMARY = "A summary of the property.";
const BASIC_EXPECTED_SYNTAX = [{type: "comment", text: "/* The part we want */"},
{type: "text", text: "\n"},
{type: "property-name", text: "this"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "is-the-part-we-want"},
{type: "text", text: ";"}];
const ERROR_MESSAGE = "Could not load docs page.";
/**
* Test properties
*
* In the real tooltip, a CSS property name is used to look up an MDN page
* for that property.
* In the test code, the names defined here are used to look up a page
* served by the test server. We have different properties to test
* different ways that the docs pages might be constructed, including errors
* like pages that don't include docs where we expect.
*/
const SYNTAX_OLD_STYLE = "html-mdn-css-syntax-old-style.html";
const NO_SUMMARY = "html-mdn-css-no-summary.html";
const NO_SYNTAX = "html-mdn-css-no-syntax.html";
const NO_SUMMARY_OR_SYNTAX = "html-mdn-css-no-summary-or-syntax.html";
const TEST_DATA = [{
desc: "Test a property for which we don't have a page",
docsPageUrl: "i-dont-exist.html",
expectedContents: {
propertyName: "i-dont-exist.html",
summary: ERROR_MESSAGE,
syntax: []
}
}, {
desc: "Test a property whose syntax section is specified using an old-style page",
docsPageUrl: SYNTAX_OLD_STYLE,
expectedContents: {
propertyName: SYNTAX_OLD_STYLE,
summary: BASIC_EXPECTED_SUMMARY,
syntax: BASIC_EXPECTED_SYNTAX
}
}, {
desc: "Test a property whose page doesn't have a summary",
docsPageUrl: NO_SUMMARY,
expectedContents: {
propertyName: NO_SUMMARY,
summary: "",
syntax: BASIC_EXPECTED_SYNTAX
}
}, {
desc: "Test a property whose page doesn't have a syntax",
docsPageUrl: NO_SYNTAX,
expectedContents: {
propertyName: NO_SYNTAX,
summary: BASIC_EXPECTED_SUMMARY,
syntax: []
}
}, {
desc: "Test a property whose page doesn't have a summary or a syntax",
docsPageUrl: NO_SUMMARY_OR_SYNTAX,
expectedContents: {
propertyName: NO_SUMMARY_OR_SYNTAX,
summary: ERROR_MESSAGE,
syntax: []
}
}
];
add_task(function* () {
setBaseCssDocsUrl(TEST_URI_ROOT);
yield addTab("about:blank");
let [host, win] = yield createHost("bottom", "data:text/html," +
"<div class='mdn-container'></div>");
let widget = new MdnDocsWidget(win.document.querySelector("div"));
for (let {desc, docsPageUrl, expectedContents} of TEST_DATA) {
info(desc);
yield widget.loadCssDocs(docsPageUrl);
checkTooltipContents(widget.elements, expectedContents);
}
host.destroy();
gBrowser.removeCurrentTab();
});
/*
* Utility function to check content of the tooltip.
*/
function checkTooltipContents(doc, expected) {
is(doc.heading.textContent,
expected.propertyName,
"Property name is correct");
is(doc.summary.textContent,
expected.summary,
"Summary is correct");
checkCssSyntaxHighlighterOutput(expected.syntax, doc.syntax);
}
@@ -1,276 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the CSS syntax highlighter in the MdnDocsWidget object.
*
* The CSS syntax highlighter accepts:
* - a string containing CSS
* - a DOM node
*
* It parses the string and creates a collection of DOM nodes for different
* CSS token types. These DOM nodes have CSS classes applied to them,
* to apply the right style for that particular token type. The DOM nodes
* are returned as children of the node that was passed to the function.
*
* This test code defines a number of different strings containing valid and
* invalid CSS in various forms. For each string it defines the DOM nodes
* that it expects to get from the syntax highlighter.
*
* It then calls the syntax highlighter, and checks that the resulting
* collection of DOM nodes is what we expected.
*/
"use strict";
const {appendSyntaxHighlightedCSS} = require("devtools/client/shared/widgets/MdnDocsWidget");
/**
* An array containing the actual test cases.
*
* The test code tests every case in the array. If you want to add more
* test cases, just add more items to the array.
*
* Each test case consists of:
* - description: string describing the salient features of this test case
* - example: the string to test
* - expected: an array of objects, one for each DOM node we expect, that
* captures the information about the node that we expect to test.
*/
const TEST_DATA = [{
description: "Valid syntax, string value.",
example: "name: stringValue;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, numeric value.",
example: "name: 1;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "1"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, url value.",
example: "name: url(./name);",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "url(./name)"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, space before ':'.",
example: "name : stringValue;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: " "},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, space before ';'.",
example: "name: stringValue ;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: " "},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, trailing space.",
example: "name: stringValue; ",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"},
{type: "text", text: " "}
]}, {
description: "Valid syntax, leading space.",
example: " name: stringValue;",
expected: [{type: "text", text: " "},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, two spaces.",
example: "name: stringValue;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, no spaces.",
example: "name:stringValue;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, two-part value.",
example: "name: stringValue 1;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: " "},
{type: "property-value", text: "1"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, two declarations.",
example: "name: stringValue;\n" +
"name: 1;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"},
{type: "text", text: "\n"},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "1"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, commented, numeric value.",
example: "/* comment */\n" +
"name: 1;",
expected: [{type: "comment", text: "/* comment */"},
{type: "text", text: "\n"},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "1"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, multiline commented, string value.",
example: "/* multiline \n" +
"comment */\n" +
"name: stringValue;",
expected: [{type: "comment", text: "/* multiline \ncomment */"},
{type: "text", text: "\n"},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, commented, two declarations.",
example: "/* comment 1 */\n" +
"name: 1;\n" +
"/* comment 2 */\n" +
"name: stringValue;",
expected: [{type: "comment", text: "/* comment 1 */"},
{type: "text", text: "\n"},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "1"},
{type: "text", text: ";"},
{type: "text", text: "\n"},
{type: "comment", text: "/* comment 2 */"},
{type: "text", text: "\n"},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, multiline.",
example: "name: \n" +
"stringValue;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " \n"},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Valid syntax, multiline, two declarations.",
example: "name: \n" +
"stringValue \n" +
"stringValue2;",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " \n"},
{type: "property-value", text: "stringValue"},
{type: "text", text: " \n"},
{type: "property-value", text: "stringValue2"},
{type: "text", text: ";"}
]}, {
description: "Invalid: not CSS at all.",
example: "not CSS at all",
expected: [{type: "property-name", text: "not"},
{type: "text", text: " "},
{type: "property-name", text: "CSS"},
{type: "text", text: " "},
{type: "property-name", text: "at"},
{type: "text", text: " "},
{type: "property-name", text: "all"}
]}, {
description: "Invalid: switched ':' and ';'.",
example: "name; stringValue:",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ";"},
{type: "text", text: " "},
{type: "property-name", text: "stringValue"},
{type: "text", text: ":"}
]}, {
description: "Invalid: unterminated comment.",
example: "/* unterminated comment\n" +
"name: stringValue;",
expected: [{type: "comment", text: "/* unterminated comment\nname: stringValue;"}
]}, {
description: "Invalid: bad comment syntax.",
example: "// invalid comment\n" +
"name: stringValue;",
expected: [{type: "text", text: "/"},
{type: "text", text: "/"},
{type: "text", text: " "},
{type: "property-name", text: "invalid"},
{type: "text", text: " "},
{type: "property-name", text: "comment"},
{type: "text", text: "\n"},
{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: ";"}
]}, {
description: "Invalid: no trailing ';'.",
example: "name: stringValue\n" +
"name: stringValue2",
expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue"},
{type: "text", text: "\n"},
{type: "property-value", text: "name"},
{type: "text", text: ":"},
{type: "text", text: " "},
{type: "property-value", text: "stringValue2"},
]}
];
/**
* Iterate through every test case, calling the syntax highlighter,
* then calling a helper function to check the output.
*/
add_task(function* () {
let doc = gBrowser.selectedTab.ownerDocument;
let parent = doc.createElement("div");
info("Testing all CSS syntax highlighter test cases");
for (let {description, example, expected} of TEST_DATA) {
info("Testing: " + description);
appendSyntaxHighlightedCSS(example, parent);
checkCssSyntaxHighlighterOutput(expected, parent);
while (parent.firstChild) {
parent.firstChild.remove();
}
}
});
-102
View File
@@ -242,105 +242,3 @@ Task.async(function* (widget, name, value) {
yield onRender;
});
/**
* Utility function for testing CSS code samples that have been
* syntax-highlighted.
*
* The CSS syntax highlighter emits a collection of DOM nodes that have
* CSS classes applied to them. This function checks that those nodes
* are what we expect.
*
* @param {array} expectedNodes
* A representation of the nodes we expect to see.
* Each node is an object containing two properties:
* - type: a string which can be one of:
* - text, comment, property-name, property-value
* - text: the textContent of the node
*
* For example, given a string like this:
* "<comment> The part we want </comment>\n this: is-the-part-we-want;"
*
* we would represent the expected output like this:
* [{type: "comment", text: "<comment> The part we want </comment>"},
* {type: "text", text: "\n"},
* {type: "property-name", text: "this"},
* {type: "text", text: ":"},
* {type: "text", text: " "},
* {type: "property-value", text: "is-the-part-we-want"},
* {type: "text", text: ";"}];
*
* @param {Node} parent
* The DOM node whose children are the output of the syntax highlighter.
*/
function checkCssSyntaxHighlighterOutput(expectedNodes, parent) {
/**
* The classes applied to the output nodes by the syntax highlighter.
* These must be same as the definitions in MdnDocsWidget.js.
*/
const PROPERTY_NAME_COLOR = "theme-fg-color5";
const PROPERTY_VALUE_COLOR = "theme-fg-color1";
const COMMENT_COLOR = "theme-comment";
/**
* Check the type and content of a single node.
*/
function checkNode(expected, actual) {
ok(actual.textContent == expected.text,
"Check that node has the expected textContent");
info("Expected text content: [" + expected.text + "]");
info("Actual text content: [" + actual.textContent + "]");
info("Check that node has the expected type");
if (expected.type == "text") {
ok(actual.nodeType == 3, "Check that node is a text node");
} else {
ok(actual.tagName.toUpperCase() == "SPAN", "Check that node is a SPAN");
}
info("Check that node has the expected className");
let expectedClassName = null;
let actualClassName = null;
switch (expected.type) {
case "property-name":
expectedClassName = PROPERTY_NAME_COLOR;
break;
case "property-value":
expectedClassName = PROPERTY_VALUE_COLOR;
break;
case "comment":
expectedClassName = COMMENT_COLOR;
break;
default:
ok(!actual.classList, "No className expected");
return;
}
ok(actual.classList.length == 1, "One className expected");
actualClassName = actual.classList[0];
ok(expectedClassName == actualClassName, "Check className value");
info("Expected className: " + expectedClassName);
info("Actual className: " + actualClassName);
}
info("Logging the actual nodes we have:");
for (let j = 0; j < parent.childNodes.length; j++) {
let n = parent.childNodes[j];
info(j + " / " +
"nodeType: " + n.nodeType + " / " +
"textContent: " + n.textContent);
}
ok(parent.childNodes.length == parent.childNodes.length,
"Check we have the expected number of nodes");
info("Expected node count " + expectedNodes.length);
info("Actual node count " + expectedNodes.length);
for (let i = 0; i < expectedNodes.length; i++) {
info("Check node " + i);
checkNode(expectedNodes[i], parent.childNodes[i]);
}
}
@@ -1,21 +0,0 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h2 id="Summary">Summary</h2>
<p>A summary of the property.</p>
<h2 id="Syntax">Syntax</h2>
<pre>/* The part we want */
this: is-the-part-we-want;</pre>
</body>
</html>
@@ -1,12 +0,0 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>This is not the summary or the syntax.</p>
</body>
</html>
@@ -1,21 +0,0 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>This is not the summary.</p>
<h2 id="Syntax">Syntax</h2>
<pre>To be ignored.</pre>
<pre>/* The part we want */
this: is-the-part-we-want;</pre>
</body>
</html>
@@ -1,17 +0,0 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h2 id="Summary">Summary</h2>
<p>A summary of the property.</p>
<p>This is not the syntax.</p>
</body>
</html>
@@ -1,23 +0,0 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h2 id="Summary">Summary</h2>
<p>A summary of the property.</p>
<h2 id="Syntax">Syntax</h2>
<pre>The part we should ignore</pre>
<pre>/* The part we want */
this: is-the-part-we-want;</pre>
</body>
</html>
@@ -99,7 +99,7 @@ const filterList = [
];
// Valid values that shouldn't be parsed for filters.
const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit"]);
const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit", "revert"]);
/**
* A CSS Filter editor widget used to add/remove/modify
@@ -1,510 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This file contains functions to retrieve docs content from
* MDN (developer.mozilla.org) for particular items, and to display
* the content in a tooltip.
*
* At the moment it only supports fetching content for CSS properties,
* but it might support other types of content in the future
* (Web APIs, for example).
*
* It's split into two parts:
*
* - functions like getCssDocs that just fetch content from MDN,
* without any constraints on what to do with the content. If you
* want to embed the content in some custom way, use this.
*
* - the MdnDocsWidget class, that manages and updates a tooltip
* document whose content is taken from MDN. If you want to embed
* the content in a tooltip, use this in conjunction with Tooltip.js.
*/
"use strict";
const Services = require("Services");
const defer = require("devtools/shared/defer");
const {getCSSLexer} = require("devtools/shared/css/lexer");
const EventEmitter = require("devtools/shared/event-emitter");
const {gDevTools} = require("devtools/client/framework/devtools");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/client/locales/inspector.properties");
const XHTML_NS = "http://www.w3.org/1999/xhtml";
// Parameters for the XHR request
// see https://developer.mozilla.org/en-US/docs/MDN/Kuma/API#Document_parameters
const XHR_PARAMS = "?raw&macros";
// URL for the XHR request
var XHR_CSS_URL = "https://developer.mozilla.org/en-US/docs/Web/CSS/";
// Parameters for the link to MDN in the tooltip, so
// so we know which MDN visits come from this feature
const PAGE_LINK_PARAMS =
"?utm_source=mozilla&utm_medium=firefox-inspector&utm_campaign=default";
// URL for the page link omits locale, so a locale-specific page will be loaded
var PAGE_LINK_URL = "https://developer.mozilla.org/docs/Web/CSS/";
exports.PAGE_LINK_URL = PAGE_LINK_URL;
const PROPERTY_NAME_COLOR = "theme-fg-color5";
const PROPERTY_VALUE_COLOR = "theme-fg-color1";
const COMMENT_COLOR = "theme-comment";
/**
* Turns a string containing a series of CSS declarations into
* a series of DOM nodes, with classes applied to provide syntax
* highlighting.
*
* It uses the CSS tokenizer to generate a stream of CSS tokens.
* https://dxr.mozilla.org/mozilla-central/source/dom/webidl/CSSLexer.webidl
* lists all the token types.
*
* - "whitespace", "comment", and "symbol" tokens are appended as TEXT nodes,
* and will inherit the default style for text.
*
* - "ident" tokens that we think are property names are considered to be
* a property name, and are appended as SPAN nodes with a distinct color class.
*
* - "ident" nodes which we do not think are property names, and nodes
* of all other types ("number", "url", "percentage", ...) are considered
* to be part of a property value, and are appended as SPAN nodes with
* a different color class.
*
* @param {Document} doc
* Used to create nodes.
*
* @param {String} syntaxText
* The CSS input. This is assumed to consist of a series of
* CSS declarations, with trailing semicolons.
*
* @param {DOM node} syntaxSection
* This is the parent for the output nodes. Generated nodes
* are appended to this as children.
*/
function appendSyntaxHighlightedCSS(cssText, parentElement) {
let doc = parentElement.ownerDocument;
let identClass = PROPERTY_NAME_COLOR;
let lexer = getCSSLexer(cssText);
/**
* Create a SPAN node with the given text content and class.
*/
function createStyledNode(textContent, className) {
let newNode = doc.createElementNS(XHTML_NS, "span");
newNode.classList.add(className);
newNode.textContent = textContent;
return newNode;
}
/**
* If the symbol is ":", we will expect the next
* "ident" token to be part of a property value.
*
* If the symbol is ";", we will expect the next
* "ident" token to be a property name.
*/
function updateIdentClass(tokenText) {
if (tokenText === ":") {
identClass = PROPERTY_VALUE_COLOR;
} else if (tokenText === ";") {
identClass = PROPERTY_NAME_COLOR;
}
}
/**
* Create the appropriate node for this token type.
*
* If this token is a symbol, also update our expectations
* for what the next "ident" token represents.
*/
function tokenToNode(token, tokenText) {
switch (token.tokenType) {
case "ident":
return createStyledNode(tokenText, identClass);
case "symbol":
updateIdentClass(tokenText);
return doc.createTextNode(tokenText);
case "whitespace":
return doc.createTextNode(tokenText);
case "comment":
return createStyledNode(tokenText, COMMENT_COLOR);
default:
return createStyledNode(tokenText, PROPERTY_VALUE_COLOR);
}
}
let token = lexer.nextToken();
while (token) {
let tokenText = cssText.slice(token.startOffset, token.endOffset);
let newNode = tokenToNode(token, tokenText);
parentElement.appendChild(newNode);
token = lexer.nextToken();
}
}
exports.appendSyntaxHighlightedCSS = appendSyntaxHighlightedCSS;
/**
* Fetch an MDN page.
*
* @param {string} pageUrl
* URL of the page to fetch.
*
* @return {promise}
* The promise is resolved with the page as an XML document.
*
* The promise is rejected with an error message if
* we could not load the page.
*/
function getMdnPage(pageUrl) {
let deferred = defer();
let xhr = new XMLHttpRequest();
xhr.addEventListener("load", onLoaded, false);
xhr.addEventListener("error", onError, false);
xhr.open("GET", pageUrl);
xhr.responseType = "document";
xhr.send();
function onLoaded(e) {
if (xhr.status != 200) {
deferred.reject({page: pageUrl, status: xhr.status});
} else {
deferred.resolve(xhr.responseXML);
}
}
function onError(e) {
deferred.reject({page: pageUrl, status: xhr.status});
}
return deferred.promise;
}
/**
* Gets some docs for the given CSS property.
* Loads an MDN page for the property and gets some
* information about the property.
*
* @param {string} cssProperty
* The property for which we want docs.
*
* @return {promise}
* The promise is resolved with an object containing:
* - summary: a short summary of the property
* - syntax: some example syntax
*
* The promise is rejected with an error message if
* we could not load the page.
*/
function getCssDocs(cssProperty) {
let deferred = defer();
let pageUrl = XHR_CSS_URL + cssProperty + XHR_PARAMS;
getMdnPage(pageUrl).then(parseDocsFromResponse, handleRejection);
function parseDocsFromResponse(responseDocument) {
let theDocs = {};
theDocs.summary = getSummary(responseDocument);
theDocs.syntax = getSyntax(responseDocument);
if (theDocs.summary || theDocs.syntax) {
deferred.resolve(theDocs);
} else {
deferred.reject("Couldn't find the docs in the page.");
}
}
function handleRejection(e) {
deferred.reject(e.status);
}
return deferred.promise;
}
exports.getCssDocs = getCssDocs;
/**
* The MdnDocsWidget is used by tooltip code that needs to display docs
* from MDN in a tooltip.
*
* In the constructor, the widget does some general setup that's not
* dependent on the particular item we need docs for.
*
* After that, when the tooltip code needs to display docs for an item, it
* asks the widget to retrieve the docs and update the document with them.
*
* @param {Element} tooltipContainer
* A DOM element where the MdnDocs widget markup should be created.
*/
function MdnDocsWidget(tooltipContainer) {
EventEmitter.decorate(this);
tooltipContainer.innerHTML =
`<header>
<h1 class="mdn-property-name theme-fg-color5"></h1>
</header>
<div class="mdn-property-info">
<div class="mdn-summary"></div>
<pre class="mdn-syntax devtools-monospace"></pre>
</div>
<footer>
<a class="mdn-visit-page theme-link" href="#">Visit MDN (placeholder)</a>
</footer>`;
// fetch all the bits of the document that we will manipulate later
this.elements = {
heading: tooltipContainer.querySelector(".mdn-property-name"),
summary: tooltipContainer.querySelector(".mdn-summary"),
syntax: tooltipContainer.querySelector(".mdn-syntax"),
info: tooltipContainer.querySelector(".mdn-property-info"),
linkToMdn: tooltipContainer.querySelector(".mdn-visit-page")
};
// get the localized string for the link text
this.elements.linkToMdn.textContent = L10N.getStr("docsTooltip.visitMDN");
// listen for clicks and open in the browser window instead
let mainWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
this.elements.linkToMdn.addEventListener("click", (e) => {
e.stopPropagation();
e.preventDefault();
mainWindow.openUILinkIn(e.target.href, "tab");
this.emit("visitlink");
});
}
exports.MdnDocsWidget = MdnDocsWidget;
MdnDocsWidget.prototype = {
/**
* This is called just before the tooltip is displayed, and is
* passed the CSS property for which we want to display help.
*
* Its job is to make sure the document contains the docs
* content for that CSS property.
*
* First, it initializes the document, setting the things it can
* set synchronously, resetting the things it needs to get
* asynchronously, and making sure the throbber is throbbing.
*
* Then it tries to get the content asynchronously, updating
* the document with the content or with an error message.
*
* It returns immediately, so the caller can display the tooltip
* without waiting for the asynch operation to complete.
*
* @param {string} propertyName
* The name of the CSS property for which we need to display help.
*/
loadCssDocs: function (propertyName) {
/**
* Do all the setup we can do synchronously, and get the document in
* a state where it can be displayed while we are waiting for the
* MDN docs content to be retrieved.
*/
function initializeDocument(propName) {
// set property name heading
elements.heading.textContent = propName;
// set link target
elements.linkToMdn.setAttribute("href",
PAGE_LINK_URL + propName + PAGE_LINK_PARAMS);
// clear docs summary and syntax
elements.summary.textContent = "";
while (elements.syntax.firstChild) {
elements.syntax.firstChild.remove();
}
// reset the scroll position
elements.info.scrollTop = 0;
elements.info.scrollLeft = 0;
// show the throbber
elements.info.classList.add("devtools-throbber");
}
/**
* This is called if we successfully got the docs content.
* Finishes setting up the tooltip content, and disables the throbber.
*/
function finalizeDocument({summary, syntax}) {
// set docs summary and syntax
elements.summary.textContent = summary;
appendSyntaxHighlightedCSS(syntax, elements.syntax);
// hide the throbber
elements.info.classList.remove("devtools-throbber");
deferred.resolve(this);
}
/**
* This is called if we failed to get the docs content.
* Sets the content to contain an error message, and disables the throbber.
*/
function gotError(error) {
// show error message
elements.summary.textContent = L10N.getStr("docsTooltip.loadDocsError");
// hide the throbber
elements.info.classList.remove("devtools-throbber");
// although gotError is called when there's an error, we have handled
// the error, so call resolve not reject.
deferred.resolve(this);
}
let deferred = defer();
let elements = this.elements;
initializeDocument(propertyName);
getCssDocs(propertyName).then(finalizeDocument, gotError);
return deferred.promise;
},
destroy: function () {
this.elements = null;
}
};
/**
* Test whether a node is all whitespace.
*
* @return {boolean}
* True if the node all whitespace, otherwise false.
*/
function isAllWhitespace(node) {
return !(/[^\t\n\r ]/.test(node.textContent));
}
/**
* Test whether a node is a comment or whitespace node.
*
* @return {boolean}
* True if the node is a comment node or is all whitespace, otherwise false.
*/
function isIgnorable(node) {
// Comment nodes (8), text nodes (3) or whitespace
return (node.nodeType == 8) ||
((node.nodeType == 3) && isAllWhitespace(node));
}
/**
* Get the next node, skipping comments and whitespace.
*
* @return {node}
* The next sibling node that is not a comment or whitespace, or null if
* there isn't one.
*/
function nodeAfter(sib) {
while ((sib = sib.nextSibling)) {
if (!isIgnorable(sib)) {
return sib;
}
}
return null;
}
/**
* Test whether the argument `node` is a node whose tag is `tagName`.
*
* @param {node} node
* The code to test. May be null.
*
* @param {string} tagName
* The tag name to test against.
*
* @return {boolean}
* True if the node is not null and has the tag name `tagName`,
* otherwise false.
*/
function hasTagName(node, tagName) {
return node && node.tagName &&
node.tagName.toLowerCase() == tagName.toLowerCase();
}
/**
* Given an MDN page, get the "summary" portion.
*
* This is the textContent of the first non-whitespace
* element in the #Summary section of the document.
*
* It's expected to be a <P> element.
*
* @param {Document} mdnDocument
* The document in which to look for the "summary" section.
*
* @return {string}
* The summary section as a string, or null if it could not be found.
*/
function getSummary(mdnDocument) {
let summary = mdnDocument.getElementById("Summary");
if (!hasTagName(summary, "H2")) {
return null;
}
let firstParagraph = nodeAfter(summary);
if (!hasTagName(firstParagraph, "P")) {
return null;
}
return firstParagraph.textContent;
}
/**
* Given an MDN page, get the "syntax" portion.
*
* First we get the #Syntax section of the document. The syntax
* section we want is somewhere inside there.
*
* If the page is in the old structure, then the *first two*
* non-whitespace elements in the #Syntax section will be <PRE>
* nodes, and the second of these will be the syntax section.
*
* If the page is in the new structure, then the only the *first*
* non-whitespace element in the #Syntax section will be a <PRE>
* node, and it will be the syntax section.
*
* @param {Document} mdnDocument
* The document in which to look for the "syntax" section.
*
* @return {string}
* The syntax section as a string, or null if it could not be found.
*/
function getSyntax(mdnDocument) {
let syntax = mdnDocument.getElementById("Syntax");
if (!hasTagName(syntax, "H2")) {
return null;
}
let firstParagraph = nodeAfter(syntax);
if (!hasTagName(firstParagraph, "PRE")) {
return null;
}
let secondParagraph = nodeAfter(firstParagraph);
if (hasTagName(secondParagraph, "PRE")) {
return secondParagraph.textContent;
}
return firstParagraph.textContent;
}
/**
* Use a different URL for CSS docs pages. Used only for testing.
*
* @param {string} baseUrl
* The baseURL to use.
*/
function setBaseCssDocsUrl(baseUrl) {
PAGE_LINK_URL = baseUrl;
XHR_CSS_URL = baseUrl;
}
exports.setBaseCssDocsUrl = setBaseCssDocsUrl;
@@ -240,6 +240,9 @@ Spectrum.prototype = {
},
onElementClick: function (e) {
if (e.button != 0) {
return;
}
e.stopPropagation();
},
@@ -1480,6 +1480,9 @@ Column.prototype = {
* for sorting.
*/
onClick: function (event) {
if (event.button != 0) {
return;
}
let target = event.originalTarget;
if (target.nodeType !== target.ELEMENT_NODE || target == this.column) {
@@ -908,6 +908,10 @@ VariablesView.prototype = {
// Copy current selection to clipboard.
if (e.ctrlKey || e.metaKey) {
let item = this.getFocusedItem();
if (!item) {
// No item is selected; do nothing.
return;
}
clipboardHelper.copyString(
item._nameString + item.separatorStr + item._valueString
);
@@ -63,7 +63,7 @@
background-size: 100% 100%, 100% 100%;
background-position: -2px 5px, -2px 5px;
-moz-user-select: none;
user-select: none;
}
canvas.curve {
@@ -16,7 +16,7 @@
}
#filter-container.dragging {
-moz-user-select: none;
user-select: none;
}
.filters-list,
@@ -96,7 +96,7 @@
}
.filter-name label {
-moz-user-select: none;
user-select: none;
flex-grow: 1;
}
@@ -1,39 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
.mdn-container {
height: 300px;
margin: 4px;
overflow: auto;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
.mdn-container header,
.mdn-container footer {
flex: 1;
padding: 0 1em;
}
.mdn-property-info {
flex: 10;
padding: 0 1em;
overflow: auto;
transition: opacity 400ms ease-in;
}
.mdn-syntax {
margin-top: 1em;
}
.devtools-throbber {
align-self: center;
opacity: 0;
}
.mdn-visit-page {
display: inline-block;
padding: 1em 0;
}
-1
View File
@@ -20,7 +20,6 @@ DevToolsModules(
'Graphs.js',
'GraphsWorker.js',
'LineGraphWidget.js',
'MdnDocsWidget.js',
'MountainGraphWidget.js',
'SideMenuWidget.jsm',
'SimpleListWidget.jsm',
+1 -1
View File
@@ -101,7 +101,7 @@ http://www.briangrinstead.com/blog/keep-aspect-ratio-with-html-and-css */
}
.spectrum-dragger, .spectrum-slider {
-moz-user-select: none;
user-select: none;
}
.spectrum-alpha {
@@ -1,93 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {HTMLTooltip} = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
const {MdnDocsWidget} = require("devtools/client/shared/widgets/MdnDocsWidget");
const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
const XHTML_NS = "http://www.w3.org/1999/xhtml";
const TOOLTIP_WIDTH = 418;
const TOOLTIP_HEIGHT = 308;
/**
* Tooltip for displaying docs for CSS properties from MDN.
*
* @param {Document} toolboxDoc
* The toolbox document to attach the CSS docs tooltip.
*/
function CssDocsTooltip(toolboxDoc) {
this.tooltip = new HTMLTooltip(toolboxDoc, {
type: "arrow",
consumeOutsideClicks: true,
autofocus: true,
useXulWrapper: true,
stylesheet: "chrome://devtools/content/shared/widgets/mdn-docs.css",
});
this.widget = this.setMdnDocsContent();
this._onVisitLink = this._onVisitLink.bind(this);
this.widget.on("visitlink", this._onVisitLink);
// Initialize keyboard shortcuts
this.shortcuts = new KeyShortcuts({ window: this.tooltip.topWindow });
this._onShortcut = this._onShortcut.bind(this);
this.shortcuts.on("Escape", this._onShortcut);
}
CssDocsTooltip.prototype = {
/**
* Load CSS docs for the given property,
* then display the tooltip.
*/
show: function (anchor, propertyName) {
this.tooltip.once("shown", () => {
this.widget.loadCssDocs(propertyName);
});
this.tooltip.show(anchor);
},
hide: function () {
this.tooltip.hide();
},
_onShortcut: function (shortcut, event) {
if (!this.tooltip.isVisible()) {
return;
}
event.stopPropagation();
event.preventDefault();
this.hide();
},
_onVisitLink: function () {
this.hide();
},
/**
* Set the content of this tooltip to the MDN docs widget. This is called when the
* tooltip is first constructed.
* The caller can use the MdnDocsWidget to update the tooltip's UI with new content
* each time the tooltip is shown.
*
* @return {MdnDocsWidget} the created MdnDocsWidget instance.
*/
setMdnDocsContent: function () {
let container = this.tooltip.doc.createElementNS(XHTML_NS, "div");
container.setAttribute("class", "mdn-container theme-body");
this.tooltip.setContent(container, {width: TOOLTIP_WIDTH, height: TOOLTIP_HEIGHT});
return new MdnDocsWidget(container);
},
destroy: function () {
this.widget.off("visitlink", this._onVisitLink);
this.widget.destroy();
this.shortcuts.destroy();
this.tooltip.destroy();
}
};
module.exports = CssDocsTooltip;
@@ -4,7 +4,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DevToolsModules(
'CssDocsTooltip.js',
'EventTooltipHelper.js',
'HTMLTooltip.js',
'ImageTooltipHelper.js',
@@ -228,7 +228,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@@ -174,7 +174,10 @@ StyleEditorUI.prototype = {
this._view = new SplitView(viewRoot);
wire(this._view.rootElement, ".style-editor-newButton", () =>{
wire(this._view.rootElement, ".style-editor-newButton", (e) =>{
if (e.button != 0) {
return;
}
this._debuggee.addStyleSheet(null);
});
@@ -2096,7 +2096,6 @@ textarea.input-lg, .input-group-lg > textarea.form-control, .input-group-lg > te
line-height: 1.42857;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.btn:focus, .btn:active:focus, .btn.active:focus {
@@ -275,7 +275,7 @@ body {
.animation-timeline .time-header {
min-height: var(--timeline-animation-height);
cursor: col-resize;
-moz-user-select: none;
user-select: none;
}
.animation-timeline .time-header .header-item {
@@ -300,7 +300,7 @@ body {
}
.animation-timeline .time-body .time-tick {
-moz-user-select: none;
user-select: none;
position: absolute;
width: 0;
/* When scroll bar is shown, make it covers entire time-body */
Loaded 100 of 11021 files, more files were not shown because too many files have changed in this diff. Show more