Compare commits

..
Author SHA1 Message Date
Basilisk-Dev 951a67b54a Issue #2229 Followup - Handle re-entrant module instantiation/evaluation during async module loads 2026-02-11 17:32:31 +01:00
Moonchild a4e51f46c5 Adapt top-level await call to use context top-level interpreterStack() 2026-02-11 15:25:58 +01:00
Basilisk-Dev 2aaaccb74a Issue #2229 - Add top level await tests 2026-02-11 13:54:56 +01:00
Basilisk-Dev 0214893894 Issue #2229 - Add comment regarding JIT to top level await code 2026-02-11 13:54:48 +01:00
Basilisk-Dev 0c2b578ff6 Issue #2229 - add better comments on top level await code 2026-02-11 13:54:41 +01:00
Basilisk-Dev ca66a790ad Issue #2229 - Initial implementation of top level await functionality 2026-02-11 13:54:31 +01:00
Moonchild 74aabee88b Name the Hasher struct definition to align with c++17 standard 2026-02-09 16:06:44 +01:00
Moonchild 7d07f2d2f4 Nullcheck shadowZone in TenuredCell barrier handling 2026-02-09 10:00:31 +01:00
Moonchild cad3893a9d Merge branch 'master' into idle-runnables-rebase
# Conflicts:
#	js/src/builtin/intl/LanguageTagGenerated.cpp
#	js/src/jit/x64/MacroAssembler-x64.cpp
#	js/src/jit/x86/MacroAssembler-x86.cpp
2026-02-08 13:27:39 +01:00
win7-7 0fc81f94e3 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-01 12:41:30 +02:00
win7-7 403be64558 Set max nursery size in MB instead KB.
Set max nursery size in MB instead KB.
2026-02-01 12:41:19 +02:00
win7-7 37098b3189 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-01-31 21:53:30 +02:00
win7-7 7eb97f12d8 Fixes crash with one website. Found reproducible crash. This fixes it.
Fixes crash with one website. Found reproducible crash. This fixes it.
2026-01-29 17:40:25 +02:00
Moonchild 4fbf18bcaa 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-01-29 02:11:03 +02:00
Moonchild 3a91eabd43 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-01-29 01:34:14 +02:00
Moonchild 82ce55edc3 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-01-29 01:33:41 +02:00
win7-7 621044f3a8 Revert back Mozilla original code, it does not crash or hang.
Revert back Mozilla original code, it does not crash or hang.
2026-01-28 22:24:58 +02:00
win7-7 8c591b9b77 Revert "1376614 - Pass budget to forgetSkippable and return early when budget has been used"
This reverts commit d28a0aef50.
2026-01-28 20:07:23 +02:00
win7-7 432984bd4d Compiles with idle runnables.
Compiles with idle runnables.
2026-01-28 18:14:19 +02:00
win7-7 e445d8d55b Merge branch '1351790-60-GC' into idle-runnables-rebase 2026-01-28 18:05:25 +02:00
win7-7 4ebd0d0d09 Merge branch '1351790-60-GC' into idle-runnables-rebase 2026-01-28 18:05:06 +02:00
win7-7 ef8768fbf1 Revert SATS fully, idle runnables are working use them, faster.
Revert SATS fully, idle runnables are working use them, faster.
2026-01-28 18:04:38 +02:00
win7-7 a211da8c85 Revert "Fixes one of compilation error but templates are still issue even with this approach."
This reverts commit 3098a578cc.
2026-01-28 18:03:05 +02:00
win7-7 7d98e537b0 Revert "Fix for one more compilation error."
This reverts commit d3bc79eb5e.
2026-01-28 18:03:04 +02:00
win7-7 a850437475 Revert "Some fixes."
This reverts commit 9a5010a8e3.
2026-01-28 18:02:20 +02:00
win7-7 e15d6e7f56 Revert "Compiles and does not crash."
This reverts commit 48ba811bd6.
2026-01-28 18:02:18 +02:00
win7-7 046a0811dc Revert "Attempting add CC delay to scheduler."
This reverts commit 374cc99ce2.
2026-01-28 18:01:15 +02:00
win7-7 e9f7b071d1 Revert "Revert "Attempting add CC delay to scheduler.""
This reverts commit 1e0c11e56e.
2026-01-28 18:00:23 +02:00
win7-7 08fb5863a3 Revert "Restore this at least for now due being unsure due 1251463 done after this."
This reverts commit dd92323357.
2026-01-28 18:00:21 +02:00
win7-7 88260a6eed Revert SATS until its fully gone now that idle runnables are working.
Revert SATS until its fully gone now that idle runnables are working.
2026-01-28 17:58:34 +02:00
win7-7 5618549c4e Revert "It seems scheduler is not even used for GC and CC, its returning CollectorSchedule::eNone which is 0/nullptr."
This reverts commit 7ca8a03c57.
2026-01-28 17:56:32 +02:00
win7-7 55a6916831 Revert part 5 also. It does depends on part 4.
Revert part 5 also. It does depends on part 4.
2026-01-28 17:30:19 +02:00
win7-7 ee9bd4cc65 Compiles, crashes.
Compiles, crashes.
2026-01-28 02:05:57 +02:00
win7-7 1f10da9ecd 1455599 - Redo bug 1446693, creating separate AutoTraceSessions instead of expanding one
1455599 - Redo bug 1446693, creating separate AutoTraceSessions instead of expanding one
2026-01-24 22:28:06 +02:00
win7-7 733f480d22 Fix typo.
Fix typo.
2026-01-24 22:23:15 +02:00
win7-7 41adef5bf5 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-01-24 18:02:53 +02:00
win7-7 2257dc51ce It has been long time tried adjust CC time, try again after hooking scheduler this time.
It has been long time tried  adjust CC time, try again after hooking scheduler this time.
2026-01-23 01:58:23 +02:00
win7-7 3556434039 Implement a callback system for interrupting timed slice budgets for bug #1351790
Trying this again.
2026-01-22 21:58:06 +02:00
win7-7 4b79b5f98c 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-01-21 15:17:56 +02:00
win7-7 33657b64f3 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-01-21 15:03:51 +02:00
win7-7 da9e8d4165 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-01-18 17:43:46 +02:00
win7-7 5ad7a156a9 Fix remaining errors without busting compilation.
Fix remaining errors without busting compilation.
2026-01-18 10:38:30 +02:00
win7-7 614787d028 Revert "Fix remaining errors from mixing two different approaches."
This reverts commit 2bc5bb2397.
2026-01-18 10:05:26 +02:00
win7-7 2bc5bb2397 Fix remaining errors from mixing two different approaches.
Fix remaining errors from mixing two different approaches.
2026-01-18 09:29:32 +02:00
win7-7 116229957b 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-01-18 08:50:46 +02:00
win7-7 fb2956fb02 Revert "Revert "Attempt fix regexp crash. Not working.""
This reverts commit 7f55d9bbf5.
2026-01-18 05:18:22 +02:00
win7-7 7f55d9bbf5 Revert "Attempt fix regexp crash. Not working."
This reverts commit 7206f041fc.
2026-01-18 02:17:48 +02:00
win7-7 7206f041fc Attempt fix regexp crash. Not working.
Attempt fix regexp crash. Not working.
2026-01-17 17:16:07 +02:00
win7-7 5348db4732 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-01-17 13:31:00 +02:00
win7-7 60f203917b Fix last crashing assert.
Fix last crashing assert.
2026-01-17 04:59:00 +02:00
win7-7 e6c46b9c40 903519 - Reparent JSString from TenuredCell to Cell last missed aspect.
903519 - Reparent JSString from TenuredCell to Cell last missed aspect.
2026-01-16 23:14:41 +02:00
win7-7 5d1d150dc0 903519 - Done fully.
903519 - Change Relocated marker to not confuse string vs object bit, partially done before.
2026-01-16 23:02:33 +02:00
win7-7 69edcc0769 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-01-16 13:18:39 +02:00
win7-7 dac6731cd3 These asserts now work after 903519 - Allocate strings in the nursery if enabled, leaving only one major assert left in jsgc.cpp.
These asserts now work after 903519 - Allocate strings in the nursery if enabled.
2026-01-16 11:54:34 +02:00
win7-7 477725502e Temporary. It no longer crashes with tradera.com and Speedometer 2.1 works with those asserts bypassed. Time re-enable them soon.
Temporary. It no longer crashes with tradera.com and Speedometer 2.1 works with those asserts bypassed. Time re-enable them soon.
2026-01-16 11:41:05 +02:00
win7-7 c4aa29c053 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-01-16 11:40:37 +02:00
win7-7 43b93e7b93 Where did this come from?
Where did this come from? It fixes two crashing assertions. Still another crash further down.
2026-01-16 11:40:19 +02:00
win7-7 5270a74f4e 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-01-16 11:40:09 +02:00
win7-7 3b4f0a7b23 903519 - Allocate strings in the nursery if enabled
903519 - Allocate strings in the nursery if enabled, missed change somehow.
2026-01-16 02:19:39 +02:00
win7-7 cb02bcd562 903519 - Strings in the nursery: barriers
Cell.h was missed after headers split to nursery support. Third crash.
2026-01-16 00:06:50 +02:00
win7-7 e23bc876bc Enable nursery strings fixes from 67. Still crashes.
Enable nursery strings fixes from 67. Still crashes.
2026-01-15 21:28:02 +02:00
win7-7 f4de39242f Enable nursery strings.
Enable nursery strings and see to fix crash:

1442481 - Use whole cell buffer to post-barrier string -> string edges
2026-01-15 20:03:46 +02:00
win7-7 7d40f61a9e 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-01-15 19:01:09 +02:00
win7-7 cf8e7cd447 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-01-15 06:50:04 +02:00
win7-7 bb98b67066 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-01-15 05:53:57 +02:00
win7-7 b681a553cf Fixes to VMFunctions.cpp, assert no longer crashes.
Fixes to VMFunctions.cpp, assert no longer crashes.
2026-01-15 05:51:01 +02:00
win7-7 85f6eff03e 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-01-15 05:48:12 +02:00
win7-7 de707726f2 903519 - Strings in the nursery: barriers, one missed change.
903519 - Strings in the nursery: barriers, one missed change. Still crashes.
2026-01-15 05:47:03 +02:00
win7-7 afc78f5e59 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-01-15 05:46:29 +02:00
win7-7 b653fcac30 CacheIR nursery changes.
CacheIR nursery changes.
2026-01-15 05:43:01 +02:00
win7-7 46e24137a7 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-01-15 05:42:24 +02:00
win7-7 ddc9649ec9 Resolve 1 missing symbol in linking.
Resolve 1 missing symbol in linking.
2026-01-15 05:40:05 +02:00
win7-7 935e07973b More fixes this almost compiles.. need cherry pick one more change.
More fixes this almost compiles.. need cherry pick one more change.
2026-01-15 05:38:29 +02:00
win7-7 ea11e1a5f4 More fixes this almost compiles.. maybe.
More fixes this almost compiles.. maybe.
2026-01-15 05:37:38 +02:00
win7-7 9e798de9c3 Forgotten change.
Forgotten change.
2026-01-15 05:37:26 +02:00
win7-7 203c22f61c Fixes.
Fixes.
2026-01-15 05:37:14 +02:00
win7-7 d6b5b8d3b2 Further fixes
Further fixes
2026-01-15 05:36:40 +02:00
win7-7 9c8c1c4c5b Fixes.
Fixes.
2026-01-15 05:36:21 +02:00
win7-7 1ebdc48dfd 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-01-15 05:36:01 +02:00
win7-7 22fa77d8c5 Fixes.
Fixes.
2026-01-15 05:35:02 +02:00
win7-7 f420827e40 Fixes.
Fixes.
2026-01-15 05:33:56 +02:00
win7-7 20b35e140a 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-01-15 05:33:22 +02:00
win7-7 fc9c624ccc 903519 - Split out string nursery pointers from object nursery
903519 - Split out string nursery pointers from object nursery, this was not done before.
2026-01-15 05:32:13 +02:00
win7-7 3e4fea5bcf 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-01-15 05:31:14 +02:00
win7-7 c5e344b6c5 903519 - Register nursery string buffers to be freed
903519 - Register nursery string buffers to be freed, this was missed somehow before.
2026-01-15 05:30:57 +02:00
win7-7 cfe9b423f0 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-01-15 05:30:41 +02:00
win7-7 5eb5a8acef Fix more errors.
Fix more errors.
2026-01-15 05:30:15 +02:00
win7-7 85da1cff69 Sigh..
Sigh..
2026-01-15 05:29:20 +02:00
win7-7 69c5099535 Some more fixes.
Some more fixes.
2026-01-15 05:28:09 +02:00
win7-7 482c656612 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-01-15 05:24:54 +02:00
win7-7 0486dedc04 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-01-15 05:18:48 +02:00
win7-7 734a3e9a6d 1464912 - Add exposeToActiveJS specialization for JSString.
1464912 - Add exposeToActiveJS specialization for JSString. Necessary for nursery.
2026-01-15 05:15:55 +02:00
win7-7 08914564f7 Remaining file updated.
Remaining file updated.
2026-01-15 05:15:22 +02:00
win7-7 e325973198 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-01-15 05:14:52 +02:00
win7-7 166ef47f8a 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-01-15 04:27:42 +02:00
win7-7 743e5a1a1e 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-01-15 04:22:43 +02:00
win7-7 dc8457f393 Compiles, links, does not crash. 59 GC.
Compiles, links, does not crash. 59 GC.
2026-01-15 00:13:54 +02:00
win7-7 e53bacb2af Fixes.
Mostly taking care of headers splitting.
2026-01-14 23:15:43 +02:00
win7-7 2ec204594e 59 GC.
59 GC.
2026-01-14 19:32:37 +02:00
win7-7 07416f31a7 58 GC no crashing.
Compiles link no crashing.
2026-01-14 06:30:36 +02:00
win7-7 b6d66f03c2 58 a1 GC. Trying see when issue with atoms started.
58 a1 GC. Trying see when issue with atoms started.
2026-01-14 05:10:42 +02:00
win7-7 0ef6a3cd11 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-01-14 03:57:59 +02:00
win7-7 0777604a57 This does work.
This should work. Test gains.
2026-01-14 03:34:12 +02:00
Jon Coppeard e3ee4e213d Bug 1369748 - Refactor GCRuntime::beginMarkPhase r=sfink 2026-01-14 03:27:34 +02:00
win7-7 402b77b0cc 56 GC fixes.
56 GC fixes.
2026-01-14 03:25:32 +02:00
win7-7 4de056537f 56 GC.
Trying narrow when atom crash started between 55 and 60 and if its easy to revert.
2026-01-14 00:38:31 +02:00
win7-7 9e66bf54f8 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-01-08 23:52:20 +02:00
win7-7 ddf2f2696f 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-01-07 21:16:06 +02:00
win7-7 50b3876078 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-01-07 19:57:41 +02:00
win7-7 40a535ebe4 1370210 - obj_propertyIsEnumerable calls non-inlined IsSymbolOrSymbolWrapper
1370210 - Optimize ValueToId and ValueToIdPure to check the common cases first
2026-01-07 17:37:08 +02:00
André Bargull aa6aa7fd4f Bug 1379222 - Avoid [[Get]] for "prototype" property when calling builtin constructors. r=jandem 2026-01-07 11:14:10 +02:00
win7-7 be86c1d176 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-01-07 08:43:27 +02:00
win7-7 868d880006 Security fixes toward 105 version.
Security fixes toward 105 version.
2026-01-07 03:04:46 +02:00
win7-7 ae402ea7d0 Security fixes toward 71 version.
Security fixes toward 71 version.
2026-01-07 03:04:46 +02:00
win7-7 413a013916 More security fixes toward 67 version.
More security fixes toward 67 version.
2026-01-07 03:04:46 +02:00
win7-7 c777af090c Somewhat 60 level of security.
Somewhat 60 level of security.
2026-01-07 03:04:46 +02:00
win7-7 7537fb19db 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-01-07 03:04:46 +02:00
win7-7 938db5d4f4 1354527 - Crash [@ js::jit::RInstructionResults::operator[]]
1354527 - Recover the iterator object when closing during exception handling.
2026-01-07 03:04:46 +02:00
win7-7 78d7cbae94 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-01-07 03:04:45 +02:00
win7-7 7b1182b162 1331900 - Delete Label's assignment operator.
Hiding it => linking error.
Deleting it => compilation error.
2026-01-07 03:01:37 +02:00
win7-7 1355bf066e Bug 1405457 - Scalar replacement for call objects. r=nbp
Scalar replacement for call objects, should make arrow-declare six-speed test faster.
2026-01-07 03:01:36 +02:00
win7-7 3c1f6618aa 1355155 - Scalar replacement for arrow functions.
1355155 - Scalar replacement for arrow functions.
2026-01-07 03:00:21 +02:00
win7-7 c9aadfae81 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-01-06 20:26:31 +02:00
win7-7 7dcf9bd87c 1325480 - Baldr: make WasmInstanceObject::ExportMap a strong edge
1325480 - Baldr: make WasmInstanceObject::ExportMap a strong edge
2025-12-30 14:47:03 +02:00
win7-7 4733c72f73 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;
2025-12-30 14:17:20 +02:00
win7-7 f5a5a9c670 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.
2025-12-30 13:05:57 +02:00
win7-7 b41ec4cb88 1337444 - wasm: runtime crash involving i64 globals
1337444: Fix regalloc of load/store i64 globals;
2025-12-30 10:26:27 +02:00
win7-7 c37c115515 1335068 - Wasm: Split the global allocation out of the CodeSegment
1335068 - Break wasm globals out of the code segment.
2025-12-30 10:26:26 +02:00
win7-7 7a2faa9022 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.
2025-12-30 05:05:26 +02:00
win7-7 6b6e768d34 1330339 - Assertion failure: !done() && debugEnabled(), at js/src/wasm/WasmFrameIterator.cpp:223
1330339 - Ensure wasm debug is enabled when observesFrame is queried.
2025-12-30 03:36:19 +02:00
win7-7 5473390f2a 1330491 - Assertion failure: maybeBytecode, at js/src/wasm/WasmCode.cpp:581 with Debugger
1330491 - Always provide wasm bytecode for debuggable instance.
2025-12-30 03:32:40 +02:00
win7-7 c49182a32c 1331064 - Assertion failure: throwing, at js/src/jscntxt.cpp:946 with wasm and Debugger
1331064 - Ignore wasm onExceptionUnwind events in JSTRAP_ERROR state.
2025-12-30 03:29:33 +02:00
win7-7 b3244bc4e3 1331592 - Assertion failure: data_.state_ == INTERP, at js/src/vm/Stack.cpp:495 with Debugger and wasm
1331592 - Skipping wasm frames during debugger eval.
2025-12-30 03:27:00 +02:00
win7-7 6ce674cbbb 1332493- Crash [@ js::wasm::Instance::object]
1332493 - Initialize wasm::DebugFrame before stack overflow check.
2025-12-30 03:22:26 +02:00
win7-7 83f856312d 1342497 - Baldr: store current frame, not previous frame, in wasm::FrameIterator
1342497 - Baldr: store current frame, not previous frame, in wasm::FrameIterator.
2025-12-30 02:30:49 +02:00
win7-7 10a4f5b7fd 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.
2025-12-30 02:06:22 +02:00
win7-7 e86a5e51f9 1331452 - jit-test/tests/debug/wasm-06.js failures with CGC builds
1331452 - Keep scope in a slot in WasmFunctionCallObjects.

1331452 - Followup: hazard fix.
2025-12-30 01:37:40 +02:00
win7-7 f10ccfe95d 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
2025-12-30 00:41:22 +02:00
win7-7 e2f4479519 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?
2025-12-29 17:12:53 +02:00
win7-7 a9b2d27c09 1342045: Allow wasm::Memory of size 2**32
1342045: Allow wasm::Memory of size 2**32
2025-12-29 15:40:26 +02:00
win7-7 ce005e09e2 Bug 1332772 - Baldr: tweak memory/table limits
1332772 - Baldr: tweak memory/table limits
2025-12-29 15:40:26 +02:00
win7-7 a93c8aa52e Bug 1324008 Baldr: tweak internal limits to match other browsers
1324008 - Baldr: tweak internal limits to match other browsers.
2025-12-29 15:40:25 +02:00
win7-7 f382876cf1 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).
2025-12-29 05:52:21 +02:00
win7-7 dd0036f86d 1326160 Wasm baseline: Division by nonzero constants can omit divide-by-zero check
1326160 - Omit divide by zero and overflow checks for some constants
2025-12-29 05:52:12 +02:00
win7-7 c8ccc86f8f 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.
2025-12-29 05:52:04 +02:00
win7-7 8b606eb9eb 1318252 - Baldr: Serialize Import's DefinitionKind
Otherwise, all imports are treated as function imports after deserialization. Fixes crash with 1321122.
2025-12-29 05:51:54 +02:00
win7-7 ab5a076455 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
2025-12-29 05:51:43 +02:00
win7-7 7d6b67362a 1321122 - Baldr: add Module.customSections.
1321122 - Baldr: add Module.customSections.

As added here:
  https://github.com/WebAssembly/design/pull/877
2025-12-29 05:51:29 +02:00
win7-7 4ad8f1da3d Don't undo progress on batch compilation accidentally.
Don't undo progress on batch compilation accidentally.
2025-12-29 05:51:17 +02:00
win7-7 9e359c59f6 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
2025-12-29 05:50:58 +02:00
win7-7 98454f6882 1455703: Check for OOM in AstDecodeModuleTail
1455703: Check for OOM in AstDecodeModuleTail.
2025-12-29 05:50:47 +02:00
win7-7 53373d080d 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;
2025-12-29 05:50:27 +02:00
win7-7 75797914d3 1298139 - Make LoopUnroller code handle OOM correctly
1298139 - Make LoopUnroller code handle OOM correctly
2025-12-27 15:47:39 +02:00
win7-7 e73af388e7 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
2025-12-27 14:12:51 +02:00
win7-7 dd5bc68ead 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.
2025-12-27 14:12:51 +02:00
win7-7 a6962a692c 1370922 - [Ion] Handle allocation failure when generating Math.min.
1370922 - [Ion] Handle allocation failure when generating Math.min.
2025-12-27 08:08:45 +02:00
win7-7 33f89a1439 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.
2025-12-27 04:40:42 +02:00
win7-7 93f9f7d24a Typo fix.
Typo fix.
2025-12-26 11:52:08 +02:00
win7-7 55a63ec46c 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.
2025-12-26 10:47:29 +02:00
win7-7 f3cecfa567 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.
2025-12-23 01:04:58 +02:00
win7-7 e3885f523f 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.
2025-12-23 01:04:58 +02:00
win7-7 b7be1f6c2b 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.
2025-12-23 01:04:58 +02:00
win7-7 140f70940c 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.
2025-12-22 12:25:25 +02:00
win7-7 69d5ace8fd 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
2025-12-22 11:40:21 +02:00
win7-7 4c8f86d478 Revert "Issue #2847 - Update tests and toolkit CSS to account for windows-win11"
This reverts commit da7dff0437.
2025-12-21 22:30:17 +02:00
win7-7 d7e22cf281 Revert "Issue #2847 - Extend -moz-os-version media query with win11. (re-land)"
This reverts commit 2c321e2baf.
2025-12-21 22:30:12 +02:00
win7-7 7082185f68 Revert "Issue #1843 - Clean up WindowsVersion.h"
This reverts commit b2ddd84ac6.
2025-12-21 22:29:48 +02:00
win7-7 62ea27545b Revert "Issue #1843 - Refactor IsWindowsBuildOrLater()"
This reverts commit de0eb45320.
2025-12-21 22:29:46 +02:00
win7-7 5fa3f455ac Remove template.
Remove template. This did not exist in 55 js engine due multi-threading changes and causes build bustage. To be merged soon previous commit.
2025-12-21 21:01:06 +02:00
win7-7 6b741c8822 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.
2025-12-21 07:24:44 +02:00
win7-7 d22bb11b4a Fixes.
Fixes.
2025-05-08 22:50:55 +03:00
win7-7 bc46ede454 Master merge.
Master merge.
2025-05-08 22:09:17 +03:00
win7-7 feff5b6048 Part of previous merge.
Part of previous merge.
2025-01-22 00:20:12 +02:00
win7-7 eae6d323b2 Merge remote-tracking branch 'Upstream/master' into scheduling-alternative-approach-to-idle-runnables-performance-gains-if-this-works 2025-01-22 00:01:03 +02:00
win7-7 e394a75a94 Fix.
Fix.
2024-09-28 00:21:43 +03:00
win7-7 59dfe1e3f0 Merge branch 'master' into scheduling-alternative-approach-to-idle-runnables-performance-gains-if-this-works 2024-09-27 23:46:26 +03:00
win7-7 d125c305fb Merge branch 'master' into scheduling-alternative-approach-to-idle-runnables-performance-gains-if-this-works 2024-07-30 12:54:23 +03:00
win7-7 28af6c763b Revert "1294042 - Implement the folding of MPow"
This reverts commit 68518438a3.

Major performance regression, not worth of taking in.
2024-05-24 01:47:01 +03:00
win7-7 22517596f4 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.
2024-05-23 23:56:47 +03:00
win7-7 68518438a3 1294042 - Implement the folding of MPow
1294042 - Implement constant folding for MPow.

Fold MPow instructions that have constant `x` and `p` arguments.
2024-05-23 16:12:04 +03:00
win7-7 c11bc29b86 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.
2024-05-23 12:45:48 +03:00
win7-7 0e468a6462 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.
2024-05-23 00:37:23 +03:00
win7-7 f4a3412f35 1400278 - Fix non-unified build bustage.
1400278 - Fix non-unified build bustage.

Style check bustage fix also.
2024-05-23 00:37:23 +03:00
win7-7 82476e071d 1333757 - one assert was missed.
1333757 - one assert was missed.
2024-05-23 00:37:23 +03:00
win7-7 fedca13522 1324002 - two missed assert changes.
1324002 - two missed assert changes.
2024-05-23 00:37:23 +03:00
win7-7 de91b9b7ad 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.
2024-05-23 00:37:22 +03:00
win7-7 7ca8a03c57 It seems scheduler is not even used for GC and CC, its returning CollectorSchedule::eNone which is 0/nullptr.
Make this work.It seems scheduler is not even used for GC and CC,

Hopefully actually make scheduler used for CC and GC.. instead merely returning 0/nulltpr thus not scheduling GC/CC at all using undefined setting.

Further attempt to hook this up to GC and CC hopefully correctly.

TriggerGCOrGCSlice definition cannot be eGC due 3 values it could be.

Same goes to IsGCScheduled unless use || that it can be any of 3 values.

Use 3 values it can be.
2024-05-23 00:37:22 +03:00
win7-7 e11973672e Attempting add CCDelay again making it equal to NS_CC_DELAY to schedule.
Attempting add CCDelay again making it equal to NS_CC_DELAY to schedule.

Assert for CCDelay, also makeCCDelay similar order as original NS_CC_DELAY, before ForgetSkippable.
2024-05-23 00:37:22 +03:00
win7-7 bc98ad1fe4 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.
2024-05-19 01:10:57 +03:00
win7-7 ee75386daa Revert "Trying add overrides back."
This reverts commit 2b77ab0100.
2024-05-18 23:05:05 +03:00
win7-7 2b77ab0100 Trying add overrides back.
Trying add overrides back.
2024-05-18 22:56:57 +03:00
win7-7 8068ca29b9 Removing #ifdef RELEASE_OR_BETA. Doubt it will allow compile this but whatever might as well test..
Removing  #ifdef RELEASE_OR_BETA. Doubt it will allow compile this but whatever might as well test..
2024-05-18 22:52:24 +03:00
win7-7 9d4228688b 1455709 - Assertion failure: bytes_ >= bytesAtStartOfGC_, at js/src/gc/GC.cpp:2040
1455709 - Assertion failure: bytes_ >= bytesAtStartOfGC_, at js/src/gc/GC.cpp:2040
2024-05-18 03:46:56 +03:00
win7-7 dd92323357 Restore this at least for now due being unsure due 1251463 done after this.
Restore this at least for now due being unsure due 1251463 done after this removing timer making scheduling of it not possible and thus removing definition removing it entirely even though definition was still left after 1251463.
2024-05-17 15:57:10 +03:00
win7-7 1e0c11e56e Revert "Attempting add CC delay to scheduler."
This reverts commit 374cc99ce2.

Won't work. Due lack of definition later.
2024-05-17 15:44:53 +03:00
win7-7 374cc99ce2 Attempting add CC delay to scheduler.
Attempting add CC delay to scheduler.
2024-05-17 15:39:29 +03:00
win7-7 a30f08efb9 Attempting adjust settings. Hoping that would make this branch more usefull without either over-usage of memory or lack of gains.
Attempting adjust settings. Hoping that would make this branch more usefull without either over-usage of memory or lack of gains.
2024-05-17 15:11:31 +03:00
win7-7 9686600b0d Trying default settings.
Trying default settings.

Nope memory usage keep raising but not without this branch.
2024-05-17 01:09:34 +03:00
win7-7 2f4b351977 Revert "Try adjust CC also."
No longer seems fit with recent changes.

Try partial revert instead
2024-05-17 00:53:47 +03:00
win7-7 48ba811bd6 Compiles and does not crash.
Compiles and does not crash. Anything further unsure for testing.

Potentially performance gains in terms of significantly less pausing/better scheduling for async slow GC and CC tasks. Still unsure overall impact for memory usage tradeoff etc.
2024-05-17 00:20:35 +03:00
win7-7 9a5010a8e3 Some fixes.
RuntimeService.cpp is now issue compiling.
2024-05-17 00:20:35 +03:00
win7-7 d3bc79eb5e Fix for one more compilation error.
Fix for one more compilation error.

nsCancelableRunnable no longer exists. its CancelableRunnable now.

This still won't compile due nsCycleCollectorTraceJsHelpers.cpp undeclared identifier, identifier not found, AddToCCKind not being member of Mozilla.
2024-05-17 00:20:35 +03:00
win7-7 3098a578cc Fixes one of compilation error but templates are still issue even with this approach.
Fixes one of compilation error but templates are still issue even with this approach.
2024-05-17 00:20:35 +03:00
win7-7 1a2d14049a 1168990
1168990  attempt. Mozilla should be ashamed for  old system with one liner copying or numbered lines when pasting attachement (one that never got into central or earlier pushed so its attachement only is outdated system)

eForgetSkippable should be same as setting changed before.
2024-05-17 00:20:33 +03:00
win7-7 c092978d4e 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?
2024-05-16 15:30:11 +03:00
win7-7 4452886433 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.
2024-05-16 06:06:41 +03:00
win7-7 e26432bd41 Fix compilation of do_CreateInstance
Fix compilation of do_CreateInstance.
2024-05-16 05:25:40 +03:00
win7-7 cbef4215c1 Fallout from mozilla version of file.
Fallout from mozilla version of file.
2024-05-16 03:20:04 +03:00
win7-7 410470b5dd Part 4 could not suck more.
Part 4 could not suck more.

Sigh..

do_CreateInstance where was this defined so identifier is found..
2024-05-16 02:14:57 +03:00
win7-7 af55a08cb8 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).
2024-05-16 01:38:37 +03:00
win7-7 c4a56e826c Hmph.. another issue due needing 1325254 (which does not just work) or figuring out way get rid of Value.
Hmph.. another issue due needing 1325254 or figuring out way get rid of Value.
2024-05-16 01:32:32 +03:00
win7-7 7773a52aea Just import file from Mozilla.
Just import file from Mozilla.

It does help with templates but of course there is another issue.
2024-05-16 01:28:45 +03:00
win7-7 347cabe474 1358476, add support for timeout when doing idle dispatch
Templates suck. I cannot make this work likely.
2024-05-16 00:51:08 +03:00
win7-7 cf48056359 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.
2024-05-16 00:38:51 +03:00
win7-7 bd5e4f8def 1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable
1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable.
2024-05-16 00:38:38 +03:00
win7-7 7fad0769a6 1371242 - Investigate if CC slices could use idle periods more likely
1371242, try to run CC slices more likely during idle periods.
2024-05-16 00:38:20 +03:00
win7-7 75fe504c42 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
2024-05-16 00:38:09 +03:00
win7-7 851ad0bb4b 1368972 - Increase slice time for long-running incremental GCs
1368972 - Increase slice time for long-running incremental GCs when CC has tried to run.
2024-05-16 00:37:56 +03:00
win7-7 d28a0aef50 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,
2024-05-16 00:37:45 +03:00
win7-7 f556ce369c 1373067 - Ensure CC isn't started too often
1373067 - Ensure CC isn't started too often.
2024-05-16 00:37:35 +03:00
win7-7 04f7faa060 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.
2024-05-16 00:37:23 +03:00
win7-7 046ec8015b 1436697 - Heap growth factor limits are too low
1436697 - Fix GC heap growth factor limits.
2024-05-15 15:37:37 +03:00
win7-7 545dc241fe Merge branch 'master' into Try-increase-CC-timing 2024-05-10 21:13:54 +03:00
win7-7 58d0f9bb64 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.
2024-05-10 21:09:40 +03:00
win7-7 081dbf1e22 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.
2024-05-10 19:34:17 +03:00
win7-7 8550df99d4 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.
2024-05-10 19:34:17 +03:00
win7-7 8a230e9ca9 Revert "1675153"
This reverts commit dc6b803b6a222646a517caed538a64ebb2db2b64.
2024-05-10 19:34:17 +03:00
win7-7 5a133b0282 1341093 - Some of this was missed when working on malloc incremental trigger while taking one part.
1341093 - Transfer malloc bytes when zones are merged.
2024-05-10 19:34:16 +03:00
win7-7 2e03fc2828 1393597 - NotifyOffThreadScriptLoadCompletedRunnable hangs a lot
1393597 - Remove FinishIncrementalGC when merging compartments.
2024-05-10 19:34:16 +03:00
win7-7 3b323765e6 1371908 - GlobalHelperThreadState::mergeParseTaskCompartment finishes GC at random times
1371908 - When merging compartments only finish an ongoing GC if it affects the destination compartment.
2024-05-10 19:34:16 +03:00
win7-7 5c8fb04c73 1406438 - GCRuntime::allNonEmptyChunks should be called under the GC lock
1406438 - Ensure GC lock held when iterating all non-empty chunks.
2024-05-10 19:34:16 +03:00
win7-7 67c7fd3a35 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.
2024-05-10 19:34:16 +03:00
win7-7 f5f4e7e733 1359421 - Simplify/optimize SharedContext::isFunctionBox
1359421 - Simplify/optimize SharedContext::isFunctionBox by removing an unnecessary virtual call.
2024-05-10 19:34:16 +03:00
win7-7 cacf3fd950 1371097 - String.replace() could be faster
1371097 - Change sRopeMatchThresholdRatioLog2 from 5 to 4 to flatten less eagerly.
2024-05-10 19:34:16 +03:00
win7-7 602611512b 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.
2024-05-10 19:34:16 +03:00
win7-7 c3b55c8dc9 1370208 - Inline Boolean when called as a function
1370208 - Inline Boolean constructor when called as a function.
2024-05-10 19:34:16 +03:00
win7-7 3a67447109 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.
2024-05-10 19:34:16 +03:00
win7-7 2ce9f8a373 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().
2024-05-10 19:34:15 +03:00
win7-7 6be77085b3 1346543.
1346543.
2024-05-10 19:34:15 +03:00
win7-7 d0f902c09c 1356207 - Optimize ToLength better with Ion
1356207 - Optimize self-hosted ToLength better with Ion.
2024-05-10 19:34:15 +03:00
win7-7 9db2445b6e 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.
2024-05-10 19:34:15 +03:00
win7-7 e1ddb6f032 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.
2024-05-10 19:34:15 +03:00
win7-7 4056cd2aef 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.
2024-05-10 19:34:15 +03:00
win7-7 122044f0b7 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.
2024-05-10 19:34:15 +03:00
win7-7 eeb2e3e1cc 1357330.
1357330.
2024-05-10 19:34:15 +03:00
win7-7 12bfb1535d 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.
2024-05-10 19:34:15 +03:00
win7-7 1ee39fdabd 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
2024-05-10 19:34:15 +03:00
win7-7 998b9684a4 1368344 - Disable GC zeal in testUnbarrieredEquality.
1368344 - Disable GC zeal in testUnbarrieredEquality.
2024-05-10 19:34:14 +03:00
win7-7 79aba03ab0 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.
2024-05-10 19:34:14 +03:00
win7-7 3191c17824 1329113 - AutoCloseIterator::~AutoCloseIterator ignores the return value of CloseIterator
1329113 - Use PropertyIteratorObject* in AutoCloseIterator.
2024-05-10 19:34:14 +03:00
win7-7 a6698ed0ee 1331350 - IonMonkey: Fuse BitAnd, Compare and Test into BitAndAndBranch
1331350 - Fuse BitAnd, Compare and Test into BitAndAndBranch.
2024-05-10 19:34:14 +03:00
win7-7 0c46838c35 1354275 - Ion: Inlining native calls need resume points if they throw
1354275 - Fix handling of Array() throwing in Ion
2024-05-10 19:34:14 +03:00
win7-7 88d1a5d3cc 1343723 - Crash [@ js::jit::MachineState::read] involving Promise
1343723 - ResumePoint not needed for MNewLexicalEnvironmentObject.
2024-05-10 19:34:14 +03:00
win7-7 4d6b81fb3d 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.
2024-05-10 19:34:14 +03:00
win7-7 951f46cfe3 1318677 part 4.
1318677 part 4 - Use a smaller enum representation for js::jit::AbortReason. Part 4 was missed before.
2024-05-10 19:34:14 +03:00
win7-7 8026ebd0d8 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.
2024-05-10 19:34:14 +03:00
win7-7 9aaf4cfda7 1335862 - Implement mayResolve for arguments objects
1335862 - Implement mayResolve for arguments objects.
2024-05-10 19:34:13 +03:00
win7-7 614ba23221 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.
2024-05-10 19:34:13 +03:00
win7-7 dd846dc7fa 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.
2024-05-10 19:34:13 +03:00
win7-7 6b4870eb46 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.
2024-05-10 19:34:13 +03:00
win7-7 29b1a4f052 1384010 - Create prefs for allocation threshold factors.
1384010 - Create prefs for allocation threshold factors.
2024-05-10 19:34:13 +03:00
win7-7 cc0b094ca0 1554954 + 1570905
1570905 - Rework the GC triggers to make the incremental trigger the default and the non-incremental trigger some factor of this.
2024-05-10 19:34:13 +03:00
win7-7 a0d1ed8821 Testing performance impact of increasing this further. 2024-05-10 19:34:13 +03:00
win7-7 048dab5c36 1373214 - missing part for hybrid js engine.
1373214 - missing part for hybrid js engine.
2024-05-10 19:34:13 +03:00
win7-7 a6182c9bf4 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.
2024-05-10 19:34:13 +03:00
win7-7 2e447d0b62 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.
2024-05-10 19:34:13 +03:00
win7-7 b5e5e480b9 1390087 - Assertion failure: zone->isGCScheduled(), at js/src/jsgc.cpp:6785
1390087 - Ignore zones that we can't collect when scheduling zones for GC.
2024-05-10 19:34:12 +03:00
win7-7 18583c6fa8 Fixes.
Fixes.
2024-05-10 19:34:12 +03:00
win7-7 9f4318485a Fixes.
Fixes.
2024-05-10 19:34:12 +03:00
win7-7 e6067db46e 1367900 - Record the values and thresholds for GC triggers
1367900 - Record the values and thresholds for GC triggers.
2024-05-10 19:34:12 +03:00
win7-7 45f0a9048a Fixes.
Fixes.
2024-05-10 19:34:12 +03:00
win7-7 d778b7f568 1386660
1386660.
2024-05-10 19:34:12 +03:00
win7-7 236afc6643 1408375
1408375
2024-05-10 19:34:12 +03:00
win7-7 2c3ca185be 1384049 - Trigger an incremental GC based on malloc memory counters
1384049 - Trigger an incremental GC based on malloc memory counters.
2024-05-10 19:34:12 +03:00
win7-7 62ca3b6a83 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
2024-05-10 19:34:12 +03:00
win7-7 6629021d09 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.
2024-05-10 19:34:11 +03:00
win7-7 6485d411d7 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.
2024-05-10 19:34:11 +03:00
win7-7 e6ec60004c 1377055 - Disallow setting JSCLASS_SKIP_NURSERY_FINALIZE on proxies
1377055. Assert that JSCLASS_SKIP_NURSERY_FINALIZE is not used on proxies.
2024-05-10 19:34:11 +03:00
win7-7 bb6c603729 1377368 - ProxyObject::New won't create foreground finalized proxies in the nursery
1377368 - Support allocating foreground finalized proxies in the nursery.
2024-05-10 19:34:11 +03:00
win7-7 31eba3a570 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.
2024-05-10 19:34:11 +03:00
win7-7 7d39fab55e 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.
2024-05-10 19:34:11 +03:00
win7-7 21f16cf996 1384047
1384047 - Relax assertion that zones are empty when they are deleted
2024-05-10 19:34:11 +03:00
win7-7 0334b77d8c 1366340
1366340 - Delete parsing zones immediately after their contents are merged.
2024-05-10 19:34:11 +03:00
win7-7 628b15aa34 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.
2024-05-10 19:34:11 +03:00
win7-7 c55d97f6ac Fallout from 1351107
Fallout from 1351107.
2024-05-10 19:34:11 +03:00
win7-7 254938c8d2 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.
2024-05-10 19:34:10 +03:00
win7-7 febdf25865 1225031
1225031.
2024-05-10 19:34:10 +03:00
win7-7 6ee19133b4 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.
2024-05-10 19:34:10 +03:00
win7-7 8bb290e8e5 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.
2024-05-10 19:34:10 +03:00
win7-7 42620b7b21 Trying this again.I want performance gain until stopping.
Trying this again.I want performance gain until stopping.
2024-05-10 19:34:10 +03:00
win7-7 3f1407630e https://hg.mozilla.org/mozilla-central/rev/3586c6c537791ff194d10746ee54e5836e2c23c4
https://hg.mozilla.org/mozilla-central/rev/3586c6c537791ff194d10746ee54e5836e2c23c4
2024-05-10 19:34:10 +03:00
win7-7 9e851ef8a7 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.
2024-05-10 19:34:10 +03:00
win7-7 8c875d5ba0 Revert "This might actually cause GC pausing not just benchmarking testing temporary."
This reverts commit 7c0ba280cc4006432a81c52140aaf4750daf2d1b.
2024-05-10 19:34:10 +03:00
win7-7 f980f89518 Fix some gray marking + void is still used not undefined.
Fix some gray marking + void is still used not undefined.
2024-05-10 19:34:09 +03:00
win7-7 7f133d224f 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
2024-05-10 19:34:09 +03:00
win7-7 5457359f00 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.
2024-05-10 19:34:09 +03:00
win7-7 639fb0e78a 1396931 - Simplify sweeping nursery allocated dictionary mode objects
1396931 - Simplify sweeping of dictionary mode objects allocated in the nursery
2024-05-10 19:34:09 +03:00
win7-7 89812295bd 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.
2024-05-10 19:34:09 +03:00
win7-7 bcbbf2368e 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.
2024-05-10 19:34:09 +03:00
win7-7 18abcf3fba OOM changes.
OOM changes. Not sure changes outside node were necessary but they were in branch so taking them at least for now.
2024-05-10 19:34:09 +03:00
win7-7 b7f90272c3 1330536
1330536
2024-05-10 19:34:09 +03:00
win7-7 a1953c1eb7 This might actually cause GC pausing not just benchmarking testing temporary.
This might actually cause GC pausing not just benchmarking testing temporary.
2024-05-10 19:34:09 +03:00
win7-7 b2d2200ecf Further changes again.
Further changes again. I have revert some changes temporary to be able compare to 55 js engine.
2024-05-10 19:34:08 +03:00
win7-7 4841a3cce6 Further changes.
Further changes.
2024-05-10 19:34:08 +03:00
win7-7 6cb4c13411 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.
2024-05-10 19:34:08 +03:00
win7-7 a1fe1978d5 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.
2024-05-10 19:34:08 +03:00
win7-7 3c67b9451d 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.
2024-05-10 19:34:08 +03:00
win7-7 e4affe2a84 Multi-threading dynamic import.
Multi-threading dynamic import.
2024-05-10 19:34:08 +03:00
win7-7 113577e233 1334409 - TraceLogging: Add memory reporter for TraceLogging
1334409 - TraceLogging: Add memory reporter for TraceLogging.
2024-05-10 19:34:08 +03:00
win7-7 1c8e690435 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.
2024-05-10 19:34:08 +03:00
win7-7 87edb7afef 1359436 - Add leak checking to CycleCollectedJSContext and related classes.
1359436 - Add leak checking to CycleCollectedJSContext and related classes.
2024-05-10 19:34:08 +03:00
win7-7 2a7d8c13ab Only taking this in due existing in 55 also. 1359653 was backed out in 55 already..
1363301 - Always provide live wrappers for ScriptSourceObjects.
2024-05-10 19:34:07 +03:00
win7-7 c3b8c3fc29 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.
2024-05-10 19:34:07 +03:00
win7-7 e2642e0717 1318627 - Remove Zone::active
1318627 - Remove Zone::active and related infrastructure.
2024-05-10 19:34:07 +03:00
André Bargull fab2eeb435 Bug 1380344 - Add Ion support for IsPackedArray. r=jandem 2024-05-10 19:34:07 +03:00
win7-7 ef7d00b103 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,
2024-05-10 19:34:06 +03:00
win7-7 12edf014ed 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.
2024-04-23 17:52:14 +03:00
win7-7 50f2f23d94 Bug 1429783 - Reset frozen state in nsIScriptElement::LoseParserInser… …tedness() r=smaug
Bug 1429783 - Reset frozen state in nsIScriptElement::LoseParserInsertedness() r=smaug
2024-04-23 17:52:14 +03:00
André Bargull 31085ea59b Bug 1372081 - Ion-inline FinishBoundFunctionInit for normal and bound functions
Bug 1372081 - Ion-inline FinishBoundFunctionInit for normal and bound functions
2024-04-23 17:52:13 +03:00
win7-7 c7df2bcc44 1368446 - Fix gray marking assertion failures by calling ExposeObjectToActiveJS in UncheckedUnwrap
1368446 - Fix gray marking assertion failures by calling ExposeObjectToActiveJS in UncheckedUnwrap
2024-04-23 17:52:13 +03:00
win7-7 7d6f560dca 1343590 - Improve CallArgs gray marking assertions
1343590 - Improve CallArgs gray marking assertions
2024-04-23 17:52:13 +03:00
win7-7 624deb2e3a 1340604 - Add more test code for weak map gray marking behaviour
1340604 - Add more test code for weak map gray marking behaviour
2024-04-23 17:52:13 +03:00
win7-7 0ff1fed569 1339770 - Add tests for gray marking of CCWs , partially only, add test later.
1339770 - Add tests for gray marking of CCWs
2024-04-23 17:52:12 +03:00
win7-7 9a49599661 1339770 - Add jsapi tests for weak map gray marking.
1339770 - Add jsapi tests for weak map gray marking.
2024-04-23 17:52:12 +03:00
win7-7 6ed00d1ba9 1334433 - Add gray marking jsapi tests
1334433 - Add gray marking jsapi tests
2024-04-23 17:52:12 +03:00
win7-7 2e34fc320d 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
2024-04-23 17:52:12 +03:00
win7-7 07ba3cfc33 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.
2024-04-23 17:52:12 +03:00
win7-7 4dc67f8b7d 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.
2024-04-23 17:52:12 +03:00
win7-7 a0eeb71b4f 1337502 - js::AutoCompartment should assert the same things JSAutoCompartment does
1337502 - AutoCompartment should have the same asserts as JSAutoCompartment.
2024-04-23 17:52:11 +03:00
win7-7 79335cb60e 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.
2024-04-23 17:52:10 +03:00
win7-7 07dba3711a 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.
2024-04-22 06:01:01 +03:00
win7-7 89520483c2 Missing pieces due zeal having still some relevance in UXP.
1352430 - Add zeal mode to exercise incremental foreground finalization
2024-04-22 05:48:47 +03:00
win7-7 ffd8f2e31f Multi-threading misses.
Multi-threading misses, lack of ActiveThreadOrGCTaskData in four locations where it should be used like 55 js engine had.
2024-04-22 04:48:34 +03:00
win7-7 d05f5f93eb 1354733 - Avoid wrapping dead wrappers into CCWs
1354733: Part 1 - Allow creating DeadObjectProxies directly.

1354733: Part 2 - Never rewrap dead wrappers.
2024-04-22 04:48:34 +03:00
win7-7 dcf0ad0ca5 1370823 - Don't evict the nursery in NukeCrossCompartmentWrappers and RecomputeWrappers
1370823 - Don't evict the nursery in NukeCrossCompartmentWrappers and RecomputeWrappers.
2024-04-22 04:48:34 +03:00
win7-7 ec3d3d63c4 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.
2024-04-22 04:48:33 +03:00
win7-7 d990bd922c 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.
2024-04-22 01:01:56 +03:00
win7-7 10a8959b5e 1369367 - Crash in mozilla::dom::WindowBinding::get_onunload
1369367. DOM callbacks can now store a null object; teach codegen to handle that.
2024-04-22 00:55:08 +03:00
win7-7 e1234df4c6 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.
2024-04-22 00:52:56 +03:00
win7-7 d360dbda12 1336988 - Crash in JSAutoCompartment::JSAutoCompartment | mozilla::dom::CallbackObjectHolderBase::ToXPCOMCallback
1336988: Correctly handle dead callback objects when iterating over event listeners.
2024-04-22 00:37:28 +03:00
win7-7 326176a583 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.
2024-04-22 00:30:51 +03:00
win7-7 a73f8009bd Fix assert.
Fix assert.
2024-04-21 01:15:49 +03:00
win7-7 da350be5e3 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.
2024-04-20 22:36:55 +03:00
win7-7 46681ed44c Fix long time ago missed change.
Fix long time ago missed change.
2024-04-20 16:40:36 +03:00
win7-7 b44f4b86e4 Fix crash hopefully.
Fix crash hopefully.
2024-04-20 16:38:53 +03:00
win7-7 2753b32fb7 Revert "Bug 1378740 - Share RegExpShareds across compartments within a zone. r=jonco"
This reverts commit 744b3a2029a59bab9d4ff10f79fc4396bd315b04.
2024-04-20 04:29:01 +03:00
win7-7 d3008e39fb 1368325 - js::gc::BarriersAreAllowedOnCurrentThread() shows up in performance profiles
1368325 - Remove JSContext::allowGCBarriers and related code as it's not used anywhere.
2024-04-20 04:29:01 +03:00
win7-7 614b3a40c7 1328252 - Always unbox NewArray/NewObject cached optimizations.
1328252 - IonMonkey: Always unbox NewArray/NewObject cached optimizations
2024-04-20 04:29:01 +03:00
win7-7 9d7edf480d 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.
2024-04-20 04:29:01 +03:00
win7-7 866fa65950 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.
2024-04-20 04:29:01 +03:00
win7-7 8c174b3de1 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.
2024-04-20 04:29:01 +03:00
Jan de Mooij 44c27fd00c Bug 1115355 - Optimize RegExpObject allocation in Ion. r=evilpie 2024-04-20 04:29:01 +03:00
win7-7 6644834f33 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
2024-04-20 04:29:01 +03:00
Jan de Mooij 3ddec557c2 Bug 1378740 - Share RegExpShareds across compartments within a zone. r=jonco 2024-04-20 04:29:00 +03:00
win7-7 cf58c2000b Bug 1373290 - Move object/string pre-barrier null check to JIT code. r=nbp
Speedometer gains to test.
2024-04-20 04:29:00 +03:00
win7-7 2c6ec969dd 1366263
RegExpMatcher, RegExpSearcher, and RegExpTester not always inlined in Speedometer

Focusing to optimize Speedometer, so more ports to optimize that.
2024-04-20 04:29:00 +03:00
win7-7 3c6eabe019 Bug 1384318 - Inline native check for emitMegamorphicLoadSlot variants. r=jandem
Inline native check for emitMegamorphicLoadSlot variants
2024-04-20 04:29:00 +03:00
André Bargull 39c7b683a6 Bug 1381891 - Inline IsTypedArray even when non-TypedArrays were observed. r=jandem 2024-04-20 04:29:00 +03:00
win7-7 3211d10154 Bug 1373615 - Clean up and optimize property enumeration code. r=evilpie
Hopefully to speed up Speedometer further
2024-04-20 04:29:00 +03:00
win7-7 34e783f953 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.
2024-04-20 04:29:00 +03:00
Jan de Mooij 1fdc6b8aad Bug 1383343 part 2 - Add a cache for Function.prototype.toString. r=anba 2024-04-20 04:29:00 +03:00
Jan de Mooij 481fa91411 Bug 1383343 part 1 - Avoid StringBuffer overhead in FunctionToString in the common case. r=anba 2024-04-20 04:28:59 +03:00
Ted Campbell f2bdab9493 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
2024-04-20 04:28:59 +03:00
Ted Campbell 0585e66d1b Bug 1377051 - Support JSOP_SETPROP_SUPER in Baseline r=jandem
MozReview-Commit-ID: LNOVCntYDsM

--HG--
extra : rebase_source : 987cd42d72fc3beca649025295a9ac725c31b88b
2024-04-20 04:28:59 +03:00
Iain Ireland 4573900173 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.]
2024-04-20 04:28:59 +03:00
win7-7 d324e729a4 Restore super for BytecodeEmitter.h
Restore super for BytecodeEmitter.h
2024-04-20 04:28:59 +03:00
André Bargull c412c0cb24 Bug 1472211 - Part 2: Reorder operands in Super-Elem bytecode operations. r=arai 2024-04-20 04:28:59 +03:00
Jan de Mooij 9f3735a156 Bug 1410683 - Adjust BaselineFrame frameSize when pushing extra value for JSOP_GETELEM_SUPER. r=evilpie 2024-04-20 04:28:59 +03:00
Tom Schuster c1a6f484b2 Bug 1378186 - Implement super.property in Ion. r=jandem 2024-04-20 04:28:59 +03:00
Tom Schuster 79e5dd5d95 Bug 1378186 - Fix GetElemSuper stack handling in baseline. r=jandem 2024-04-20 04:28:59 +03:00
Ted Campbell d23ebcde94 Bug 1169745 - Support JSOP_GETELEM_SUPER in Baseline. r=jandem
MozReview-Commit-ID: BDrZvZ5n3Q4
2024-04-20 04:28:58 +03:00
Ted Campbell 39d791d61f Bug 1169745 - Support JSOP_GETPROP_SUPER in Baseline. r=jandem
MozReview-Commit-ID: KTeUTsRpDWq
2024-04-20 04:28:58 +03:00
Ted Campbell 84e93e2b1d Bug 1169745 - Fix vm/Opcodes.h for JSOP_GETPROP_SUPER / JSOP_GETELEM_SUPER. r=jandem
MozReview-Commit-ID: 88UehsiXP0i
2024-04-20 04:28:58 +03:00
Ted Campbell c8eea8d7d8 Bug 1169746 - Handle JSOP_SPREADSUPERCALL correctly in ICCall_Native. r=sstangl
MozReview-Commit-ID: KEWS1s4Y9dL
2024-04-20 04:28:58 +03:00
Ted Campbell 338d492f67 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
2024-04-20 04:28:58 +03:00
Ted Campbell fb798f678c 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
2024-04-20 04:28:58 +03:00
Ted Campbell c170bdb63f Bug 1169745 - Support JSOP_SUPERBASE in Baseline. r=jandem
MozReview-Commit-ID: QA2j2Wsrs8
2024-04-20 04:28:58 +03:00
win7-7 727e6fbcc5 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.
2024-04-20 04:28:58 +03:00
Ted Campbell b4c053b3c2 Bug 1169745 - JSOP_GETPROP_SUPER should Typescript::Monitor. r=jandem
MozReview-Commit-ID: IRRNhDBzMAF
2024-04-20 04:28:57 +03:00
Shu-yu Guo ca1cff10c7 Bug 1374462 - Fix super getprop and super getelem to not box 'this' values. (r=jorendorff) 2024-04-20 04:28:57 +03:00
André Bargull eac15753cd Bug 1379639 - Move Number.isInteger to self-hosted code and avoid bailouts in isSafeInteger. r=jandem 2024-04-20 04:28:57 +03:00
win7-7 a5273c59f5 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
2024-04-20 04:28:57 +03:00
Kannan Vijayan bf400873f7 Bug 1366377 - Optimize single-char splitting in VM. r=jorendorff. 2024-04-20 04:28:57 +03:00
Kannan Vijayan fe4a8303ac Bug 1366377 - Unify StringSplitString ObjectGroup and fix Ion MCallOptimize. r=tcampbell
# Conflicts:
#	js/src/jit/MIR.h
2024-04-20 04:28:57 +03:00
Kannan Vijayan c9912bdb42 Bug 1366377 - Add CacheIR stub for String_split. r=tcampbell 2024-04-20 04:28:57 +03:00
Jan de Mooij f11929991d Bug 1397071 - Call InitElemOperation in IonSetPropertyIC::update to support more cases. r=anba 2024-04-20 04:28:57 +03:00
Tom Schuster ab272bb688 Bug 1344483 - Remove MInitProp from Ion. r=jandem 2024-04-20 04:28:56 +03:00
Tom Schuster 1b5eca77fd Bug 1344483 - Use an IC for JSOP_INITPROP in Ion. r=jandem 2024-04-20 04:28:56 +03:00
Tom Schuster b66232a6ae Bug 1344483 - Nop jsop_toid for string/symbol. r=jandem 2024-04-20 04:28:56 +03:00
Jan de Mooij 11bdf03021 Bug 1423139 - Don't attach a SetArrayLength stub for JSOP_INITELEM. r=evilpie 2024-04-20 04:28:56 +03:00
Jan de Mooij d938de496d Bug 1397026 - Make sure JSOP_INIT* IC behavior matches [[DefineOwnProperty]] instead of [[Set]]. r=anba 2024-04-20 04:28:56 +03:00
Jan de Mooij b2d14d2e6a Bug 1376691 - Improve Ion-inlining of Array.isArray. r=nbp 2024-04-20 04:28:56 +03:00
Jan de Mooij 63ce32dda8 Bug 1385215 part 2 - Inline Object.prototype.toString in Ion. r=evilpie 2024-04-20 04:28:56 +03:00
Jan de Mooij 2186c761c1 Bug 1385215 part 1 - Ion-inline native calls in jsop_funcall/jsop_funapplyarguments. r=nbp 2024-04-20 04:28:55 +03:00
Jan de Mooij 6c380a5045 Bug 1376799 - Optimize Object.prototype.toString. r=evilpie
--HG--
extra : rebase_source : 01f1dfcdf9bb991c8c40cf8dc9b521501456350f
2024-04-20 04:28:55 +03:00
André Bargull 42f7e16e60 Bug 1383644 - Inline ToObject when called with MIRType::Value. r=jandem 2024-04-20 04:28:55 +03:00
André Bargull f5f46d67da Bug 1303335: Move parts of Object.getOwnProperty and Object.defineProperty to self-hosted code. r=till 2024-04-20 04:28:55 +03:00
win7-7 d63973d7be 1353358 - Support JSOP_OPTIMIZE_SPREADCALL in Ion
1353358 - Use IfThenElseEmitter when optimizing spreadcall

1353358 - Support JSOP_OPTIMIZE_SPREADCALL in Ion
2024-04-20 04:28:55 +03:00
win7-7 db35816c5f 1342882 - Hit MOZ_CRASH(unexpected type) at js/src/jit/Lowering.cpp:2323
1342882: IonMonkey - Don't allow magic types for concatenation
2024-04-20 04:28:55 +03:00
win7-7 7187a265e7 1328148 - Use MConcat for more cases
1328148: IonMonkey - Use MConcat for more cases.
2024-04-20 04:28:55 +03:00
win7-7 df25253b19 Bug 1505385: Fix exception handling in IsDuckTypedErrorObject r=tcampbell
Fix exception handling in IsDuckTypedErrorObject
2024-04-20 04:28:55 +03:00
win7-7 0f8b8f2d2d 1338920 - Make spreadcall work in Ion
1338920 - Support JSOP_SPREADCALLARRAY in Ion.

1338920 - Support JSOP_SPREADCALL in Ion.
2024-04-20 04:28:55 +03:00
win7-7 e29432f9ae 1346028 - Ion: Implement INITELEM_INC
1346028 - Allow MCallInitElementArray to take dynamic index.

1346028 - Support JSOP_INITELEM_INC in Ion.
2024-04-20 04:28:54 +03:00
win7-7 2100422d48 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.
2024-04-20 04:28:54 +03:00
win7-7 3e054e2dba 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.
2024-04-20 04:28:54 +03:00
win7-7 c483b14432 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.
2024-04-20 04:28:54 +03:00
win7-7 bfdb70af6c 1369042 - Optimize the @@toStringTag and @@toPrimitive lookups
1369042 - Optimize @@toStringTag and @@toPrimitive property lookups in the VM.
2024-04-20 04:28:54 +03:00
win7-7 fff0e2db73 1341263 - Optimize null/undefined comparisons more in CompareIC
1341263 - Optimize null/undefined comparisons more in CompareIC.
2024-04-20 04:28:54 +03:00
win7-7 e421e88a28 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.
2024-04-20 04:28:54 +03:00
win7-7 6c0ce4725e 1336216 - IONFLAGS=logs Does not work on Win32
1336216 - Fix JIT_SPEW_DIR on Win32.
2024-04-20 04:28:54 +03:00
win7-7 46e82487d8 1339481 - Structured clone can be really slow
1339481 - Specialize writing bytes in structured clone
2024-04-20 04:28:54 +03:00
win7-7 799918c6c2 1372956 - Assertion failure: !denseElementsAreFrozen(), at js/src/vm/NativeObject-inl.h:266
1372956 - Fix unshift fast path to check for frozen elements.
2024-04-20 04:28:53 +03:00
win7-7 6edada4850 1373356 - Assertion failure: getDenseCapacity() == 0, at js/src/vm/NativeObject-inl.h:310
1373356 - Fix NativeObject::sparsifyDenseElements to discard shifted elements.
2024-04-20 04:28:53 +03:00
win7-7 5d5c65f279 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.
2024-04-20 04:28:53 +03:00
win7-7 f64fe7c07d 1350864 - Freezing an array does not set non-writable length correctly
1350864 - Fix SetIntegrityLevel to set non-writable length correctly when freezing arrays.
2024-04-20 04:28:53 +03:00
win7-7 8bc06235a3 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.
2024-04-20 04:28:52 +03:00
win7-7 2316f6fae1 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.
2024-04-18 22:04:17 +03:00
win7-7 6d20b66e1f 1302441 - Break assertion down into smaller assertions.
1302441 - Break assertion down into smaller assertions.

For 1348772.
2024-04-18 18:01:40 +03:00
win7-7 2e003e0cb9 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.
2024-04-18 16:36:40 +03:00
win7-7 29f62143d6 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.
2024-04-18 16:36:31 +03:00
win7-7 fdb3594bfe 1341367 assertion fix.
1341367 assertion fix.
2024-04-18 16:36:23 +03:00
win7-7 a274e871aa 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
2024-04-18 14:59:25 +03:00
win7-7 0e2351bdb8 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.
2024-04-18 14:59:25 +03:00
win7-7 64e598feb7 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.
2024-04-18 14:07:02 +03:00
win7-7 fae026b69b 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
2024-04-18 14:07:01 +03:00
win7-7 3e5bca1ede 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.
2024-04-18 14:07:01 +03:00
Jon Coppeard 9a365a9bc6 Bug 1402649 - Fix valid GC cell pointer asserts and error handling in module instantiation r=sfink 2024-04-18 14:07:01 +03:00
Jon Coppeard 63f4105e6b Bug 1399944 - Check for valid GC cell pointers in various places r=sfink 2024-04-18 14:07:01 +03:00
Jon Coppeard e1756590fc Bug 1399933 - Replace use of ObjectValueCrashOnTouch with PoisonedObjectValue r=sfink 2024-04-18 14:07:00 +03:00
win7-7 070a5de4b0 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.
2024-04-18 14:06:59 +03:00
win7-7 9e42c1ff1e Fix debug revealed error.
Fix debug revealed error.
2024-04-18 02:38:48 +03:00
win7-7 8e09213578 Bug 1506524: Handle LambdaArrow in MFunctionEnvironment::foldsTo. r=nbp
Handle LambdaArrow in MFunctionEnvironment::foldsTo.
2024-04-18 02:38:48 +03:00
win7-7 2a79a7f65d 1336579 - [meta] Attach SetProp Function prototype
1336579 - Attach AddSlot stubs for setting function.prototype.
2024-04-18 02:38:48 +03:00
André Bargull a490201b52 Bug 1380111 - Inline iterator code into Map/Set forEach to avoid extra allocations. r=till
--HG--
extra : rebase_source : 1244d9d9b19b25b19728da4b94ce0c391cab8ad2
extra : histedit_source : c6b736c9f005e51cb366a0f241be2b4a5dcdf2c3
2024-04-18 02:38:48 +03:00
win7-7 cb4c208f5a 1366372 - Array.from is way too slow
1366372 - Remove performance pitfalls in Array.from method.
2024-04-18 02:38:48 +03:00
win7-7 3bcf86a412 1350896 - Use Ion GetElem/SetElem ICs in more cases
1350896 - Use Ion GetElem/SetElem ICs in more cases.
2024-04-18 02:38:48 +03:00
win7-7 7824938d73 1340496 - CacheIR: Add SetProp/SetElem WindowProxy stubs
1340496 - Add IC support for setting existing properties on WindowProxies.
2024-04-18 02:38:48 +03:00
win7-7 62b589cb48 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.
2024-04-18 02:38:47 +03:00
win7-7 64b93b8c2a 1337773 - Add an Ion IC for JSOP_IN
1337773 - Add IonInIC

1337773 - Use IonInIC for MIn and rename to MInCache
2024-04-18 02:38:47 +03:00
win7-7 e74958e316 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.
2024-04-18 02:38:47 +03:00
win7-7 1aa8ac54a4 1351388 - InIRGenerator::tryAttachNativeIn should handle non-data properties
1351388 - Allow non-data properties in InIRGenerator::tryAttachNativeIn
2024-04-18 02:38:47 +03:00
André Bargull 2f33e2efab Bug 1380087 - Add an intrinsic to test for Map and Set objects. r=till 2024-04-18 02:31:33 +03:00
Tom Schuster 0608259633 Bug 1383646 - Optimize x.indexOf(x) for AngularJS. r=anba 2024-04-18 02:31:33 +03:00
André Bargull 02c557ed14 Bug 1430800: Optimize String.raw by avoiding rest-parameter array allocation. r=evilpie 2024-04-18 02:31:32 +03:00
Jan de Mooij d519d684a9 Bug 1388354 - Optimize ToPropertyKey a bit. r=anba 2024-04-18 02:31:32 +03:00
Jon Coppeard 3d2204b276 Bug 1380778 - Fixup shape pointers into the nursery using a dedicated list r=sfink
1380778 - Fix review comment I missed
2024-04-18 02:31:32 +03:00
win7-7 88fc7eaea1 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
2024-04-18 02:31:32 +03:00
Jon Coppeard d88e7b71a7 Bug 1367795 - Use multiple parallel tasks for weak cache sweeping r=sfink 2024-04-18 02:31:32 +03:00
Jon Coppeard 5bd35904ed Bug 1367795 - Use a single parallel task for weak cache sweeping r=sfink 2024-04-18 02:31:32 +03:00
Jon Coppeard 97136f3bee Bug 1367795 - Add tests for incremental weak cache sweeping r=sfink 2024-04-18 02:31:32 +03:00
Jon Coppeard d61d5d385a Bug 1367795 - Move weak cache sweeping out of the initial slice for the sweep group r=sfink 2024-04-18 02:31:32 +03:00
Jon Coppeard b1adcf7e06 Bug 1367795 - Allow movable cell hashing to handle matching against a dead table entry r=sfink 2024-04-18 02:31:32 +03:00
Jon Coppeard 866092128f Bug 1367795 - Refactor movable cell hashing methods to move them to MovableCellHasher<T> r=sfink 2024-04-18 02:31:32 +03:00
Jon Coppeard 0681d2148e Bug 1367795 - Add barriers to JS::WeakCache for GCHashMap r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard b7509b44be Bug 1367795 - Add barriers to JS::WeakCache for GCHashSet r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard d3e111e57a Bug 1367795 - Specialise JS::WeakCache for GCHashMap so we can add barriers r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard d24fe1ef01 Bug 1367795 - Specialise JS::WeakCache for GCHashSet so we can add barriers r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard 8c0dcda3c7 Bug 1367795 - Refactor some use of WeakCache r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard 2e13337427 Bug 1376096 - Add per-sweep-group actions in addition to per-zone actions r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard 5d5a8cd017 Bug 1376101 - Remove some unnecessary read barriers r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard 0eacb090ce Bug 1373209 - Use non-mutating iterator when checking tables after moving GC r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard 40f518359a Bug 1372524 - Add missing explicit keywords r=me 2024-04-18 02:31:31 +03:00
Jon Coppeard 6de4590b68 Bug 1371234 - Clear GC edges when deleting a GC managed object outside a GC r=sfink 2024-04-18 02:31:31 +03:00
Jon Coppeard 793027b533 Bug 1372569 - Skip sweeping empty weak caches r=sfink 2024-04-18 02:31:30 +03:00
Jon Coppeard e8a4ed6fa0 Bug 1372524 - Refactor WeakCache implementation a little r=sfink 2024-04-18 02:31:30 +03:00
win7-7 e032ff1842 1370069 - Crash [@ js::GCMarker::eagerlyMarkChildren] and various other crashes and assertions involving gczeal(17)
1370069 - Fix several issues with incremental atom sweeping
2024-04-18 02:31:30 +03:00
win7-7 04688d3eed 1369444 - Sweep the atoms table incrementally
1369444 - Sweep the atoms table incrementally.
2024-04-18 02:31:30 +03:00
win7-7 f5a685ce80 Add newline back to end.
Add newline unsure when this get accidentally removed. Figure out order later.
2024-04-18 02:31:30 +03:00
Jan de Mooij e9a3eff8c0 Bug 1372182 part 9 - Inline more functions. r=anba 2024-04-18 02:31:30 +03:00
Jan de Mooij 01bf8ced84 Bug 1372182 part 8 - Optimize AddTypePropertyId. r=evilpie 2024-04-18 02:31:30 +03:00
Jan de Mooij 0106b2c98a Bug 1372182 part 7 - Inline some more functions. r=anba 2024-04-18 02:31:30 +03:00
Jan de Mooij 259873eb35 Bug 1372182 part 6 - Inline PurgeEnvironmentChain. r=anba 2024-04-18 02:31:30 +03:00
Jan de Mooij 7adc3c8699 Bug 1372182 part 5 - Inline PropertyTree::getChild in NativeObject::getChildProperty. r=evilpie 2024-04-18 02:31:29 +03:00
Jan de Mooij 3d02d60dfd Bug 1372182 part 4 - Refactor/optimize PropertyTree::getChild a bit. r=jonco 2024-04-18 02:31:29 +03:00
Jan de Mooij 599f17bae6 Bug 1372182 part 3 - Merge jspropertytree.* with vm/Shape.* r=evilpie 2024-04-18 02:31:29 +03:00
Jan de Mooij da10ca4925 Bug 1372182 part 2 - Refactor NativeObject::allocSlot to make things faster for non-dictionary objects. r=anba 2024-04-18 02:22:53 +03:00
Jan de Mooij 54d0f2c609 Bug 1372182 part 1 - Inline NativeObject::dynamicSlotsCount and related methods. r=anba 2024-04-18 02:22:53 +03:00
win7-7 323a9119b3 1386685 Inline StackDefs and StackUses
Inline StackDefs and StackUses, Speedometer.
2024-04-18 02:22:53 +03:00
win7-7 72913c5a71 1339535 - JSObject::setHadElementsAccess happens too early
1339535 - Set the hadElementsAccess flag less eagerly to avoid unnecessary Shape changes.
2024-04-18 02:22:53 +03:00
win7-7 974b578b42 1414238 - Optimize BaselineCompiler::emitBody a bit
1414238 - Optimize BaselineCompiler::emitBody a bit.
2024-04-18 02:22:53 +03:00
win7-7 5f3197eee2 1354582 - call/apply inlining should support non-singleton callees
1354582 - Support non-singleton functions in IonBuilder::getSingleCallTarget.
2024-04-18 02:22:52 +03:00
win7-7 c10324f4ca 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.
2024-04-18 02:22:51 +03:00
win7-7 52d70a588d 1322445 - Switch PageProtectingVector from protecting fully used pages to fully unused pages.
1322445 - Extend PageProtectingVector to protect unused pages as well.
2024-04-18 00:23:04 +03:00
win7-7 16f820a139 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...
2024-04-18 00:23:04 +03:00
win7-7 ee81d4262e 1364288 - TSan: thread races on global TestingFunctions state vars
1364288 - Fix thread races on global JS shell vars
2024-04-18 00:23:04 +03:00
win7-7 bfd6b8c476 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.
2024-04-18 00:23:04 +03:00
win7-7 52fe5e056e 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.
2024-04-18 00:23:03 +03:00
win7-7 51535fe9c3 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.
2024-04-18 00:23:03 +03:00
win7-7 bd1bf0a3e2 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.
2024-04-18 00:23:03 +03:00
win7-7 8fa957e3ee 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.
2024-04-18 00:23:03 +03:00
win7-7 5701b9f7a6 1369774 - Assertion failure: types, at js/src/jit/SharedIC.cpp:2560 with TypedObject
1369774 - Fix ICUpdatedStub::addUpdateStubForValue to handle TypedObjects correctly.
2024-04-18 00:23:03 +03:00
win7-7 b4cc364da9 1368509 - Generalize Baseline type update stubs
1368509 part 1 - Clean up DoTypeUpdateFallback a bit.

1368509 part 2 - Generalize Baseline unknown/unknownObject type update stubs.
2024-04-18 00:23:02 +03:00
win7-7 4a2c246152 1350263 - Port Baseline TypeOf IC to CacheIR
1350263 - Primitive typeof CacheIR support.

1350263 - Ion/MacroAssembler typeof object improvements.

1350263 - Typeof object CacheIR support.
2024-04-17 23:24:24 +03:00
win7-7 bb754cce93 1358047 - Move Baseline CacheIR stubcode map from JitCompartment to JitZone
1358047 - Move Baseline CacheIR code map from JitCompartment to JitZone.
2024-04-17 23:24:24 +03:00
win7-7 d8946757c7 1357468 - Optimize Object.hasOwnProperty on Speedometer
1357468 - More Object.hasOwnProperty optimizations for Speedometer.
2024-04-17 23:24:24 +03:00
win7-7 60c34662e9 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.
2024-04-17 23:24:24 +03:00
win7-7 fdcfa4d441 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.
2024-04-17 23:24:24 +03:00
win7-7 7318a54200 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.
2024-04-17 23:24:24 +03:00
win7-7 d137ac6d9c 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.
2024-04-17 23:24:24 +03:00
win7-7 be320ce908 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.
2024-04-17 23:24:23 +03:00
win7-7 2368833a7a 1345160 - Assertion failure: maybeTempDouble != InvalidFloatReg, at js/src/jit/IonCacheIRCompiler.cpp:1367
1345160 - Fix LIRGenerator::visitSetPropertyCache to consider INITELEM* ops too.
2024-04-16 19:36:21 +03:00
win7-7 fda136ed86 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.
2024-04-16 19:36:20 +03:00
win7-7 a66dd0ca75 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.
2024-04-16 13:49:45 +03:00
win7-7 ce1db324e7 1336580 - AddSlot ICs fail because of unperformed new script analysis
1336580 - Attach AddSlot stubs before we run the new-script analysis.
2024-04-16 13:31:16 +03:00
win7-7 ea102bfe8b 1337763 - Attach In stub for DenseElementHole
1337763 - Factor out GeneratePrototypeHoleGuards

1337763 - Add DenseInHole IC to CacheIR
2024-04-16 13:09:22 +03:00
win7-7 6474fbaf4c 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.
2024-04-16 02:29:38 +03:00
win7-7 fd5f7453c1 1326213 - Unneeded abort at "Cannot inspect prototype chain."
1326213 - IonMonkey: Don't abort when trying to speculate on unstable proto.
2024-04-16 01:39:01 +03:00
win7-7 0853614cc3 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.
2024-04-15 22:19:06 +03:00
win7-7 08afa0077e 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,
2024-04-15 20:20:20 +03:00
win7-7 90ee6164fc 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
2024-04-15 20:20:11 +03:00
win7-7 88a9977260 Remove duplication.
Remove duplication.
2024-04-15 20:20:00 +03:00
win7-7 f0831439b9 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.
2024-04-15 06:03:57 +03:00
win7-7 4014f3df94 Re-reverting 1323099 with AbortReasonOr.
Re-reverting with AbortReasonOr/reinstating 1323099 back to js engine.

Seems this does fix crash now with AbortReasonOr used.
2024-04-15 05:49:44 +03:00
win7-7 55fe5d748a 1338825 - CacheIR: Attach the addSlot stub for Arrays
1338825 - CacheIR: Attach the addSlot stub for Arrays.
2024-04-15 05:47:39 +03:00
win7-7 da93ee00a2 338323 - CacheIR should not attach SetArrayLength stub for non-writable length
1338323 - Don't attach SetArrayLength stub if length is not writable.
2024-04-15 05:47:30 +03:00
win7-7 7abb44da2e 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.
2024-04-15 04:08:52 +03:00
win7-7 187ecd28af 1351951
1351951 - Cleanup InitFromBailout to fight bit-rot

1351951 - Add ICStubCompiler::assumeStubFrame

1351951 - Cleanup GetStubReturnAddress handling
2024-04-15 02:55:00 +03:00
win7-7 dc702c8386 Fix and back to square one.
Fix and back to square one.

Original crash is back.. AbortReasonOr did not fix it.
2024-04-15 02:19:15 +03:00
win7-7 9a216abb41 Rervert this also.
Rervert this also.
2024-04-15 02:00:34 +03:00
win7-7 953c43ca66 Another revert.
Another revert.
2024-04-15 01:31:03 +03:00
win7-7 0d4cf78dc2 Fixes to reverting.
Fixes to reverting.
2024-04-15 01:11:20 +03:00
win7-7 a43c69d359 Revert.
Revert.
2024-04-15 00:48:59 +03:00
win7-7 f41d3f1b4e Revert "Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Ion on Intel32/64."
This reverts commit 8f26f1a873.
2024-04-15 00:33:57 +03:00
win7-7 cdd998842c Revert "Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Doubles in Ion."
This reverts commit dca8417ba7.
2024-04-15 00:32:22 +03:00
win7-7 433722f499 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.
2024-04-15 00:16:08 +03:00
win7-7 0f03218651 1324829 - Add mozilla::Result::andThen
1324829 - Add the `mozilla::Result::andThen` method;
2024-04-15 00:16:08 +03:00
win7-7 a2a1740b05 Fix 5.
Fix 5.
2024-04-15 00:16:08 +03:00
win7-7 cd206eebf4 Fix.
Fix.
2024-04-14 23:38:27 +03:00
win7-7 b158e9ea8f Fixes 3.
Fixes 3.
2024-04-14 22:23:14 +03:00
win7-7 15df16e324 Fixes 2
Fixes 2
2024-04-14 22:08:36 +03:00
win7-7 c7731e02dd Fixes.
Fixes. Pending, still not working.
2024-04-14 21:45:20 +03:00
win7-7 1987259efd 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.
2024-04-14 21:30:06 +03:00
Jan de Mooij 8af078cff2 Bug 1391611 - Devirtualize MNode::kind(). r=nbp
Sigh seems without doing 1392530 abstract class, hmph. Its too much work again.
2024-04-14 20:18:52 +03:00
win7-7 5c9e7d673b Fixes.
Fixes.

Mostly BigIntl misses and various other post-AbortReason additions.
2024-04-14 18:43:31 +03:00
win7-7 d0ba446b7f 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.
2024-04-14 16:51:43 +03:00
win7-7 ec9a51d489 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.
2024-04-14 16:48:07 +03:00
win7-7 35ab18b55c 1286505 part 3 - IonBuilder::jsop_getname, remove useless push & pop.
1286505 part 3 - IonBuilder::jsop_getname, remove useless push & pop.
2024-04-14 16:45:09 +03:00
win7-7 7890d16d99 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.
2024-04-14 16:44:04 +03:00
win7-7 380eadbce9 1286505 part 1
1286505 part 1 - Convert AbortReason enum to an enum class.

Merge part 2 and 3 after seeing compilation and working.
2024-04-14 03:33:40 +03:00
win7-7 c27f9b9514 Revert.. 1323099
Revert.. 1323099

Yep its cause of crashing right now.
2024-04-13 23:07:29 +03:00
win7-7 73ff0451c9 1360523 - Make the number of reserved slots dynamic for proxy classes
1360523 - Define number of reserved slots explicitly for each proxy js::Class.
2024-04-13 22:46:45 +03:00
win7-7 297d138d88 1360520 - Use grayLinkExtraSlot instead of hard coding 1 in ProxyObject::trace
1360520 - Add a GrayLinkReservedSlot constant and use it instead of hardcoding 1.
2024-04-13 22:46:45 +03:00
win7-7 17f999f099 1356691 - Make DeadObjectProxies preserve IsCallable and IsConstructor statically instead of an extra slot
1356691 - Preserve DeadObjectProxy's IsCallable and IsConstructor values statically with templates.
2024-04-13 22:46:45 +03:00
win7-7 0603b66102 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.
2024-04-13 22:28:37 +03:00
win7-7 d031081111 1386700 Move trivial MBasicBlock accessors to the header file
Define some trivial MBasicBlock methods in the header file so the compiler can inline them
2024-04-13 21:07:51 +03:00
win7-7 fd3ee6b65f 1339207 - Always build CacheIRSpewer in Nightly
1339207 - Always build CacheIRSpewer in Nightly builds.

Get this to compile.
2024-04-13 19:21:09 +03:00
win7-7 96db97db34 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.
2024-04-13 18:39:36 +03:00
win7-7 b686edad72 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.
2024-04-13 18:19:23 +03:00
win7-7 ac5c565e78 Various fixes
Various fixes.

Mostly misses in previous porting.
2024-04-13 17:55:08 +03:00
win7-7 a097cbe67e Fixes + 1341061 - Refactor NAME-related runtime functions.
1341061 - Refactor NAME-related runtime functions.
2024-04-13 17:05:36 +03:00
win7-7 fe8ee4ab94 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.
2024-04-13 16:31:53 +03:00
win7-7 fa33e7fcb5 Fixes.
Fixes.
2024-04-13 16:11:28 +03:00
win7-7 401a9e3937 1328140 - Handle IC failures better
1328140 - Improve handling of IC failures, add megamorphic IC stubs.
2024-04-13 15:55:40 +03:00
win7-7 7de4ae1cb9 1344198 - Inline various Shape search functions.
1344198 - Inline various Shape search functions.
2024-04-13 14:24:17 +03:00
win7-7 2881f11a40 1349298 - Assertion failure: numOptimizedStubs_ < 16, at js/src/jit/ICState.h:104
1349298 - Add a stub limit to Baseline's TypeOf IC.
2024-04-13 14:16:11 +03:00
win7-7 457d69606d 1345707 - Assertion failure: nonProxyIsExtensible(), at js/src/vm/NativeObject.cpp:848
1345707 - Don't attach set-dense-hole stubs for non-extensible objects.
2024-04-13 14:14:23 +03:00
win7-7 314c232381 1344691 - CacheIR: dense element stub should support element (re)allocation
1344691 - Make add-dense-element stub support element (re)allocation.
2024-04-13 14:12:19 +03:00
win7-7 441c661f6a 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.
2024-04-13 13:55:08 +03:00
win7-7 ea59448ce4 1344218 - Remove holder and holderShape arguments from IonBuilder::testCommonGetterSetter
1344218 - Rewrite IonBuilder::testCommonGetterSetter to search for the holder instead of taking it as argument.
2024-04-13 13:06:41 +03:00
win7-7 06571fc30f 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.
2024-04-13 13:06:40 +03:00
win7-7 bc9358cf16 Fixes.
Fixes.

1328140 nothing further will work without it.
2024-04-13 03:53:59 +03:00
win7-7 468b342cf2 1342856 - CacheIR: optimize volatile register spilling in IC code
1342856 - Optimize volatile register spilling for C++ calls from IC stubs.
2024-04-13 03:00:26 +03:00
win7-7 89d4c5e60d 1333067 - Remove old Ion GetPropertyIC code
1333067 - Remove old Ion GetPropertyIC code.
2024-04-13 02:59:44 +03:00
win7-7 3bcde029b8 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.
2024-04-13 02:12:54 +03:00
win7-7 1b492fd251 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.
2024-04-13 01:52:18 +03:00
win7-7 2cafbee461 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.
2024-04-13 01:49:39 +03:00
win7-7 0f00238263 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.
2024-04-13 00:23:48 +03:00
win7-7 ba6de14368 1319087 - CacheIR: optimize cross-compartment wrappers
1319087 - Implement a CrossCompartmentWrapper IC stub.

1342170 - Fixes jscompartment inlines for js/src/jit files.
2024-04-13 00:00:26 +03:00
win7-7 0ff46bc423 1331034 - CacheIR: Debugging Tools
1331034 - Introduce a JSONPrinter class.

1331034 - Make JSONSpewer inherit from JSONPrinter.

1331034 - Introduce CacheIRSpewer.
2024-04-12 22:18:57 +03:00
win7-7 9b9355af4a 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.
2024-04-12 22:18:56 +03:00
win7-7 3c629fb796 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.
2024-04-12 22:18:56 +03:00
win7-7 ec6a268fca 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.
2024-04-12 22:18:55 +03:00
win7-7 fd01c1b5f1 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.
2024-03-30 20:00:56 +02:00
win7-7 814dbc8985 1334727 - CacheIR: Set array length IC
1334727 - CacheIR: SetProp array length IC.
2024-03-30 19:49:23 +02:00
win7-7 ec594f011d 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.
2024-03-30 19:49:23 +02:00
win7-7 5e155729b5 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.
2024-03-30 05:07:22 +02:00
win7-7 6a0844bafa 1367455 - Scheduled GCs should avoid interrupting running GCs
1367455 - Attempt to avoid interrupting currently running GCs.
2024-03-30 00:29:09 +02:00
win7-7 6e777e9b93 1325686: De-unify Interpreter.cpp.
1325686: De-unify Interpreter.cpp.

Increases compilation time of files its unified with.
2024-03-30 00:29:07 +02:00
win7-7 c7c8a12996 Merge branch 'build-everything-unified' into UXP-custom-new-hybrid-js-engine-IonControlFlow-splitting-unified-building-fully 2024-03-29 23:52:37 +02:00
win7-7 857c5d58f6 1358504 - Add a 1-entry cache to ObjectGroup::defaultNewGroup
1358504 - Add a 1-entry cache to ObjectGroup::defaultNewGroup.
2024-03-29 23:52:14 +02:00
win7-7 e61d2ae1f7 1341090 -Update malloc bytes count when allocating executable memory
1341090: Refactor malloc counters in Zone and GCRuntime.

1341090: Implement a JIT code counter.
2024-03-29 23:52:06 +02:00
win7-7 c02c9501af 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.
2024-03-29 22:55:14 +02:00
win7-7 97f7f4c96a 1351357 - OffMainThread XDR Decoding fails to decode RegExp.
1351357 - Use the ReadOnlyCompileOptions from the HelperThread while decoding RegExp.
2024-03-29 22:55:14 +02:00
win7-7 4db011908a 1358521 - XDROffThreadDecoder fails to decode inner functions (Gecko)
1358521 - XDRScript: Only fail on mismatch between the top-level JSScript and the decoding CompileOption.
2024-03-29 22:55:14 +02:00
win7-7 2ebaf1fa0b 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.
2024-03-29 22:55:12 +02:00
win7-7 a994a4cc0f 1321437 - Differential Testing: Different output message involving Object.freeze
1321437 - Fix ThrowReadOnlyError to match the error message we would throw in the VM.
2024-03-29 20:23:33 +02:00
win7-7 f5cd021bb3 1324020 - Unreachable code in EnumerableOwnProperties?
1324020 - Remove unreachable code in EnumerableOwnProperties function.
2024-03-29 20:12:41 +02:00
win7-7 32b7be5f5f 1320989 - Remove unused dead zone state in GCRuntime
1320989 - Remove unused state in GCRuntime related to dead zones
2024-03-29 19:16:41 +02:00
win7-7 a1e2f91f81 1359093 - Inline the ToWindowProxyIfWindow is-global check
1359093 - Inline the ToWindowProxyIfWindow is-global check.
2024-03-29 18:54:51 +02:00
win7-7 25aa18f502 1323242 - Ignore spurious wakeups when waiting for background sweeping to finish
1323242 - Ignore spurious wakeups when waiting for background thread to finish sweeping.
2024-03-29 18:38:11 +02:00
win7-7 fce6332ebf 1341367 - HashTable::Ptr::isValid returns the opposite of what you expect
1341367 - Make the sense of HashTable::Ptr::isValid match its name.
2024-03-29 18:35:23 +02:00
win7-7 9e3dd9489c 981201 - Remove JS_IsRunning
981201 - Stop using JS_IsRunning in PreciseGCRunnable::Run and remove JS_IsRunning.
2024-03-29 18:22:52 +02:00
win7-7 215f274244 1331115 - Typo in variable name in IdToObjectMap::trace()
1331115 - Fix two typos in CPOW code.
2024-03-29 18:13:41 +02:00
win7-7 ccbe7182bf 1332946 - CacheIR: IC for function.length
1332946 - CacheIR: IC for function.length.
2024-03-29 17:25:49 +02:00
win7-7 e7b2df62d8 1332593 - Optimize lookups of plain data properties on WindowProxies
1332593 - Optimize lookups of data properties on WindowProxies.
2024-03-29 17:25:49 +02:00
win7-7 a999b6c58b 1329016 - CacheIR: Allow -0 (negative zero) index
1329016 - Allow negative zero in CacheIR index check.
2024-03-29 17:25:49 +02:00
win7-7 524fb724c7 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.
2024-03-29 17:25:48 +02:00
win7-7 716ac8bea2 1330793 - Google docs regularly hangs when selecting text
1330793 - Refactor int32 index guard to not modify the input register.
2024-03-29 17:25:48 +02:00
win7-7 817aef696a 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.
2024-03-29 17:25:47 +02:00
win7-7 f8faa86a46 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.
2024-03-29 01:04:54 +02:00
win7-7 5423603463 1328077 - CacheIR: Attach DenseElementHole even with zero dense elements
1328077 - Attach dense element hole IC even with zero dense elements.
2024-03-28 23:12:52 +02:00
win7-7 ca97b0fe77 1328076 - CacheIR: Attach primitive IC even for non-existant properties
1328076 - Attach primitive IC for more properties.
2024-03-28 23:12:52 +02:00
win7-7 8d3f1895c7 1323190 - Attach Proxy GetElem IC
1323190 - Attach Proxy GetElem IC.

1323190 - Remove Proxy friendapi.

1323190 - Inline Proxy::get into JIT VM functions.
2024-03-28 23:12:51 +02:00
win7-7 f2c6cbdca2 1323096 - CacheIR: optimize more value[double] cases
1323096 - Optimize object[double] and object[string] like object[int32].
2024-03-28 23:12:15 +02:00
win7-7 b725e9c1e0 1476417 - Differential Testing: Different output message involving arguments
1476417: Add a resume point after assigning to a mapped argument.
2024-03-28 23:12:15 +02:00
win7-7 b1d49832ae 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.
2024-03-28 23:12:14 +02:00
win7-7 74c41f3fb9 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.
2024-03-28 23:12:14 +02:00
win7-7 7f4603ffc7 1325361 - Optimize PropertyReadNeedsTypeBarrier for typed objects
1325361 - Remove check for typed objects from PropertyReadNeedsTypeBarrier.
2024-03-28 19:52:18 +02:00
win7-7 e5cc1eff91 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.
2024-03-28 19:52:18 +02:00
win7-7 ea5a391a55 1330248 - Assertion failure: hasIonScript(), at js/src/jsscript.h:1417
1330248 - Make sure the script still has an IonScript before attaching a stub.
2024-03-28 19:52:18 +02:00
win7-7 6df296d65d 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.
2024-03-28 19:52:18 +02:00
win7-7 b84023f9cd 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.
2024-03-28 19:52:17 +02:00
win7-7 c3bde22400 1323037 - CacheIR: support dense elements with holes.
1323037 - CacheIR for dense elements with holes.
2024-03-28 19:52:17 +02:00
win7-7 88fe03e069 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.
2024-03-28 19:52:17 +02:00
win7-7 a862f88877 1338374 remnants.
1338374 remnants.
2024-03-27 23:27:45 +02:00
win7-7 83bed13b86 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.
2024-03-27 23:27:45 +02:00
win7-7 bdcc4a0acf 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.
2024-03-27 23:27:45 +02:00
win7-7 0ae9feecb5 1541580 - Cleanup ProxyObject creation
1541580 - Cleanup ProxyObject creation.
Sec-fix.
2024-03-27 23:27:44 +02:00
win7-7 44e7eecd45 1358753 - Allocate ProxyValueArray inline
1358753 - Allocate ProxyValueArray inline in the object instead of using malloc.
2024-03-27 23:27:44 +02:00
win7-7 9ec733bf86 1339507 - Optimize shape/group lookups in ProxyObject::create
1339507 - Cache the shape/group lookup in ProxyObject::create.
2024-03-27 18:59:54 +02:00
win7-7 585fbf3f88 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.
2024-03-27 18:55:21 +02:00
win7-7 37a98e5e1c 1347489 - Vector in StringSegmentRange should have some inline capacity
1347489 - Give StringSegmentRange stack Vector some inline capacity to avoid malloc/free overhead.
2024-03-27 17:21:41 +02:00
win7-7 02b18a6506 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.
2024-03-27 17:03:21 +02:00
win7-7 4b49337269 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.
2024-03-27 16:39:06 +02:00
win7-7 a6fde36b2c 1365654 - Hash table Enum objects cannot be returned from a function.
1365654 - Add a move constructor to HashTable::Enum.

1365654 - Fix style bustage.
2024-03-27 16:35:05 +02:00
win7-7 d047306ff5 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.
2024-03-27 16:35:05 +02:00
win7-7 465f517c04 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.
2024-03-27 16:35:05 +02:00
win7-7 32b703c447 1319746: Add a memory reporter for CFGGraph on BaselineScript
1319746: Add a memory reporter for CFGGraph on BaselineScript.
2024-03-27 16:35:05 +02:00
win7-7 9d1f057852 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.
2024-03-27 16:35:04 +02:00
win7-7 29aa9336a6 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.
2024-03-27 16:35:04 +02:00
win7-7 7e39075d81 1323027 - 2.64% kraken (osx-10-10) regression on push 2f96ca59484d (Thu Dec 8 2016)
1323027: IonMonkey - Remove empty blocks.
2024-03-27 16:35:04 +02:00
win7-7 0546adbe18 1322774: IonMonkey - Test for OOM condition when creating cases for tableswitch
1322774: IonMonkey - Test for OOM condition when creating cases for tableswitch.
2024-03-27 16:35:04 +02:00
win7-7 523d3bc699 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.
2024-03-27 16:35:04 +02:00
win7-7 7e71afbe69 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).
2024-03-27 16:35:04 +02:00
win7-7 857a385126 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.
2024-03-27 16:35:04 +02:00
win7-7 3b7da42cbc Fixes.
Fixes. It builds. Unsure of stability yet.

Crashes but unrelated to this but due multi-threading and bigintl issues.
2024-03-27 16:35:04 +02:00
win7-7 ae477322ba 1310155 - Split IonBuilder into cfg and the rest.
1310155 - IonMonkey, part 1.1: Use a separate allocator for all control flow graphs.

1310155: IonMonkey - Part 1.2 - Remove accidental pushed spewing.
2024-03-27 16:35:04 +02:00
win7-7 d8f2deee88 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.

This is big enough warrant 1.1 later.
2024-03-27 16:35:03 +02:00
win7-7 f81c7a1cbc Fixes.
Fixes.
2024-03-27 16:35:03 +02:00
win7-7 57f1bb8efe 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.
2024-03-27 16:35:03 +02:00
win7-7 a178841a3e 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.
2024-03-27 16:35:03 +02:00
win7-7 a94a7a8813 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.
2024-03-27 16:35:03 +02:00
win7-7 408772a7ad 1319087 - Introduce CacheIR for TypeMonitorResult/ReturnFromIC.
1319087 part 1: Introduce CacheIR for TypeMonitorResult/ReturnFromIC.

This fixes crash with 1319437.
2024-03-27 16:35:03 +02:00
win7-7 0e93a032e7 1322320 - CacheIR: ensure we don't attach duplicate Baseline stubs
1322320  - Ensure we don't attach duplicate Baseline stubs.

Does not fix crash.
2024-03-27 16:35:03 +02:00
win7-7 4d0da559e2 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.
2024-03-27 16:35:03 +02:00
win7-7 eddcb40c49 Debug fixed assert.
Debug fixed assert.
2024-03-27 16:35:02 +02:00
win7-7 87830d945c 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).
2024-03-27 16:35:02 +02:00
win7-7 cf456c4555 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.
2024-03-27 16:35:02 +02:00
win7-7 375d60b200 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.
2024-03-27 16:35:02 +02:00
win7-7 4e2df6bc29 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.
2024-03-27 16:35:02 +02:00
win7-7 bbeb531a8f 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.
2024-03-27 16:35:02 +02:00
win7-7 9b687aa30b 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.
2024-03-27 16:35:02 +02:00
win7-7 7f47ddc64d 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.
2024-03-27 16:35:02 +02:00
win7-7 86f5e04348 1316827 - Wasm baseline: Improve double stack adjustments following calls.
1316827 - WASM: the stack is now free'd once, even when an adjustment is needed.
2024-03-27 16:35:01 +02:00
win7-7 df4158e60f 1316848 - Wasm baseline: Avoid using a zero temp register for EqzI64
1316848 - Wasm baseline: Avoid using a zero temp register for EqzI64.
2024-03-27 16:35:01 +02:00
win7-7 f2a142a598 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.
2024-03-27 16:35:01 +02:00
win7-7 fe3e0e23ca 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.
2024-03-27 16:35:01 +02:00
win7-7 a62602bad0 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.
2024-03-27 16:35:01 +02:00
win7-7 ee8afb858e 1324989 - InvertCondition is undefined on non-jit platform.
1324989 - InvertCondition is undefined on non-jit platform.
2024-03-27 16:35:01 +02:00
win7-7 15e258a4c7 1338834 - Speed up JSContext::currentScript by doing the compartment check first
1338834 - Speed up JSContext::currentScript by doing the compartment check first.
2024-03-27 16:35:01 +02:00
win7-7 9c79fa9b76 1350371 - jsapi-test testNewContext says about leaking JSRuntime
1350371 - Call destroyRuntime when initialization fails in js::NewContext.
2024-03-27 16:35:01 +02:00
win7-7 0a09262ccf 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.
2024-03-27 16:35:01 +02:00
win7-7 f3ab2a89d8 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.
2024-03-27 16:35:00 +02:00
win7-7 645b2b2e0c 1332745 - Split runtime-wide pointer updates from per-zone updates in compacting GC
1332745 - Split runtime-wide pointer udpates from per-zone updates in compacting GC.

Fixes second debug crash/assert.
2024-03-27 16:35:00 +02:00
win7-7 24401bb666 Fix one of debug crash.
Fix debug crash and errors done during implementation of multi-threading.

There is second different debug crash.
2024-03-27 16:35:00 +02:00
win7-7 6f2b671469 Fixes.
Fixes.
2024-03-27 16:35:00 +02:00
win7-7 276da307ac 1317703 - Port Baseline native getter stub to CacheIR.
1317703 - Port Baseline native getter stub to CacheIR.
2024-03-27 16:35:00 +02:00
win7-7 199a02a7ed 1318634 - Fix AddCacheIRGetPropFunction to add the receiver after doing other checks.
1318634 - Fix AddCacheIRGetPropFunction to add the receiver after doing other checks.
2024-03-27 16:35:00 +02:00
win7-7 e9f7b634fd 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.
2024-03-27 16:35:00 +02:00
win7-7 2a921f09a3 1377738 - virtual memory leak in JS_DestroyContext
1377738 - Fix leak of nursery memory.
2024-03-27 16:35:00 +02:00
win7-7 82a872b473 Bug 1410640 - Enable nursery allocation of arrow functions. r=jonco
Enable nursery allocation of arrow functions.
2024-03-27 16:35:00 +02:00
Jan de Mooij 7cfb14e6fa Bug 1415486 - Nursery allocate async functions. r=arai 2024-03-27 16:34:59 +02:00
win7-7 62d20f3290 867815 - Support visitIteratorStart when using generational GC.
867815 - Add post barrier for visitIteratorStart

867815 - Fix visitIteratorStart shape/group guard for unboxed objects.
2024-03-27 16:34:59 +02:00
win7-7 dbd087e37a Fixes.
Fixes.
2024-03-27 16:34:59 +02:00
win7-7 e6138e7c12 1359800 - Refactor some sweeping logic
1359800 - Use IsAboutToBeFinalized rather than marking state directly during sweeping.

1359800 - Check allocatedDuringIncremental flag in IsMarked functions
2024-03-27 16:34:59 +02:00
win7-7 1d3610f9ea 1360526 - Parallelise more table sweeping
1360526 - Parallelise more table sweeping.
2024-03-27 16:34:59 +02:00
win7-7 d708b02e22 1337450 - Simplify GC resets and aborts
1337450 - Simplify GC resets and aborts.

1340010 only affects ifdef GC zeal which does not exist in UXP.
2024-03-27 16:34:59 +02:00
win7-7 56f51bf5eb 1332357 - Fix DumpHeap to only evict the nursery if requested by caller
1332357 - Fix DumpHeap to only evict the nursery if requested by caller.
2024-03-27 16:34:59 +02:00
win7-7 4ce4a5e323 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.
2024-03-27 16:34:59 +02:00
win7-7 f9c2fe780b 1321277 - Refactor arena sweeping for simplicity
1321277 - Refactor arena sweeping for simplicity.
2024-03-27 16:34:59 +02:00
win7-7 6663ded438 1364051 - Make WriteBarrieredBase copy constructor protected
1364051 - Make WriteBarrieredBase copy constructor protected.
2024-03-27 16:34:58 +02:00
win7-7 96b7b6e6c5 1344315 - Suppress protected data checks when handing off runtimes between cooperative threads
1344315 - Suppress protected data checks when handing off runtimes between cooperative threads.
2024-03-27 16:34:58 +02:00
win7-7 a4f4a086ba 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.
2024-03-27 16:34:58 +02:00
win7-7 12323855f7 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.
2024-03-27 16:34:58 +02:00
win7-7 d7af7cb6ae 1341321 - Require runtimes to be single threaded when using a Debugger
1341321 - Require runtimes to be single threaded when using a Debugger.
2024-03-27 16:34:58 +02:00
win7-7 0e03bdbd95 1345307 - Implement runtime-wide WeakCache
1345307 - Implement runtime-wide WeakCache.
2024-03-27 16:34:58 +02:00
win7-7 adbd68337f 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.
2024-03-27 16:34:58 +02:00
win7-7 9d6bab4635 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.
2024-03-27 16:34:58 +02:00
win7-7 b688c64520 This was accidentally changed to false.
This was accidentally changed to false.
2024-03-27 16:34:57 +02:00
win7-7 99d8a60efd 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.
2024-03-27 16:34:57 +02:00
win7-7 4b69698441 Add back if (cx->zone()->needsIncrementalBarrier()) {
if (cx->zone()->needsIncrementalBarrier()) { this seems be needed in this file without CacheIR.
2024-03-27 16:34:57 +02:00
win7-7 e57a6f8991 1358599 follow up fixes until CacheIR is there.
1358599 follow-up fixes until CacheIR is there.
2024-03-27 16:34:57 +02:00
win7-7 9b37db16e2 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.
2024-03-27 16:34:57 +02:00
win7-7 25eafab3f9 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.
2024-03-27 16:34:57 +02:00
win7-7 5b8d980be1 1359077 - Optimize a few things in ExposeGCThingToActiveJS.
1359077 - Optimize a few things in ExposeGCThingToActiveJS.
2024-03-27 16:34:57 +02:00
win7-7 f38f4f5376 1358599 - Use runtime guards for jitcode pre-barriers instead of patchable jumps.
1358599 - Use runtime guards for jitcode pre-barriers instead of patchable jumps.
2024-03-27 16:34:57 +02:00
win7-7 0a5904101d 1337427 - Implement GCVector::sweep
1337427 - Implement GCVector::sweep.

New functionality. Bring it in see if it impact performance of GC.
2024-03-21 12:19:49 +02:00
win7-7 6fb09a688d 1342653 - Change Nursery::cellsWithUid_ from HashSet to Vector
1342653 -  Change Nursery::cellsWithUid_ from HashSet to Vector.
2024-03-21 03:28:48 +02:00
win7-7 f3c2006234 1343590 - Improve CallArgs gray marking assertions
1343590 - Improve CallArgs gray marking assertions.
2024-03-21 02:30:04 +02:00
win7-7 fbe1637fe0 1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers
1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers.
2024-03-21 02:24:29 +02:00
win7-7 a8bafc3790 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.
2024-03-21 02:22:16 +02:00
win7-7 1a7386295d 1342181 - FinalizeDeferredThings can change gray marking state between FixGrayBits GC and start of CC
1343986 - Fix setting of gray bits valid flag after GC.
2024-03-21 02:08:10 +02:00
win7-7 8c1851b6f3 1343986 - Fix setting of gray bits valid flag after GC
1343986 - Fix setting of gray bits valid flag after GC.
2024-03-21 02:04:11 +02:00
win7-7 59a55e5e94 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.
2024-03-21 02:00:25 +02:00
win7-7 be943bbbe8 Fixes to revert incorrect changes.
Fixes to revert incorrect changes.
2024-03-21 01:53:03 +02:00
win7-7 680718719c Fixes to get this to compile with statistics changes.
Fixes.
2024-03-21 01:44:14 +02:00
win7-7 ed41693d19 Fixes.
Fixes.
2024-03-21 00:36:49 +02:00
win7-7 294292bfc4 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.
2024-03-21 00:28:08 +02:00
win7-7 e9e6df1a11 1335413 - Use mozilla array containers in GC statistics code
1335413 - Use mozilla array containers in GC statistics code.
2024-03-21 00:17:41 +02:00
win7-7 2defe9efea 1326343 - Do not compute with null Timestamp on OOM
1326343 - Do not compute with null Timestamp on OOM.
2024-03-20 23:50:47 +02:00
win7-7 01f5bf2d80 1173354 - Stop tracking GC begin/end callback time since it did not handle nesting
Second part.
2024-03-20 23:42:14 +02:00
win7-7 686b1a3fe2 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.
2024-03-20 23:33:41 +02:00
win7-7 42effc35d6 1353758 followup - Also purge external string cache after compacting GC
1353758 followup - Also purge external string cache after compacting GC.
2024-03-20 22:08:35 +02:00
win7-7 6ba23eb2d7 Miss from 1348134.
Miss from 1348134.
2024-03-20 21:58:01 +02:00
win7-7 6d743a97f4 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.
2024-03-20 21:39:38 +02:00
win7-7 00d6c934c4 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.
2024-03-20 21:22:42 +02:00
win7-7 37d94c0acc 1357012 - Use fallible append for compression tasks and use UniquePtrs.
1357012 - Use fallible append for compression tasks and use UniquePtrs.
2024-03-20 20:51:40 +02:00
win7-7 1c9002f0db 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.
2024-03-20 20:35:20 +02:00
win7-7 2de2133d2d 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.
2024-03-20 18:48:46 +02:00
win7-7 40bb25b290 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.
2024-03-20 13:57:25 +02:00
win7-7 c33b480b9b 1527839 - Set maximum recursion limit for ExtractLinearSum
1527839 - Set maximum recursion limit for ExtractLinearSum.
2024-03-20 13:55:10 +02:00
win7-7 e420bd791b 1341326 - Set stack limit and stack size properly for helper threads
1341326 - Set stack limit and stack size properly for helper threads.
2024-03-20 13:52:18 +02:00
Jan de Mooij 54db5dc303 Bug 1377238 - Free finished IonBuilders off-thread. r=jonco 2024-03-20 13:35:52 +02:00
win7-7 110d6322f9 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
2024-03-20 12:43:08 +02:00
win7-7 195d6d9726 Various fixes.
Various fixes. This does compile and works without crashing also.
2024-03-20 05:26:48 +02:00
win7-7 8c9e91ccc3 I have no idea why in 1334194 I accidentally undone jit multi-threading progress.. revert those unwanted changes.
I have no idea why in 1334194 I accidentally undone jit multi-threading progress.. revert those unwanted changes.
2024-03-20 03:20:18 +02:00
win7-7 0e7206e5cb Multi-threading miss.
Multi-threading miss.
2024-03-20 03:11:29 +02:00
win7-7 9896148404 There is still ExclusiveContext, revealed by removing main thread from engine.
There is still ExclusiveContext, revealed by removing main thread from engine.
2024-03-20 03:09:23 +02:00
win7-7 cad64ea41a Brace in wrong location.
Brace in wrong location.
2024-03-20 03:05:03 +02:00
win7-7 4f6040306e Fixes.
TypedObject.cpp was missing brace

1335095  accidentally changed MarkInterpreterActivations to TraceInterpreterActivations and  MarkJitActivations to TraceJitActivations.

JitFrames.h file was missed while doing 1340822 .
2024-03-20 02:54:14 +02:00
win7-7 eaf0fdb5e3 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.
2024-03-20 02:06:30 +02:00
win7-7 4c57bac545 1337968 - Add API and shell harness for cooperative multithreading
1337968 - Add API and shell harness for cooperative multithreading.
2024-03-20 01:16:44 +02:00
win7-7 2fe5e60be9 1337491 - Off thread parsing changes for multithreaded runtimes
1337491 - Off thread parsing changes for multithreaded runtimes.
2024-03-20 00:39:01 +02:00
win7-7 a27998ec96 1337117 - Remove references to main thread in the JS engine
1337117 - Remove references to main thread in the JS engine.
2024-03-19 23:38:05 +02:00
win7-7 019819e4d2 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.
2024-03-19 21:56:44 +02:00
win7-7 3f2523cc99 1337112 - Remove links from JSRuntime to its single context and zone group
1337112 - Remove links from JSRuntime to its single context and zone group.
2024-03-19 21:49:50 +02:00
win7-7 bf572de933 1337070 - Tolerate multiple zone groups and cooperating contexts in the GC
1337070 - Tolerate multiple zone groups and cooperating contexts in the GC.
2024-03-19 20:36:49 +02:00
win7-7 92deb40510 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.
2024-03-19 19:25:45 +02:00
win7-7 e2c3f68af0 1336603 - Move PCCounts state from ZoneGroup back to the runtime
1336603 - Move PCCounts state from ZoneGroup back to the runtime.
2024-03-19 16:36:31 +02:00
win7-7 242911896e 1339944 - Prohibit context switches while handling OOM during type inference operations
1339944 - Prohibit context switches while handling OOM during type inference operations.
2024-03-19 16:18:19 +02:00
win7-7 7df83e6a64 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.
2024-03-19 16:15:54 +02:00
win7-7 dba069dda0 1335130 - Allow iterating over the zone groups in a runtime
1335130 - Allow iterating over the zone groups in a runtime.
2024-03-19 16:10:35 +02:00
win7-7 1f0f4d5b9d 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.
2024-03-19 16:03:59 +02:00
win7-7 907d8b4c15 1337106 - Handle multiple contexts per runtime in memory reporter
1337106 - Handle multiple contexts per runtime in memory reporter.
2024-03-19 15:47:07 +02:00
win7-7 cbdf4da0bc 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
2024-03-19 15:42:28 +02:00
win7-7 881682099f 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
2024-03-19 15:21:34 +02:00
win7-7 4e88513b49 1334880 - Don't use JSContext* symbolic address in wasm jitcode
1334880 - Don't use JSContext* symbolic address in wasm jitcode.
2024-03-19 15:07:56 +02:00
win7-7 ad89a89313 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.
2024-03-19 15:01:52 +02:00
win7-7 a989af22fc 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.
2024-03-19 13:48:18 +02:00
win7-7 fd3dcf1a29 1334927 - Handle multiple contexts per runtime in the SPS profiler
1334927 - Handle multiple contexts per runtime in the SPS profiler.
2024-03-19 02:14:05 +02:00
win7-7 5a49801dd7 1334212 - Handle multiple contexts per runtime in compiled JIT code
1334212 - Handle multiple contexts per runtime in compiled JIT code.
2024-03-19 01:47:19 +02:00
win7-7 ec3edcc62e 1334837 - Add JSContext* to runtime for the active cooperatively scheduled thread
1334837 - Add JSContext* to runtime for the active cooperatively scheduled thread
2024-03-19 00:55:38 +02:00
win7-7 d361b4a5a6 1334845 - Create only one JSContext per helper thread
1334845 - Create only one JSContext per helper thread.
2024-03-19 00:26:16 +02:00
win7-7 e5c099ec0b 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.
2024-03-19 00:12:44 +02:00
win7-7 2cdc040a18 Compiles and links.
Compiles and links.
Generational GC is not possible keep preference same way when using multi-threaded js engine anymore.

./mach run succesful. Build started and worked. I need do cleaner branch later.
2024-03-18 23:52:46 +02:00
win7-7 e4a50eea9b Fixes + reverting.
.ref(), to multi-threading additions to jsgc.cpp and fixing sweepZoneGroups to sweepZones.

Also reverting 1465108  for now. Might try redo later.
2024-03-18 23:00:27 +02:00
win7-7 59c579be00 Fix GCRuntime.h missing some previous due accidental removal.
Fix GCRuntime.h missing some previous due accidental removal.
2024-03-18 21:33:48 +02:00
win7-7 1557dd11dd 1329632: Add a null-check for empty filenames in wasm stack traces
Follow-up crash fix.
2024-03-18 20:31:18 +02:00
win7-7 bdc2f37409 1326501 - Baldr: optimize getFuncName
Bug 1326501 - Baldr: optimize getFuncName  is necessary due it introducing runtime for WasmCode.h ensureProfilingState.
2024-03-18 20:29:10 +02:00
win7-7 88e470c7db Further mix fixes.
Further mix fixes.

Bug 1326501 - Baldr: optimize getFuncName  is necessary due it introducing runtime for WasmCode.h ensureProfilingState.
2024-03-18 20:13:25 +02:00
win7-7 dd74a29715 Mixed fixes.
Mixed fixes including removing template from jsnum.h, missed line and lack of comma in jsscript.cpp, fixing jsgc.cpp file somewhat, its still not fixed but bit progress including duplicate removal
2024-03-18 19:34:16 +02:00
win7-7 054620ca38 Some fixes.
Some fixes.
2024-03-18 18:08:00 +02:00
win7-7 b41660f968 Missed change.
Missed change.
2024-03-18 16:09:59 +02:00
win7-7 eea7b9237c This should have been removed.
This should have been removed.
2024-03-18 16:07:24 +02:00
win7-7 10b4acc850 Leftover accidentally taken from previous branch/based to it.
Leftover accidentally taken from previous branch.
2024-03-18 15:53:26 +02:00
win7-7 d398ba11ff Fixes.
Still does not compile
2024-03-18 14:31:52 +02:00
win7-7 f546d7de6e Fixes.
duration_(nullptr), to 0.

JS::Value does not fit unwrappedExceptionStack_ use js::SavedFrame*.
2024-03-18 13:17:34 +02:00
win7-7 980beb9801 Accident.
Accident.
2024-03-18 12:52:19 +02:00
win7-7 93ca9d7f09 1465108 + smaller fixes.
1465108 + smaller fixes.
2024-03-18 05:44:19 +02:00
win7-7 d2e1f9dd51 Remove other leftovers of asJSContext
Remove other leftovers of asJSContext.
2024-03-18 04:42:49 +02:00
win7-7 2a1c575302 Remove asJSContext() from BigIntType.cpp
Remove asJSContext() from BigIntType.cpp
2024-03-18 04:40:13 +02:00
win7-7 cac53eb3fa Further fixes
Further fixes. JSExternalStringSizeofCallback does not exist in current js engine and GeckoProfiler is renaming of SPSProfiler.

GCRuntime.h(102): error C2614: 'js::gc::BackgroundDecommitTask': illegal member initialization: 'GCParallelTask' is not a base or member

AtomicsObject.cpp(772): error C2668: 'js::ToNumber': ambiguous call to overloaded function

These issues remain.
2024-03-18 04:27:50 +02:00
win7-7 c30f3ef4bc Of course there had be typos.
Of course there had be typos.
2024-03-18 03:12:30 +02:00
win7-7 e34734ef21 Hmm ExclusiveContext* cx misses.
Hmm  ExclusiveContext* cx misses. Going merge with one commit soon.
2024-03-18 03:04:36 +02:00
win7-7 eae0418d24 1325050 - Structure reorganization for multithreaded runtimes
1325050 - Structure reorganization for multithreaded runtimes
2024-03-18 02:16:04 +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
win7-7 7fe76b76b3 Merge branch 'master' into build-everything-unified 2024-01-17 20:47:58 +02:00
win7-7 3a59e7f8b6 Merge branch 'master' into build-everything-unified 2024-01-06 18:51:11 +02:00
win7-7 8cfa5de132 Merge branch 'master' into build-everything-unified 2023-12-06 20:58:19 +02:00
win7-7 623e3eb9d8 Merge branch 'master' into build-everything-unified 2023-11-29 19:09:43 +02:00
win7-7 7f83281928 Restore unified building to caps and chrome.
Restore unified building to caps and chrome.
2023-11-10 18:30:24 +02:00
win7-7 40e515d441 Bug 1351820 - Build more more netwerk files in unified mode.
This updates the unifed sources for a few netwerk build files. In some cases files were excluded because we thought they used plarena.h, but that turned to be false. A few files needed to be updated to add missing imports/exports due to shifting of compilation units.

This along with other unified building previously reduces compilation time about 1 minute.
2023-11-10 13:07:29 +02:00
win7-7 4c976817c9 Bug 1348991 - Use unified sources in startup cache.
The startup cache source files are incorrectly marked as using plarena.h, we can make building them unified.
2023-11-10 12:31:55 +02:00
win7-7 ff063d5a38 Bug 1348998 - Build XML with unified sources.
It looks like we can build parser/xml with unified sources.
2023-11-10 12:31:44 +02:00
win7-7 2234371a02 Bug 1351910 - Build more files as unified in ipc/glue
One file was excluded for using plarena which it did not. The other was excluded for "clashes with strdup," it does not use strdup.
2023-11-10 12:31:33 +02:00
win7-7 9b2b7e6589 Bug 1362644 - Build more SpiderMonkey files in unified mode.
Neither vm/Initializiation.cpp nor the threading files need to be built in non-unified mode. They don't have any conflicting definitions or need any file-specific compiler flags.
2023-11-10 12:31:20 +02:00
win7-7 b66b756a15 Bug 1351831 - Build more xpconnect code in unified sources.
These files were being excluding because we thought they used plarena.h, but it turns out they did not. A few tweaks needed to be made to clarify whether we wanted to use mozilla::UniquePtr or js::UniquePtr.
2023-11-10 12:31:03 +02:00
5667 changed files with 305853 additions and 758831 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.
Clobber for removal of network tickler
Clobber for ICU 78.1
+4 -8
View File
@@ -14,7 +14,7 @@ endif
export TOPLEVEL_BUILD := 1
default::
BACKEND_ONCE_STAMP := backend.once.stamp
ifndef TEST_MOZBUILD
ifdef MOZ_BUILD_APP
include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
@@ -46,7 +46,7 @@ ifndef TEST_MOZBUILD
ifndef MOZ_PROFILE_USE
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
# rules.mk doesn't run early enough.
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BACKEND_ONCE_STAMP)
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BUILD_BACKEND_FILES)
# While our mozbuild backend has some kind of crazy install_manfests junk to
# try and make this not have to happen, we actually want dist/bin to be
@@ -100,11 +100,7 @@ config.status js/src/config.status:
ifndef TEST_MOZBUILD
.PHONY: backend
backend: $(BACKEND_ONCE_STAMP)
# Create a per-invocation stamp so backend regenerates only once
$(BACKEND_ONCE_STAMP):
@echo "Stamping backend regeneration."
@$(TOUCH) $@
backend: $(BUILD_BACKEND_FILES)
# A traditional rule would look like this:
# backend.%:
@@ -126,7 +122,7 @@ $(subst .,%,$(BUILD_BACKEND_FILES)):
@echo 'Build configuration changed. Regenerating backend.'
$(PYTHON) config.status
Makefile: $(BACKEND_ONCE_STAMP)
Makefile: $(BUILD_BACKEND_FILES)
@$(TOUCH) $@
define build_backend_rule
-8
View File
@@ -1,8 +0,0 @@
TRADEMARK NOTICE
================
The name "Goanna" and visual representations (logo) have not been
registered by the Copyright owners as a trademark in any jurisdiction.
However, because Goanna has been distributed and maintained world-wide,
continually since 2015, the Copyright owners claim "common-law trademark
protection" in any jurisdiction where common-law trademark is recognized.
+7 -48
View File
@@ -18,6 +18,10 @@
#endif
#include <gtk/gtk.h>
#if (MOZ_WIDGET_GTK == 3)
extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_init(int*, char **[]);
#endif
using namespace mozilla;
using namespace mozilla::a11y;
@@ -29,20 +33,12 @@ extern "C" {
typedef GType (* AtkGetTypeType) (void);
typedef void (*GnomeAccessibilityInit) (void);
typedef void (*GnomeAccessibilityShutdown) (void);
#if (MOZ_WIDGET_GTK == 3)
typedef int (*AtkBridgeAdaptorInit) (int*, char***);
#endif
}
static PRLibrary* sATKLib = nullptr;
static const char sATKLibName[] = "libatk-1.0.so.0";
static const char sATKHyperlinkImplGetTypeSymbol[] =
"atk_hyperlink_impl_get_type";
#if (MOZ_WIDGET_GTK == 3)
static PRLibrary* sAtkBridgeAdaptorLib = nullptr;
static const char sAtkBridgeAdaptorLibName[] = "libatk-bridge-2.0.so.0";
static const char sAtkBridgeAdaptorInitSymbol[] = "atk_bridge_adaptor_init";
#endif
gboolean toplevel_event_watcher(GSignalInvocationHint*, guint, const GValue*,
gpointer);
@@ -131,38 +127,6 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
return NS_OK;
}
#if (MOZ_WIDGET_GTK == 3)
static bool
InitAtkBridgeAdaptor()
{
AtkBridgeAdaptorInit initBridge =
reinterpret_cast<AtkBridgeAdaptorInit>(
PR_FindFunctionSymbolAndLibrary(sAtkBridgeAdaptorInitSymbol,
&sAtkBridgeAdaptorLib));
if (!initBridge) {
sAtkBridgeAdaptorLib = PR_LoadLibrary(sAtkBridgeAdaptorLibName);
if (sAtkBridgeAdaptorLib) {
initBridge =
reinterpret_cast<AtkBridgeAdaptorInit>(
PR_FindFunctionSymbol(sAtkBridgeAdaptorLib,
sAtkBridgeAdaptorInitSymbol));
if (!initBridge) {
PR_UnloadLibrary(sAtkBridgeAdaptorLib);
sAtkBridgeAdaptorLib = nullptr;
}
}
}
if (!initBridge) {
return false;
}
initBridge(nullptr, nullptr);
return true;
}
#endif
void
a11y::PlatformInit()
{
@@ -217,7 +181,9 @@ a11y::PlatformInit()
// Init atk-bridge now
PR_SetEnv("NO_AT_BRIDGE=0");
#if (MOZ_WIDGET_GTK == 3)
if (!InitAtkBridgeAdaptor())
if (atk_bridge_adaptor_init) {
atk_bridge_adaptor_init(nullptr, nullptr);
} else
#endif
{
nsresult rv = LoadGtkModule(sAtkBridge);
@@ -262,13 +228,6 @@ a11y::PlatformShutdown()
sAtkBridge.init = nullptr;
sAtkBridge.shutdown = nullptr;
}
#if (MOZ_WIDGET_GTK == 3)
if (sAtkBridgeAdaptorLib) {
// Do not shutdown/unload atk-bridge; an exit function registered by
// the bridge will take care of it.
sAtkBridgeAdaptorLib = nullptr;
}
#endif
#if (MOZ_WIDGET_GTK == 2)
if (sGail.lib) {
// Do not shutdown gail because
+1 -1
View File
@@ -55,7 +55,7 @@ private:
{
explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
RefPtr<Accessible> mParent;
Accessible* mParent;
int32_t mIndex;
IteratorState* mParentState;
};
+1 -1
View File
@@ -112,5 +112,5 @@ function shutdownPromise(contentBrowser) {
*/
function forceGC() {
Cu.forceCC();
Cu.forceGC();
Cu.forceShrinkingGC();
}
+9 -9
View File
@@ -40,7 +40,7 @@ def loadEventIDL(parser, includePath, eventname):
class Configuration:
def __init__(self, filename):
config = {}
exec(compile(open(filename, "rb").read(), filename, 'exec'), config)
execfile(filename, config)
self.simple_events = config.get('simple_events', [])
def firstCap(str):
@@ -64,7 +64,7 @@ def print_header_file(fd, conf, incdirs):
for e in conf.simple_events:
idl, idl_path = loadEventIDL(p, incdirs, e)
idl_paths.add(idl_path)
for iface in [p for p in idl.productions if p.kind == "interface"]:
for iface in filter(lambda p: p.kind == "interface", idl.productions):
classname = ("xpcAcc%s" % e)
baseinterfaces = interfaces(iface)
@@ -73,7 +73,7 @@ def print_header_file(fd, conf, incdirs):
fd.write("public:\n")
attributes = allAttributes(iface)
args = list(map(writeAttributeParams, attributes))
args = map(writeAttributeParams, attributes)
fd.write(" %s(%s) :\n" % (classname, ", ".join(args)))
initializers = []
@@ -83,7 +83,7 @@ def print_header_file(fd, conf, incdirs):
fd.write(" NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
fd.write(" NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
for iface in [i for i in baseinterfaces if i.name != "nsISupports"]:
for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
fd.write(" NS_DECL_%s\n" % iface.name.upper())
fd.write("\nprivate:\n")
@@ -97,13 +97,13 @@ def print_header_file(fd, conf, incdirs):
return idl_paths
def interfaceAttributeTypes(idl):
ifaces = [p for p in idl.productions if p.kind == "interface"]
ifaces = filter(lambda p: p.kind == "interface", idl.productions)
attributes = []
for i in ifaces:
ifaceAttributes = allAttributes(i)
attributes.extend(ifaceAttributes)
ifaceAttrs = [a for a in attributes if a.realtype.nativeType("in").endswith("*")]
return [a.realtype.nativeType("in").strip(" *") for a in ifaceAttrs]
ifaceAttrs = filter(lambda a: a.realtype.nativeType("in").endswith("*"), attributes)
return map(lambda a: a.realtype.nativeType("in").strip(" *"), ifaceAttrs)
def print_cpp(idl, fd, conf, eventname):
for p in idl.productions:
@@ -186,7 +186,7 @@ def interfaces(iface):
def allAttributes(iface):
attributes = []
for i in interfaces(iface):
attrs = [m for m in i.members if isinstance(m, xpidl.Attribute)]
attrs = filter(lambda m: isinstance(m, xpidl.Attribute), i.members)
attributes.extend(attrs)
return attributes
@@ -194,7 +194,7 @@ def allAttributes(iface):
def write_cpp(eventname, iface, fd):
classname = "xpcAcc%s" % eventname
attributes = allAttributes(iface)
ccattributes = [m for m in attributes if m.realtype.nativeType('in').endswith('*')]
ccattributes = filter(lambda m: m.realtype.nativeType('in').endswith('*'), attributes)
fd.write("NS_IMPL_CYCLE_COLLECTION(%s" % classname)
for c in ccattributes:
fd.write(", m%s" % firstCap(c.name))
+5 -4
View File
@@ -5,11 +5,11 @@
'''Parses a given application.ini file and outputs the corresponding
XULAppData structure as a C++ header file'''
import configparser
import ConfigParser
import sys
def main(output, file):
config = configparser.RawConfigParser()
config = ConfigParser.RawConfigParser()
config.read(file)
flags = set()
try:
@@ -27,7 +27,8 @@ def main(output, file):
'App:id', 'Gecko:minversion', 'Gecko:maxversion')
missing = [var for var in expected if var not in appdata]
if missing:
print("Missing values in %s: %s" % (file, ', '.join(missing)), file=sys.stderr)
print >>sys.stderr, \
"Missing values in %s: %s" % (file, ', '.join(missing))
sys.exit(1)
if not 'Crash Reporter:serverurl' in appdata:
@@ -56,4 +57,4 @@ if __name__ == '__main__':
if len(sys.argv) != 1:
main(sys.stdout, sys.argv[1])
else:
print("Usage: %s /path/to/application.ini" % sys.argv[0], file=sys.stderr)
print >>sys.stderr, "Usage: %s /path/to/application.ini" % sys.argv[0]
+4 -4
View File
@@ -34,7 +34,7 @@ def symlink(source, link_name):
def check_run(args):
global DEBUG
if DEBUG:
print(' '.join(args), file=sys.stderr)
print >> sys.stderr, ' '.join(args)
r = subprocess.call(args)
assert r == 0
@@ -43,11 +43,11 @@ def run_in(path, args):
d = os.getcwd()
global DEBUG
if DEBUG:
print('cd "%s"' % path, file=sys.stderr)
print >> sys.stderr, 'cd "%s"' % path
os.chdir(path)
check_run(args)
if DEBUG:
print('cd "%s"' % d, file=sys.stderr)
print >> sys.stderr, 'cd "%s"' % d
os.chdir(d)
@@ -377,7 +377,7 @@ if __name__ == "__main__":
extra_cflags2 = ["-fPIC"]
extra_cxxflags2 = ["-fPIC", "-static-libstdc++"]
if 'LD_LIBRARY_PATH' in os.environ:
if os.environ.has_key('LD_LIBRARY_PATH'):
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH']);
else:
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
+3 -3
View File
@@ -81,9 +81,9 @@ def process_files(files, output_filename, digests, strip):
short_file = short_file.lstrip('/')
else:
short_file = file
print('%s %s %s %s' % (hash, digest,
print >>output, '%s %s %s %s' % (hash, digest,
os.path.getsize(file),
short_file), file=output)
short_file)
def setup_logging(level=logging.DEBUG):
'''This function sets up the logging module using a speficiable logging
@@ -140,7 +140,7 @@ def main():
try:
for digest in options.digests:
hashlib.new(digest)
except ValueError as ve:
except ValueError, ve:
logger.error('Could not create a "%s" hash object (%s)' %
(digest, ve.args[0]))
exit(1)
@@ -11,7 +11,7 @@ import logging
import os
import site
import sys
import urllib.request, urllib.error, urllib.parse
import urllib2
import difflib
FAILURE_CODE = 1
@@ -40,10 +40,10 @@ def make_hg_url(hgHost, repoPath, protocol='https', revision=None,
def readConfig(configfile, keys=[], required=[]):
c = {}
exec(compile(open(configfile, "rb").read(), configfile, 'exec'), c)
execfile(configfile, c)
for k in keys:
c = c[k]
items = list(c.keys())
items = c.keys()
err = False
for key in required:
if key not in items:
@@ -126,7 +126,7 @@ def get_mozconfig(path, options):
else:
url = make_hg_url(options.hghost, options.branch, 'http',
options.revision, path)
return urllib.request.urlopen(url).readlines()
return urllib2.urlopen(url).readlines()
if __name__ == '__main__':
from optparse import OptionParser
+4
View File
@@ -43,6 +43,8 @@ gyp_vars.update({
'arm_neon': 0,
'arm_neon_optional': 1,
'moz_webrtc_omx': 0,
'moz_webrtc_mediacodec': 0,
# Turn off multi monitor screen share
'multi_monitor_screenshare%' : 0,
@@ -71,6 +73,8 @@ if CONFIG['ARM_ARCH']:
if int(CONFIG['ARM_ARCH']) < 7:
gyp_vars['armv7'] = 0
gyp_vars['arm_neon_optional'] = 0
elif os == 'Android':
gyp_vars['armv7'] = 1
else:
# CPU detection for ARM works on Android only. armv7 always uses CPU
# detection, so we have to set armv7=0 for non-Android target
+1 -1
View File
@@ -18,7 +18,7 @@ flavors = {
'Linux': 'linux',
'Darwin': 'mac',
'SunOS': 'solaris',
'kFreeBSD': 'freebsd',
'GNU/kFreeBSD': 'freebsd',
'DragonFly': 'dragonfly',
'FreeBSD': 'freebsd',
'NetBSD': 'netbsd',
+9 -14
View File
@@ -12,7 +12,7 @@ import random
import subprocess
import sys
import uuid
import builtins
import __builtin__
from types import ModuleType
@@ -170,16 +170,11 @@ def bootstrap(topsrcdir, mozilla_dir=None):
if mozilla_dir is None:
mozilla_dir = topsrcdir
# Ensure we are not running Python 2.
# We put this check here so we generate a user-friendly error message
# rather than a cryptic stack trace on module import.
if sys.version_info[0] < 3 or sys.version_info[1] < 3:
print('Python 3.3 or above is required to run mach.')
print('You are running Python', platform.python_version())
sys.exit(1)
# This sanity check is overkill, but why not?
if sys.version_info[0] > 3:
print('Python 4.x or higher not supported. Use Python 3 instead.')
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module
# import.
if sys.version_info[0] != 2 or sys.version_info[1] < 7:
print('Python 2.7 or above (but not Python 3) is required to run mach.')
print('You are running Python', platform.python_version())
sys.exit(1)
@@ -340,7 +335,7 @@ def bootstrap(topsrcdir, mozilla_dir=None):
# always load local repository configuration
mach.settings_paths.append(mozilla_dir)
for category, meta in list(CATEGORIES.items()):
for category, meta in CATEGORIES.items():
mach.define_category(category, meta['short'], meta['long'],
meta['priority'])
@@ -365,7 +360,7 @@ class ImportHook(object):
self._modules = set()
def __call__(self, name, globals=None, locals=None, fromlist=None,
level=0):
level=-1):
# name might be a relative import. Instead of figuring out what that
# resolves to, which is complex, just rely on the real import.
# Since we don't know the full module name, we can't check sys.modules,
@@ -414,4 +409,4 @@ class ImportHook(object):
# Install our hook
builtins.__import__ = ImportHook(builtins.__import__)
__builtin__.__import__ = ImportHook(__builtin__.__import__)
+1 -1
View File
@@ -11,7 +11,7 @@
# _declare_exceptions template, and add it to the return statement. Then
# destructure in the assignment below the function declaration.
@template
@imports(_from='builtins', _import='Exception')
@imports(_from='__builtin__', _import='Exception')
def _declare_exceptions():
class FatalCheckError(Exception):
'''An exception to throw from a function decorated with @checking.
+14 -21
View File
@@ -133,8 +133,7 @@ option(env='PYTHON', nargs=1, help='Python interpreter')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
@imports(_from='mozbuild.virtualenv', _import='verify_python_version')
@imports(_from='mozpack.path', _import='normsep')
@imports('sysconfig')
@imports('distutils.sysconfig')
def virtualenv_python(env_python, build_env, mozconfig, help):
if help:
return
@@ -166,9 +165,6 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
os.path.join(topobjdir, '_virtualenv'), out,
os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'))
if normsep(sys.executable) == normsep(manager.python_path):
return normsep(manager.python_path)
if python:
# If we're not in the virtualenv, we need the which module for
# find_program.
@@ -197,10 +193,10 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
sys.exit(subprocess.call([python] + sys.argv))
# We are now in the virtualenv
if not sysconfig.get_path("purelib"):
if not distutils.sysconfig.get_python_lib():
die('Could not determine python site packages directory')
return normsep(python)
return python
set_config('PYTHON', virtualenv_python)
add_old_configure_assignment('PYTHON', virtualenv_python)
@@ -216,7 +212,7 @@ def early_options():
def early_options():
return set(
option.env
for option in __sandbox__._options.values()
for option in __sandbox__._options.itervalues()
if option.env
)
return early_options
@@ -244,17 +240,17 @@ def mozconfig_options(mozconfig, help):
log.info(' %s' % arg)
helper.add(arg, origin='mozconfig', args=helper._args)
for key, value in mozconfig['env']['added'].items():
for key, value in mozconfig['env']['added'].iteritems():
add(key, value)
os.environ[key] = value
for key, (_, value) in mozconfig['env']['modified'].items():
for key, (_, value) in mozconfig['env']['modified'].iteritems():
add(key, value)
os.environ[key] = value
for key, value in mozconfig['vars']['added'].items():
for key, value in mozconfig['vars']['added'].iteritems():
# mozconfig_loader adds _IS_SET variables that are irrelevant
if not key.endswith('_IS_SET'):
add(key, value)
for key, (_, value) in mozconfig['vars']['modified'].items():
for key, (_, value) in mozconfig['vars']['modified'].iteritems():
add(key, value)
@@ -294,7 +290,6 @@ option('--target', nargs=1,
@imports(_from='mozbuild.configure.constants', _import='Endianness')
@imports(_from='mozbuild.configure.constants', _import='Kernel')
@imports(_from='mozbuild.configure.constants', _import='OS')
@imports(_from='mozbuild.configure.constants', _import='OS_and_Kernel')
def split_triplet(triplet):
# The standard triplet is defined as
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
@@ -344,7 +339,7 @@ def split_triplet(triplet):
if cpu.endswith('86') or (cpu.startswith('i') and '86' in cpu):
canonical_cpu = 'x86'
endianness = 'little'
elif cpu == 'x86_64':
elif cpu in ('x86_64', 'ia64'):
canonical_cpu = cpu
endianness = 'little'
elif cpu in ('s390', 's390x'):
@@ -390,8 +385,8 @@ def split_triplet(triplet):
alias=triplet,
cpu=CPU(canonical_cpu),
bitness=CPU_bitness[canonical_cpu],
kernel=OS_and_Kernel(canonical_kernel),
os=OS_and_Kernel(canonical_os),
kernel=Kernel(canonical_kernel),
os=OS(canonical_os),
endianness=Endianness(endianness),
raw_cpu=cpu,
raw_os=os,
@@ -405,8 +400,7 @@ def split_triplet(triplet):
def config_sub(shell, triplet):
config_sub = os.path.join(os.path.dirname(__file__), '..',
'autoconf', 'config.sub')
return subprocess.check_output([shell, config_sub, triplet],
universal_newlines=True).strip()
return subprocess.check_output([shell, config_sub, triplet]).strip()
@depends('--host', shell)
@@ -416,8 +410,7 @@ def host(value, shell):
if not value:
config_guess = os.path.join(os.path.dirname(__file__), '..',
'autoconf', 'config.guess')
host = subprocess.check_output([shell, config_guess],
universal_newlines=True).strip()
host = subprocess.check_output([shell, config_guess]).strip()
else:
host = value[0]
@@ -768,7 +761,7 @@ def enabled_in_nightly(milestone, _):
def all_configure_options(_):
result = []
previous = None
for option in __sandbox__._options.values():
for option in __sandbox__._options.itervalues():
# __sandbox__._options contains items for both option.name and
# option.env. But it's also an OrderedDict, meaning both are
# consecutive.
+21 -15
View File
@@ -3,6 +3,13 @@
# 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/.
@imports('codecs')
@imports('sys')
def encoded_open(path, mode):
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
return codecs.open(path, mode, encoding)
m4 = check_prog(
"M4",
(
@@ -24,10 +31,8 @@ m4 = check_prog(
@imports(_from='os.path', _import='exists')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='os', _import='environ')
@imports(_from='mozbuild.getencoding', _import='getencoding')
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
old_configure_assignments, build_project):
encoding = getencoding()
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
# which is actually necessary because this path actually ends up literally
# as $0, and backslashes there breaks autoconf's detection of the source
@@ -38,6 +43,7 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
if not old_configure_dir.endswith('/js/src'):
old_configure = os.path.join(old_configure_dir, 'js', 'src',
os.path.basename(old_configure))
refresh = True
if exists(old_configure):
mtime = getmtime(old_configure)
@@ -61,21 +67,25 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
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'], env=my_env)
script = script.decode(encoding, errors='replace')
# 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
script = script.replace('>./config.log', '>>./config.log')
with open(old_configure, 'w', encoding=encoding, errors='replace') as fh:
with open(old_configure, 'wb') as fh:
fh.write(script)
cmd = [shell, old_configure]
with open('old-configure.vars', 'w', encoding=encoding, errors='replace') as out:
with encoded_open('old-configure.vars', 'w') as out:
log.debug('Injecting the following to old-configure:')
def inject(command):
print(command, file=out)
@@ -117,6 +127,7 @@ def old_configure_options(*options):
'--enable-alsa',
'--enable-appcompat-guid',
'--enable-av1',
'--enable-jxl',
'--enable-b2g-bt',
'--enable-b2g-camera',
'--enable-b2g-ril',
@@ -152,7 +163,6 @@ def old_configure_options(*options):
'--enable-jitspew',
'--enable-js-lto',
'--enable-leak-sanitizer',
'--enable-libaom',
'--enable-libjpeg-turbo',
'--enable-libproxy',
'--enable-llvm-hacks',
@@ -164,7 +174,6 @@ def old_configure_options(*options):
'--enable-negotiateauth',
'--enable-nfc',
'--enable-npapi',
'--enable-npapi-gtk2',
'--enable-nspr-build',
'--enable-official-branding',
'--enable-official-vendor',
@@ -286,11 +295,8 @@ def old_configure_options(*options):
@imports('subprocess')
@imports('sys')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='mozbuild.util', _import='exec_')
@imports(_from='mozbuild.getencoding', _import='getencoding')
def old_configure(prepare_configure, extra_old_configure_args, all_options,
*options):
encoding = getencoding()
cmd = prepare_configure
# old-configure only supports the options listed in @old_configure_options
@@ -327,7 +333,7 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
ret = subprocess.call(cmd)
if ret:
with log.queue_debug():
with open('config.log', 'r', encoding=encoding, errors='replace') as fh:
with encoded_open('config.log', 'r') as fh:
fh.seek(log_size)
for line in fh:
log.debug(line.rstrip())
@@ -335,12 +341,12 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
sys.exit(ret)
raw_config = {}
with open('config.data', 'r', encoding=encoding, errors='replace') as fh:
with encoded_open('config.data', 'r') as fh:
code = compile(fh.read(), 'config.data', 'exec')
# Every variation of the exec() function I tried led to:
# SyntaxError: unqualified exec is not allowed in function 'main' it
# contains a nested function with free variables
exec_(code, raw_config)
exec code in raw_config
# Ensure all the flags known to old-configure appear in the
# @old_configure_options above.
@@ -374,9 +380,9 @@ def set_old_configure_define(name, value):
def post_old_configure(raw_config):
for k, v in raw_config['substs']:
set_old_configure_config(
k[1:-1], v[1:-1] if isinstance(v, str) else v)
k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
for k, v in dict(raw_config['defines']).items():
for k, v in dict(raw_config['defines']).iteritems():
set_old_configure_define(k[1:-1], v[1:-1])
set_old_configure_config('non_global_defines',
+6 -45
View File
@@ -61,44 +61,6 @@ set_config('HAVE_YASM', have_yasm)
# Until the YASM variable is not necessary in old-configure.
add_old_configure_assignment('YASM', have_yasm)
# nasm detection
# ==============================================================
nasm = check_prog('NASM', ['nasm'], allow_missing=True)
@depends_if(nasm)
@checking('nasm version')
def nasm_version(nasm):
version = check_cmd_output(
nasm, '-v',
onerror=lambda: die('Failed to get nasm version.')
).splitlines()[0].split()[2]
return Version(version)
@depends(nasm, nasm_version)
def have_nasm(nasm, version):
if nasm and version >= Version('2.14'):
return True
set_config('HAVE_NASM', have_nasm)
@depends(have_nasm, target)
def nasm_asflags(have_nasm, target):
if have_nasm:
asflags = {
('OSX', 'x86'): '-f macho32',
('OSX', 'x86_64'): '-f macho64',
('WINNT', 'x86'): '-f win32',
('WINNT', 'x86_64'): '-f win64',
}.get((target.os, target.cpu), None)
if asflags is None:
if target.cpu == 'x86':
asflags = '-f elf32'
elif target.cpu == 'x86_64':
asflags = '-f elf64'
return asflags
set_config('NASM_ASFLAGS', nasm_asflags)
# MacOS deployment target version
# ==============================================================
# This needs to happen before any compilation test is done.
@@ -274,7 +236,7 @@ def get_compiler_info(compiler, language):
('CPU', CPU_preprocessor_checks),
('KERNEL', kernel_preprocessor_checks),
):
for n, (value, condition) in enumerate(preprocessor_checks.items()):
for n, (value, condition) in enumerate(preprocessor_checks.iteritems()):
check += dedent('''\
#%(if)s %(condition)s
%%%(name)s "%(value)s"
@@ -307,7 +269,7 @@ def get_compiler_info(compiler, language):
# have non-ASCII characters. Treat the output as bytearray.
data = {}
for line in result.splitlines():
if line.startswith('%'):
if line.startswith(b'%'):
k, _, v = line.partition(' ')
k = k.lstrip('%')
data[k] = v.replace(' ', '').lstrip('"').rstrip('"')
@@ -435,11 +397,10 @@ def check_compiler(compiler, language, target):
@imports('json')
@imports('subprocess')
@imports('sys')
@imports(_from='locale', _import='getpreferredencoding')
def get_vc_paths(topsrcdir):
encoding = getpreferredencoding(False)
def vswhere(args):
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, errors='replace'))
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, 'replace'))
# Can't pass -requires with -legacy, so query each separately.
# Legacy versions first (VS2015)
@@ -458,7 +419,7 @@ def get_vc_paths(topsrcdir):
# Then VS2017 and newer.
for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
path = install['installationPath']
tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'r', encoding=encoding, errors='replace').read().strip()
tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'rb').read().strip()
tools_path = os.path.join(path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
yield (Version(install['installationVersion']), {
'x64': [os.path.join(tools_path, 'x64')],
@@ -640,7 +601,7 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
if cross_compiling and other_compiler.type == 'clang':
return namespace(**{
k: [] if k == 'flags' else v
for k, v in other_compiler.__dict__.items()
for k, v in other_compiler.__dict__.iteritems()
})
# Normally, we'd use `var` instead of `_var`, but the interaction with
+3 -10
View File
@@ -25,22 +25,15 @@ def configure_error(message):
@imports('sys')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='mozbuild.getencoding', _import='getencoding')
def check_cmd_output(*args, **kwargs):
encoding = getencoding()
onerror = kwargs.pop('onerror', None)
with log.queue_debug():
log.debug('Executing: `%s`', quote(*args))
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
retcode = proc.wait()
stdout = stdout.decode(encoding, errors='replace')
stderr = stderr.decode(encoding, errors='replace')
if retcode == 0:
return stdout
@@ -77,7 +70,7 @@ def windows_binary_type(path):
Returns WindowsBinaryType constant.
"""
GetBinaryTypeW = ctypes.windll.kernel32.GetBinaryTypeW
GetBinaryTypeW.argtypes = [wintypes.LPWSTR, ctypes.POINTER(wintypes.DWORD)]
GetBinaryTypeW.argtypes = [wintypes.LPWSTR, wintypes.POINTER(wintypes.DWORD)]
GetBinaryTypeW.restype = wintypes.BOOL
bin_type = wintypes.DWORD()
@@ -239,7 +232,7 @@ def unique_list(l):
# ('19.0', 'arm', r'C:\...\amd64_arm\cl.exe')
# ('19.0', 'x64', r'C:\...\amd64\cl.exe')
# ('19.0', 'x86', r'C:\...\amd64_x86\cl.exe')
@imports(_import='winreg', _as='winreg')
@imports(_import='_winreg', _as='winreg')
@imports(_from='__builtin__', _import='WindowsError')
@imports(_from='fnmatch', _import='fnmatch')
def get_registry_values(pattern):
@@ -302,7 +295,7 @@ def get_registry_values(pattern):
keys = next_keys
@imports(_from='mozbuild.version', _import='RichVersion', _as='_Version')
@imports(_from='mozbuild.configure.util', _import='Version', _as='_Version')
def Version(v):
'A version number that can be compared usefully.'
return _Version(v)
+1 -4
View File
@@ -408,12 +408,9 @@ mt = check_prog('MT', depends_win()(lambda: ('mt.exe',)), input='MT',
@depends_win(mt)
@checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
@imports('subprocess')
@imports(_from='locale', _import='getpreferredencoding')
def valid_mt(path):
encoding = getpreferredencoding(False)
try:
out = subprocess.check_output([path])
out = out.decode(encoding, errors='replace').splitlines()
out = subprocess.check_output([path]).splitlines()
out = '\n'.join(l for l in out
if 'Microsoft (R) Manifest Tool' in l)
if out:
+13 -13
View File
@@ -58,7 +58,7 @@ def runUtil(util, args, inputdata = None):
def createRandomFile(randomFile):
for count in range(0, 2048):
for count in xrange(0, 2048):
randomFile.write(chr(random.randint(0, 255)))
@@ -125,7 +125,7 @@ def createSSLServerCertificate(build, srcDir):
iterator = iter(locations)
# Skips the first entry, I don't know why: bug 879740
next(iterator)
iterator.next()
locationsParam = ""
firstLocation = ""
@@ -148,7 +148,7 @@ def createSSLServerCertificate(build, srcDir):
firstLocation = loc.host
if not firstLocation:
print("Nothing to generate, no automatic secure hosts specified")
print "Nothing to generate, no automatic secure hosts specified"
else:
createRandomFile(rndfile)
@@ -162,7 +162,7 @@ def createSSLServerCertificate(build, srcDir):
return 0
if len(sys.argv) == 1:
print("Specify --gen-server or --gen-ca")
print "Specify --gen-server or --gen-ca"
sys.exit(1)
build = MozbuildObject.from_environment()
@@ -170,23 +170,23 @@ certdir = os.path.join(build.topsrcdir, "build", "pgo", "certs")
if sys.argv[1] == "--gen-server":
certificateStatus = createSSLServerCertificate(build, certdir)
if certificateStatus:
print("TEST-UNEXPECTED-FAIL | SSL Server Certificate generation")
print "TEST-UNEXPECTED-FAIL | SSL Server Certificate generation"
sys.exit(certificateStatus)
if sys.argv[1] == "--gen-ca":
certificateStatus = createCertificateAuthority(build, certdir)
if certificateStatus:
print("TEST-UNEXPECTED-FAIL | Certificate Authority generation")
print "TEST-UNEXPECTED-FAIL | Certificate Authority generation"
else:
print("\n\n")
print("===================================================")
print(" IMPORTANT:")
print(" To use this new certificate authority in tests")
print(" run 'make' at testing/mochitest")
print("===================================================")
print "\n\n"
print "==================================================="
print " IMPORTANT:"
print " To use this new certificate authority in tests"
print " run 'make' at testing/mochitest"
print "==================================================="
sys.exit(certificateStatus)
print("Invalid option specified")
print "Invalid option specified"
sys.exit(1)
+1 -1
View File
@@ -77,7 +77,7 @@ if __name__ == '__main__':
jarlog = os.getenv("JARLOG_FILE")
if jarlog:
env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
print("jarlog: %s" % env["MOZ_JAR_LOG_FILE"])
print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
cmdargs = ["http://localhost:%d/index.html" % PORT]
runner = FirefoxRunner(profile=profile,
+11 -22
View File
@@ -3,7 +3,7 @@
from __future__ import print_function
import os, sys
if not len(sys.argv) == 2 or not os.path.exists(sys.argv[1]):
if not len(sys.argv) is 2 or not os.path.exists(sys.argv[1]):
print("\nYou did not supply a valid path to check.")
exit(1)
else:
@@ -44,8 +44,7 @@ PP_DIRECTIVES = [
]
PP_FILES = []
PP_BAD_DIRECTIVE_FILES = []
PP_BAD_ENCODING_FILES = []
PP_BAD_FILES = []
for root, directories, filenames in os.walk(DIST_PATH):
for filename in filenames:
@@ -53,31 +52,21 @@ for root, directories, filenames in os.walk(DIST_PATH):
PP_FILES += [ os.path.join(root, filename).replace(os.sep, '/') ]
for file in PP_FILES:
with open(file, encoding='utf-8') as fp:
with open(file) as fp:
marker = '%' if file.endswith(PP_SPECIAL_TYPES) else '#'
directives = tuple(marker + directive for directive in PP_DIRECTIVES)
try:
for line in fp:
if line.startswith(directives):
PP_BAD_DIRECTIVE_FILES += [ file.replace(DIST_PATH + '/', '') ]
except UnicodeDecodeError:
PP_BAD_ENCODING_FILES += [ file.replace(DIST_PATH+ '/' , '') ]
for line in fp:
if line.startswith(directives):
PP_BAD_FILES += [ file.replace(DIST_PATH + '/', '') ]
fp.close()
PP_BAD_DIRECTIVE_FILES = list(dict.fromkeys(PP_BAD_DIRECTIVE_FILES))
PP_BAD_ENCODING_FILES = list(dict.fromkeys(PP_BAD_ENCODING_FILES))
PP_BAD_FILES = list(dict.fromkeys(PP_BAD_FILES))
print('Done!')
if len(PP_BAD_DIRECTIVE_FILES) > 0:
print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_DIRECTIVE_FILES), DIST_PATH))
for file in PP_BAD_DIRECTIVE_FILES:
if len(PP_BAD_FILES) > 0:
print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_FILES), DIST_PATH))
for file in PP_BAD_FILES:
print(file)
if len(PP_BAD_ENCODING_FILES) > 0:
print("\nWARNING: The following {0} file(s) in {1} are not valid UTF-8:\n".format(len(PP_BAD_ENCODING_FILES), DIST_PATH))
for file in PP_BAD_ENCODING_FILES:
print(file)
sys.exit(0)
exit(0)
+1 -1
View File
@@ -10,4 +10,4 @@ with open(filename, 'rU') as fh:
source = fh.read()
statements = pymake.parser.parsestring(source, filename)
print(statements.to_source())
print statements.to_source()
+2 -2
View File
@@ -4,9 +4,9 @@ import sys
import pymake.parser
for f in sys.argv[1:]:
print("Parsing %s" % f)
print "Parsing %s" % f
fd = open(f, 'rU')
s = fd.read()
fd.close()
stmts = pymake.parser.parsestring(s, f)
print(stmts)
print stmts
+15 -15
View File
@@ -2,7 +2,7 @@
import errno, sys, os, shutil, time
from getopt import getopt, GetoptError
from .process import PythonException
from process import PythonException
__all__ = ["mkdir", "rm", "sleep", "touch"]
@@ -13,8 +13,8 @@ def mkdir(args):
"""
try:
opts, args = getopt(args, "p", ["parents"])
except GetoptError as e:
raise PythonException("mkdir: %s" % e, 1)
except GetoptError, e:
raise PythonException, ("mkdir: %s" % e, 1)
parents = False
for o, a in opts:
if o in ('-p', '--parents'):
@@ -25,11 +25,11 @@ def mkdir(args):
os.makedirs(f)
else:
os.mkdir(f)
except OSError as e:
except OSError, e:
if e.errno == errno.EEXIST and parents:
pass
else:
raise PythonException("mkdir: %s" % e, 1)
raise PythonException, ("mkdir: %s" % e, 1)
def rm(args):
"""
@@ -38,8 +38,8 @@ def rm(args):
"""
try:
opts, args = getopt(args, "rRf", ["force", "recursive"])
except GetoptError as e:
raise PythonException("rm: %s" % e, 1)
except GetoptError, e:
raise PythonException, ("rm: %s" % e, 1)
force = False
recursive = False
for o, a in opts:
@@ -50,7 +50,7 @@ def rm(args):
for f in args:
if os.path.isdir(f):
if not recursive:
raise PythonException("rm: cannot remove '%s': Is a directory" % f, 1)
raise PythonException, ("rm: cannot remove '%s': Is a directory" % f, 1)
else:
shutil.rmtree(f, force)
elif os.path.exists(f):
@@ -58,9 +58,9 @@ def rm(args):
os.unlink(f)
except:
if not force:
raise PythonException("rm: failed to remove '%s': %s" % (f, sys.exc_info()[0]), 1)
raise PythonException, ("rm: failed to remove '%s': %s" % (f, sys.exc_info()[0]), 1)
elif not force:
raise PythonException("rm: cannot remove '%s': No such file or directory" % f, 1)
raise PythonException, ("rm: cannot remove '%s': No such file or directory" % f, 1)
def sleep(args):
"""
@@ -70,7 +70,7 @@ def sleep(args):
values = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
for a in args:
multiplier = 1
for k, v in values.items():
for k, v in values.iteritems():
if a.endswith(k):
a = a[:-1]
multiplier = v
@@ -79,7 +79,7 @@ def sleep(args):
f = float(a)
total += f * multiplier
except ValueError:
raise PythonException("sleep: invalid time interval '%s'" % a, 1)
raise PythonException, ("sleep: invalid time interval '%s'" % a, 1)
time.sleep(total)
def touch(args):
@@ -88,8 +88,8 @@ def touch(args):
"""
try:
opts, args = getopt(args, "t:")
except GetoptError as e:
raise PythonException("touch: %s" % e, 1)
except GetoptError, e:
raise PythonException, ("touch: %s" % e, 1)
opts = dict(opts)
times = None
if '-t' in opts:
@@ -97,7 +97,7 @@ def touch(args):
from time import mktime, localtime
m = re.match('^(?P<Y>(?:\d\d)?\d\d)?(?P<M>\d\d)(?P<D>\d\d)(?P<h>\d\d)(?P<m>\d\d)(?:\.(?P<s>\d\d))?$', opts['-t'])
if not m:
raise PythonException("touch: invalid date format '%s'" % opts['-t'], 1)
raise PythonException, ("touch: invalid date format '%s'" % opts['-t'], 1)
def normalized_field(m, f):
if f == 'Y':
if m.group(f) is None:
+13 -13
View File
@@ -11,7 +11,7 @@ except when a submake specifies -j1 when the parent make is building in parallel
import os, subprocess, sys, logging, time, traceback, re
from optparse import OptionParser
from . import data, parserdata, process, util
import data, parserdata, process, util
# TODO: If this ever goes from relocatable package to system-installed, this may need to be
# a configured-in path.
@@ -62,7 +62,7 @@ def parsemakeflags(env):
return opts
def _version(*args):
print("""pymake: GNU-compatible make program
print """pymake: GNU-compatible make program
Copyright (C) 2009 The Mozilla Foundation <http://www.mozilla.org/>
This is free software; see the source for copying conditions.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@@ -71,7 +71,7 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.""")
DEALINGS IN THE SOFTWARE."""
_log = logging.getLogger('pymake.execution')
@@ -95,7 +95,7 @@ class _MakeContext(object):
def remakecb(self, remade, error=None):
if error is not None:
print(error)
print error
self.context.defer(self.cb, 2)
return
@@ -124,15 +124,15 @@ class _MakeContext(object):
self.makefile.include(f)
self.makefile.finishparsing()
self.makefile.remakemakefiles(self.remakecb)
except util.MakeError as e:
print(e)
except util.MakeError, e:
print e
self.context.defer(self.cb, 2)
return
if len(self.targets) == 0:
if self.makefile.defaulttarget is None:
print("No target specified and no default target found.")
print "No target specified and no default target found."
self.context.defer(self.cb, 2)
return
@@ -154,7 +154,7 @@ class _MakeContext(object):
if not len(self.realtargets):
if self.options.printdir:
print("make.py[%i]: Leaving directory '%s'" % (self.makelevel, self.workdir))
print "make.py[%i]: Leaving directory '%s'" % (self.makelevel, self.workdir)
sys.stdout.flush()
self.context.defer(self.cb, 0)
@@ -255,24 +255,24 @@ def main(args, env, cwd, cb):
context = process.getcontext(options.jobcount)
if options.printdir:
print("make.py[%i]: Entering directory '%s'" % (makelevel, workdir))
print "make.py[%i]: Entering directory '%s'" % (makelevel, workdir)
sys.stdout.flush()
if len(options.makefiles) == 0:
if os.path.exists(util.normaljoin(workdir, 'Makefile')):
options.makefiles.append('Makefile')
else:
print("No makefile found")
print "No makefile found"
cb(2)
return
ostmts, targets, overrides = parserdata.parsecommandlineargs(arguments)
_MakeContext(makeflags, makelevel, workdir, context, env, targets, options, ostmts, overrides, cb)
except (util.MakeError) as e:
print(e)
except (util.MakeError), e:
print e
if options.printdir:
print("make.py[%i]: Leaving directory '%s'" % (makelevel, workdir))
print "make.py[%i]: Leaving directory '%s'" % (makelevel, workdir)
sys.stdout.flush()
cb(2)
return
+18 -18
View File
@@ -3,9 +3,8 @@ A representation of makefile data structures.
"""
import logging, re, os, sys
from . import parserdata, parser, functions, process, util, implicit
from io import StringIO
from functools import reduce
import parserdata, parser, functions, process, util, implicit
from cStringIO import StringIO
if sys.version_info[0] < 3:
str_type = basestring
@@ -406,7 +405,7 @@ class Expansion(BaseExpansion, list):
if len(a) != len(b):
return False
for i in range(len(self)):
for i in xrange(len(self)):
e1, is_func1 = a[i]
e2, is_func2 = b[i]
@@ -448,7 +447,7 @@ class Variables(object):
self.parent = parent
def readfromenvironment(self, env):
for k, v in env.items():
for k, v in env.iteritems():
self.set(k, self.FLAVOR_RECURSIVE, self.SOURCE_ENVIRONMENT, v)
def get(self, name, expand=True):
@@ -548,7 +547,7 @@ class Variables(object):
self.set(k, flavor, source, value)
def __iter__(self):
for k, (flavor, source, value, valueexp) in self._map.items():
for k, (flavor, source, value, valueexp) in self._map.iteritems():
yield k, flavor, source, value
def __contains__(self, item):
@@ -865,7 +864,7 @@ class RemakeRuleContext(object):
assert error in (True, False)
if error:
print("<%s>: Found error" % self.target.target)
print "<%s>: Found error" % self.target.target
self.error = True
if didanything:
self.didanything = True
@@ -950,8 +949,8 @@ class RemakeRuleContext(object):
self.target.didanything = True
try:
self.commands = [c for c in self.rule.getcommands(self.target, self.makefile)]
except util.MakeError as e:
print(e)
except util.MakeError, e:
print e
sys.stdout.flush()
cb(error=True)
return
@@ -1284,9 +1283,9 @@ class Target(object):
try:
self.resolvedeps(makefile, targetstack, [], False)
except util.MakeError as e:
except util.MakeError, e:
if printerror:
print(e)
print e
self.error = True
self.notifydone(makefile)
return
@@ -1398,7 +1397,7 @@ class _CommandWrapper(object):
def _cb(self, res):
if res != 0 and not self.ignoreErrors:
print("%s: command '%s' failed, return code %i" % (self.loc, self.cline, res))
print "%s: command '%s' failed, return code %i" % (self.loc, self.cline, res)
self.usercb(error=True)
else:
self.usercb(error=False)
@@ -1592,7 +1591,7 @@ class _RemakeContext(object):
assert error in (True, False)
if error and self.required:
print("Error remaking makefiles (ignored)")
print "Error remaking makefiles (ignored)"
if len(self.toremake):
target, self.required = self.toremake.pop(0)
@@ -1679,7 +1678,7 @@ class Makefile(object):
self.variables.set('MAKECMDGOALS', Variables.FLAVOR_SIMPLE,
Variables.SOURCE_AUTOMATIC, ' '.join(targets))
for vname, val in implicit.variables.items():
for vname, val in implicit.variables.iteritems():
self.variables.set(vname,
Variables.FLAVOR_SIMPLE,
Variables.SOURCE_IMPLICIT, val)
@@ -1751,10 +1750,11 @@ class Makefile(object):
if value is None:
self._vpath = []
else:
self._vpath = [e for e in re.split('[%s\s]+' % os.pathsep,
value.resolvestr(self, self.variables, ['VPATH'])) if e != '']
self._vpath = filter(lambda e: e != '',
re.split('[%s\s]+' % os.pathsep,
value.resolvestr(self, self.variables, ['VPATH'])))
targets = list(self._targets.values())
targets = list(self._targets.itervalues())
for t in targets:
t.explicit = True
for r in t.rules:
@@ -1825,7 +1825,7 @@ class Makefile(object):
def getsubenvironment(self, variables):
env = dict(self.env)
for vname, v in self.exportedvars.items():
for vname, v in self.exportedvars.iteritems():
if v:
flavor, source, val = variables.get(vname)
if val is None:
+11 -11
View File
@@ -2,10 +2,10 @@
Makefile functions.
"""
from . import parser, util
import parser, util
import subprocess, os, logging, sys
from .globrelative import glob
from io import StringIO
from globrelative import glob
from cStringIO import StringIO
log = logging.getLogger('pymake.data')
@@ -135,7 +135,7 @@ class Function(object):
if len(self._arguments) != len(other._arguments):
return False
for i in range(len(self._arguments)):
for i in xrange(len(self._arguments)):
# According to the GNU make manual Section 8.1, whitespace around
# arguments is *not* part of the argument's value. So, we do a
# whitespace-agnostic comparison.
@@ -525,7 +525,7 @@ class JoinFunction(Function):
@staticmethod
def iterjoin(l1, l2):
for i in range(0, max(len(l1), len(l2))):
for i in xrange(0, max(len(l1), len(l2))):
i1 = i < len(l1) and l1[i] or ''
i2 = i < len(l2) and l2[i] or ''
yield i1 + i2
@@ -670,7 +670,7 @@ class CallFunction(Function):
v = data.Variables(parent=variables)
v.set('0', data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, vname)
for i in range(1, len(self._arguments)):
for i in xrange(1, len(self._arguments)):
param = self._arguments[i].resolvestr(makefile, variables, setting)
v.set(str(i), data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, param)
@@ -770,7 +770,7 @@ class ShellFunction(Function):
__slots__ = Function.__slots__
def resolve(self, makefile, variables, fd, setting):
from .process import prepare_command
from process import prepare_command
cline = self._arguments[0].resolvestr(makefile, variables, setting)
executable, cline = prepare_command(cline, makefile.workdir, self.loc)
@@ -785,8 +785,8 @@ class ShellFunction(Function):
try:
p = subprocess.Popen(cline, executable=executable, env=makefile.env, shell=False,
stdout=subprocess.PIPE, cwd=makefile.workdir)
except OSError as e:
print("Error executing command %s" % cline[0], e, file=sys.stderr)
except OSError, e:
print >>sys.stderr, "Error executing command %s" % cline[0], e
return
finally:
os.environ['PATH'] = oldpath
@@ -830,7 +830,7 @@ class InfoFunction(Function):
def resolve(self, makefile, variables, fd, setting):
v = self._arguments[0].resolvestr(makefile, variables, setting)
print(v)
print v
functionmap = {
'subst': SubstFunction,
@@ -870,4 +870,4 @@ functionmap = {
'info': InfoFunction,
}
from . import data
import data
+2 -2
View File
@@ -7,7 +7,7 @@ Filename globbing like the python glob module with minor differences:
"""
import os, re, fnmatch
from . import util
import util
_globcheck = re.compile('[[*?]')
@@ -62,7 +62,7 @@ def globpattern(dir, pattern):
if not leaf.startswith('.')]
leaves = fnmatch.filter(leaves, pattern)
leaves = [l for l in leaves if os.path.exists(util.normaljoin(dir, l))]
leaves = filter(lambda l: os.path.exists(util.normaljoin(dir, l)), leaves)
leaves.sort()
return leaves
+4 -4
View File
@@ -34,7 +34,7 @@ coming.
"""
import logging, re, os, sys
from . import data, functions, util, parserdata
import data, functions, util, parserdata
_log = logging.getLogger('pymake.parser')
@@ -108,7 +108,7 @@ _alltokens = re.compile(r'''\\*\# | # hash mark preceeded by any number of backs
:: |
(?:\$(?:$|[\(\{](?:%s)\s+|.)) | # dollar sign followed by EOF, a function keyword with whitespace, or any character
:(?![\\/]) | # colon followed by anything except a slash (Windows path detection)
[=#{}();,|'"]''' % '|'.join(iter(functions.functionmap.keys())), re.VERBOSE)
[=#{}();,|'"]''' % '|'.join(functions.functionmap.iterkeys()), re.VERBOSE)
def iterdata(d, offset, tokenlist, it):
"""
@@ -336,7 +336,7 @@ _conditionkeywords = {
'ifndef': ifndef
}
_conditiontokens = tuple(_conditionkeywords.keys())
_conditiontokens = tuple(_conditionkeywords.iterkeys())
_conditionre = re.compile(r'(%s)(?:$|\s+)' % '|'.join(_conditiontokens))
_directivestokenlist = _conditiontokens + \
@@ -691,7 +691,7 @@ def parsemakesyntax(d, offset, stopon, iterfunc):
while True: # this is not a for loop because `di` changes during the function
assert stacktop is not None
try:
s, token, tokenoffset, offset = next(di)
s, token, tokenoffset, offset = di.next()
except StopIteration:
break
+19 -19
View File
@@ -1,6 +1,6 @@
import logging, re, os
from . import data, parser, functions, util
from io import StringIO
import data, parser, functions, util
from cStringIO import StringIO
from pymake.globrelative import hasglob, glob
_log = logging.getLogger('pymake.data')
@@ -76,7 +76,7 @@ def parsecommandlineargs(args):
overrides = []
stmts = StatementList()
r = []
for i in range(0, len(args)):
for i in xrange(0, len(args)):
a = args[i]
vname, t, val = util.strpartition(a, ':=')
@@ -195,7 +195,7 @@ class Rule(Statement):
deps = list(_expandwildcards(makefile, data.stripdotslashes(self.depexp.resolvesplit(makefile, makefile.variables))))
if ispattern:
rule = data.PatternRule(targets, list(map(data.Pattern, deps)), self.doublecolon, loc=self.targetexp.loc)
rule = data.PatternRule(targets, map(data.Pattern, deps), self.doublecolon, loc=self.targetexp.loc)
makefile.appendimplicitrule(rule)
else:
rule = data.Rule(deps, self.doublecolon, loc=self.targetexp.loc, weakdeps=False)
@@ -207,7 +207,7 @@ class Rule(Statement):
context.currule = rule
def dump(self, fd, indent):
print("%sRule %s: %s" % (indent, self.targetexp, self.depexp), file=fd)
print >>fd, "%sRule %s: %s" % (indent, self.targetexp, self.depexp)
def to_source(self):
sep = ':'
@@ -285,7 +285,7 @@ class StaticPatternRule(Statement):
context.currule = rule
def dump(self, fd, indent):
print("%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp), file=fd)
print >>fd, "%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp)
def to_source(self):
sep = ':'
@@ -339,7 +339,7 @@ class Command(Statement):
context.currule.addcommand(self.exp)
def dump(self, fd, indent):
print("%sCommand %s" % (indent, self.exp,), file=fd)
print >>fd, "%sCommand %s" % (indent, self.exp,)
def to_source(self):
# Commands have some interesting quirks when it comes to source
@@ -438,7 +438,7 @@ class SetVariable(Statement):
v.set(vname, flavor, self.source, value)
def dump(self, fd, indent):
print("%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value), file=fd)
print >>fd, "%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value)
def __eq__(self, other):
if not isinstance(other, SetVariable):
@@ -452,7 +452,7 @@ class SetVariable(Statement):
def to_source(self):
chars = []
for i in range(0, len(self.value)):
for i in xrange(0, len(self.value)):
c = self.value[i]
# Literal # is escaped in variable assignment otherwise it would be
@@ -651,14 +651,14 @@ class ConditionBlock(Statement):
i += 1
def dump(self, fd, indent):
print("%sConditionBlock" % (indent,), file=fd)
print >>fd, "%sConditionBlock" % (indent,)
indent2 = indent + ' '
for c, statements in self._groups:
print("%s Condition %s" % (indent, c), file=fd)
print >>fd, "%s Condition %s" % (indent, c)
statements.dump(fd, indent2)
print("%s ~Condition" % (indent,), file=fd)
print("%s~ConditionBlock" % (indent,), file=fd)
print >>fd, "%s ~Condition" % (indent,)
print >>fd, "%s~ConditionBlock" % (indent,)
def to_source(self):
lines = []
@@ -681,7 +681,7 @@ class ConditionBlock(Statement):
if len(self) != len(other):
return False
for i in range(0, len(self)):
for i in xrange(0, len(self)):
our_condition, our_statements = self[i]
other_condition, other_statements = other[i]
@@ -793,7 +793,7 @@ class Include(Statement):
makefile.include(f, self.required, loc=self.exp.loc, weak=self.weak)
def dump(self, fd, indent):
print("%sInclude %s" % (indent, self.exp), file=fd)
print >>fd, "%sInclude %s" % (indent, self.exp)
def to_source(self):
prefix = ''
@@ -840,7 +840,7 @@ class VPathDirective(Statement):
makefile.addvpath(pattern, dirs)
def dump(self, fd, indent):
print("%sVPath %s" % (indent, self.exp), file=fd)
print >>fd, "%sVPath %s" % (indent, self.exp)
def to_source(self):
return 'vpath %s' % self.exp.to_source()
@@ -885,7 +885,7 @@ class ExportDirective(Statement):
makefile.exportedvars[v] = True
def dump(self, fd, indent):
print("%sExport (single=%s) %s" % (indent, self.single, self.exp), file=fd)
print >>fd, "%sExport (single=%s) %s" % (indent, self.single, self.exp)
def to_source(self):
return ('export %s' % self.exp.to_source()).rstrip()
@@ -915,7 +915,7 @@ class UnexportDirective(Statement):
makefile.exportedvars[v] = False
def dump(self, fd, indent):
print("%sUnexport %s" % (indent, self.exp), file=fd)
print >>fd, "%sUnexport %s" % (indent, self.exp)
def to_source(self):
return 'unexport %s' % self.exp.to_source()
@@ -947,7 +947,7 @@ class EmptyDirective(Statement):
raise data.DataError("Line expands to non-empty value", self.exp.loc)
def dump(self, fd, indent):
print("%sEmptyDirective: %s" % (indent, self.exp), file=fd)
print >>fd, "%sEmptyDirective: %s" % (indent, self.exp)
def to_source(self):
return self.exp.to_source()
+25 -25
View File
@@ -10,9 +10,9 @@ import site
from collections import deque
# XXXkhuey Work around http://bugs.python.org/issue1731717
subprocess._cleanup = lambda: None
from . import command, util
import command, util
if sys.platform=='win32':
from . import win32process
import win32process
_log = logging.getLogger('pymake.process')
@@ -28,7 +28,7 @@ def tokens2re(tokens):
# which matches the pattern and captures it in a named match group.
# The group names and patterns come are given as a dict in the function
# argument.
nonescaped = r'(?<!\\)(?:%s)' % '|'.join('(?P<%s>%s)' % (name, value) for name, value in tokens.items())
nonescaped = r'(?<!\\)(?:%s)' % '|'.join('(?P<%s>%s)' % (name, value) for name, value in tokens.iteritems())
# The final pattern matches either the above pattern, or an escaped
# backslash, captured in the "escape" match group.
return re.compile('(?:%s|%s)' % (nonescaped, r'(?P<escape>\\\\)'))
@@ -115,7 +115,7 @@ class ClineSplitter(list):
self._push(self.cline[:m.start()])
self.cline = self.cline[m.end():]
match = dict([(name, value) for name, value in list(m.groupdict().items()) if value])
match = dict([(name, value) for name, value in m.groupdict().items() if value])
if 'quote' in match:
# " or ' start a quoted string
if match['quote'] == '"':
@@ -129,7 +129,7 @@ class ClineSplitter(list):
elif 'special' in match:
# Unquoted, non-escaped special characters need to be sent to a
# shell.
raise MetaCharacterException(match['special'])
raise MetaCharacterException, match['special']
elif 'whitespace' in match:
# Whitespaces terminate current argument.
self._next()
@@ -145,7 +145,7 @@ class ClineSplitter(list):
self.glob = True
self._push(m.group(0))
else:
raise Exception("Shouldn't reach here")
raise Exception, "Shouldn't reach here"
if self.arg:
self._next()
@@ -153,20 +153,20 @@ class ClineSplitter(list):
# Single quoted strings are preserved, except for the final quote
index = self.cline.find("'")
if index == -1:
raise Exception('Unterminated quoted string in command')
raise Exception, 'Unterminated quoted string in command'
self._push(self.cline[:index])
self.cline = self.cline[index+1:]
def _parse_doubly_quoted(self):
if not self.cline:
raise Exception('Unterminated quoted string in command')
raise Exception, 'Unterminated quoted string in command'
while self.cline:
m = _doubly_quoted_tokens.search(self.cline)
if not m:
raise Exception('Unterminated quoted string in command')
raise Exception, 'Unterminated quoted string in command'
self._push(self.cline[:m.start()])
self.cline = self.cline[m.end():]
match = dict([(name, value) for name, value in list(m.groupdict().items()) if value])
match = dict([(name, value) for name, value in m.groupdict().items() if value])
if 'quote' in match:
# a double quote ends the quoted string, so go back to
# unquoted parsing
@@ -175,7 +175,7 @@ class ClineSplitter(list):
# Unquoted, non-escaped special characters in a doubly quoted
# string still have a special meaning and need to be sent to a
# shell.
raise MetaCharacterException(match['special'])
raise MetaCharacterException, match['special']
elif 'escape' in match:
# Escaped backslashes turn into a single backslash
self._push('\\')
@@ -194,7 +194,7 @@ def clinetoargv(cline, cwd):
str = _escapednewlines.sub('', cline)
try:
args = ClineSplitter(str, cwd)
except MetaCharacterException as e:
except MetaCharacterException, e:
return None, e.char
if len(args) and args[0].find('=') != -1:
@@ -327,12 +327,12 @@ class PopenJob(Job):
# general overview of "subprocess PATH semantics and portability".
oldpath = os.environ['PATH']
try:
if self.env is not None and 'PATH' in self.env:
if self.env is not None and self.env.has_key('PATH'):
os.environ['PATH'] = self.env['PATH']
p = subprocess.Popen(self.argv, executable=self.executable, shell=self.shell, env=self.env, cwd=self.cwd)
return p.wait()
except OSError as e:
print(e, file=sys.stderr)
except OSError, e:
print >>sys.stderr, e
return -127
finally:
os.environ['PATH'] = oldpath
@@ -383,30 +383,30 @@ class PythonJob(Job):
try:
__import__(self.module)
except Exception as e:
print('Error importing %s: %s' % (
self.module, e), file=sys.stderr)
print >>sys.stderr, 'Error importing %s: %s' % (
self.module, e)
return -127
m = sys.modules[self.module]
if self.method not in m.__dict__:
print("No method named '%s' in module %s" % (self.method, self.module), file=sys.stderr)
print >>sys.stderr, "No method named '%s' in module %s" % (self.method, self.module)
return -127
rv = m.__dict__[self.method](self.argv)
if rv != 0 and rv is not None:
print((
print >>sys.stderr, (
"Native command '%s %s' returned value '%s'" %
(self.module, self.method, rv)), file=sys.stderr)
(self.module, self.method, rv))
return (rv if isinstance(rv, int) else 1)
except PythonException as e:
print(e, file=sys.stderr)
except PythonException, e:
print >>sys.stderr, e
return e.exitcode
except:
e = sys.exc_info()[1]
if isinstance(e, SystemExit) and (e.code == 0 or e.code is None):
pass # sys.exit(0) is not a failure
else:
print(e, file=sys.stderr)
print >>sys.stderr, e
traceback.print_exc()
return -127
finally:
@@ -461,7 +461,7 @@ class ParallelContext(object):
def _docall_generic(self, pool, job, cb, echo, justprint):
if echo is not None:
print(echo)
print echo
processcb = job.get_callback(ParallelContext._condition)
if justprint:
processcb(0)
@@ -491,7 +491,7 @@ class ParallelContext(object):
def _checkdone():
jobs = []
for c in ParallelContext._allcontexts:
for i in range(0, len(c.running)):
for i in xrange(0, len(c.running)):
if c.running[i][0].done:
jobs.append(c.running[i])
for j in jobs:
+2 -2
View File
@@ -82,7 +82,7 @@ else:
return str[:offset], token, str[offset + len(token):]
try:
from builtins import any
from __builtin__ import any
except ImportError:
def any(it):
for i in it:
@@ -138,7 +138,7 @@ class MostUsedCache(object):
return item.o
def verify(self):
for k, v in self.d.items():
for k, v in self.d.iteritems():
if v.o:
assert v in self.active
else:
+3 -3
View File
@@ -1,10 +1,10 @@
import pymake.data, pymake.functions, pymake.util
import unittest
import re
from io import StringIO
from cStringIO import StringIO
def multitest(cls):
for name in cls.testdata.keys():
for name in cls.testdata.iterkeys():
def m(self, name=name):
return self.runSingle(*self.testdata[name])
@@ -63,7 +63,7 @@ class LRUTest(unittest.TestCase):
c = pymake.util.LRUCache(3, self.spaceFunc, lambda k, v: k % 2)
self.assertEqual(tuple(c.debugitems()), ())
for i in range(0, len(self.expected)):
for i in xrange(0, len(self.expected)):
k, e, fc, di = self.expected[i]
v = c.get(k)
+1 -1
View File
@@ -277,7 +277,7 @@ class MakefileCorupusTest(TestBase):
self.assertEqual(len(statements), len(new_statements))
for i in range(0, len(statements)):
for i in xrange(0, len(statements)):
original = statements[i]
formatted = new_statements[i]
+6 -6
View File
@@ -2,10 +2,10 @@ import pymake.data, pymake.parser, pymake.parserdata, pymake.functions
import unittest
import logging
from io import StringIO
from cStringIO import StringIO
def multitest(cls):
for name in cls.testdata.keys():
for name in cls.testdata.iterkeys():
def m(self, name=name):
return self.runSingle(*self.testdata[name])
@@ -134,7 +134,7 @@ class IterTest(TestBase):
self.assertEqual(actual, expected)
if ifunc == pymake.parser.itermakefilechars:
print("testing %r" % expected)
print "testing %r" % expected
self.assertEqual(pymake.parser.flattenmakesyntax(d, 0), expected)
multitest(IterTest)
@@ -207,7 +207,7 @@ class MakeSyntaxTest(TestBase):
def compareRecursive(self, actual, expected, path):
self.assertEqual(len(actual), len(expected),
"compareRecursive: %s %r" % (path, actual))
for i in range(0, len(actual)):
for i in xrange(0, len(actual)):
ipath = path + [i]
a, isfunc = actual[i]
@@ -217,7 +217,7 @@ class MakeSyntaxTest(TestBase):
else:
self.assertEqual(type(a), getattr(pymake.functions, e['type']),
"compareRecursive: %s" % (ipath,))
for k, v in e.items():
for k, v in e.iteritems():
if k == 'type':
pass
elif k[0] == '[':
@@ -264,7 +264,7 @@ class VariableTest(TestBase):
m = pymake.data.Makefile()
stmts.execute(m)
for k, v in self.expected.items():
for k, v in self.expected.iteritems():
flavor, source, val = m.variables.get(k)
if val is None:
self.assertEqual(val, v, 'variable named %s' % k)
+13 -13
View File
@@ -63,7 +63,7 @@ def runTest(makefile, make, logfile, options):
"""
if os.path.exists(opts.tempdir): shutil.rmtree(opts.tempdir)
os.mkdir(opts.tempdir, 0o755)
os.mkdir(opts.tempdir, 0755)
logfd = open(logfile, 'w')
p = Popen(make + options['commandline'], stdout=logfd, stderr=STDOUT, env=options['env'])
@@ -78,15 +78,15 @@ def runTest(makefile, make, logfile, options):
logfd.close()
if stdout.find('TEST-FAIL') != -1:
print(stdout)
print stdout
return False, "FAIL (TEST-FAIL printed)"
if options['grepfor'] and stdout.find(options['grepfor']) == -1:
print(stdout)
print stdout
return False, "FAIL (%s not in output)" % options['grepfor']
if options['returncode'] == 0 and stdout.find('TEST-PASS') == -1:
print(stdout)
print stdout
return False, 'FAIL (No TEST-PASS printed)'
if options['returncode'] != 0:
@@ -94,7 +94,7 @@ def runTest(makefile, make, logfile, options):
return True, 'PASS'
print("%-30s%-28s%-28s" % ("Test:", "gmake:", "pymake:"))
print "%-30s%-28s%-28s" % ("Test:", "gmake:", "pymake:")
gmakefails = 0
pymakefails = 0
@@ -144,7 +144,7 @@ for makefile in makefiles:
if sys.platform in data:
d['returncode'] = data[sys.platform]
elif key == 'environment':
for k, v in data.items():
for k, v in data.iteritems():
d['env'][k] = v
elif key == 'grep-for':
d['grepfor'] = data
@@ -153,7 +153,7 @@ for makefile in makefiles:
elif key == 'skip':
d['skip'] = True
else:
print("%s: Unexpected #T key: %s" % (makefile, key), file=sys.stderr)
print >>sys.stderr, "%s: Unexpected #T key: %s" % (makefile, key)
sys.exit(1)
mdata.close()
@@ -190,12 +190,12 @@ for makefile in makefiles:
else:
pymakemsg = "OK (known fail)"
print("%-30.30s%-28.28s%-28.28s" % (os.path.basename(makefile),
gmakemsg, pymakemsg))
print "%-30.30s%-28.28s%-28.28s" % (os.path.basename(makefile),
gmakemsg, pymakemsg)
print()
print("Summary:")
print("%-30s%-28s%-28s" % ("", "gmake:", "pymake:"))
print
print "Summary:"
print "%-30s%-28s%-28s" % ("", "gmake:", "pymake:")
if gmakefails == 0:
gmakemsg = 'PASS'
@@ -207,7 +207,7 @@ if pymakefails == 0:
else:
pymakemsg = 'FAIL (%i failures)' % pymakefails
print("%-30.30s%-28.28s%-28.28s" % ('', gmakemsg, pymakemsg))
print "%-30.30s%-28.28s%-28.28s" % ('', gmakemsg, pymakemsg)
shutil.rmtree(opts.tempdir)
+5 -5
View File
@@ -4,7 +4,7 @@ from os import path
import re
import shutil
import sys
from urllib.request import urlopen
from urllib2 import urlopen
from release.paths import makeCandidatesDir
@@ -50,7 +50,7 @@ def findOldBuildIDs(product, version, buildNumber, platforms,
id = getBuildID(platform, product, version, n, nightlyDir,
server)
ids[platform].append(id)
except Exception as e:
except Exception, e:
log.error("Hit exception: %s" % e)
return ids
@@ -87,10 +87,10 @@ def readBranchConfig(dir, localconfig, branch, required=[]):
def readConfig(configfile, keys=[], required=[]):
c = {}
exec(compile(open(configfile, "rb").read(), configfile, 'exec'), c)
execfile(configfile, c)
for k in keys:
c = c[k]
items = list(c.keys())
items = c.keys()
err = False
for key in required:
if key not in items:
@@ -137,7 +137,7 @@ def getReleaseName(product, version, buildNumber):
def getRepoMatchingBranch(branch, sourceRepositories):
for sr in list(sourceRepositories.values()):
for sr in sourceRepositories.values():
if branch in sr['path']:
return sr
return None
+1 -1
View File
@@ -1,7 +1,7 @@
import difflib
import logging
import re
import urllib.request, urllib.error, urllib.parse
import urllib2
from util.commands import run_cmd, get_output
from util.hg import get_repo_name, make_hg_url
from subprocess import CalledProcessError
+24 -29
View File
@@ -13,11 +13,9 @@ import re
import subprocess
import sys
import pickle
from locale import getpreferredencoding
import mozpack.path as mozpath
encoding = getpreferredencoding(False)
class Pool(object):
def __new__(cls, size):
@@ -29,7 +27,7 @@ class Pool(object):
return super(Pool, cls).__new__(cls)
def imap_unordered(self, fn, iterable):
return map(fn, iterable)
return itertools.imap(fn, iterable)
def close(self):
pass
@@ -62,7 +60,7 @@ class File(object):
modified = True
if os.path.exists(self._path):
if open(self._path, 'r', encoding=encoding, errors='replace').read() == self._content:
if open(self._path, 'rb').read() == self._content:
modified = False
self._modified = modified
return modified
@@ -133,11 +131,11 @@ def maybe_clear_cache(data):
is_set = cache.get('ac_cv_env_%s_set' % precious) == 'set'
value = cache.get('ac_cv_env_%s_value' % precious) if is_set else None
if value != env.get(precious):
print('Removing %s because of %s value change from:' \
% (data['cache-file'], precious))
print(' %s' % (value if value is not None else 'undefined'))
print('to:')
print(' %s' % env.get(precious, 'undefined'))
print 'Removing %s because of %s value change from:' \
% (data['cache-file'], precious)
print ' %s' % (value if value is not None else 'undefined')
print 'to:'
print ' %s' % env.get(precious, 'undefined')
os.remove(data['cache-file'])
return True
return False
@@ -162,11 +160,9 @@ def get_config_files(data):
# Scan the config.status output for information about configuration files
# it generates.
raw_output = subprocess.check_output(
config_status_output = subprocess.check_output(
[data['shell'], '-c', '%s --help' % config_status],
stderr=subprocess.STDOUT)
config_status_output = raw_output.decode(encoding,
errors='replace').splitlines()
stderr=subprocess.STDOUT).splitlines()
state = None
for line in config_status_output:
if line.startswith('Configuration') and line.endswith(':'):
@@ -187,6 +183,7 @@ def get_config_files(data):
return config_files, command_files
def prepare(srcdir, objdir, shell, args):
parser = argparse.ArgumentParser()
parser.add_argument('--target', type=str)
@@ -235,7 +232,7 @@ def prepare(srcdir, objdir, shell, args):
'args': others,
'shell': shell,
'srcdir': srcdir,
'env': {str(k): str(v) for k, v in environ.items()},
'env': environ,
}
if args.cache_file:
@@ -252,9 +249,9 @@ def prepare(srcdir, objdir, shell, args):
except OSError as e:
if e.errno != errno.EEXIST:
raise
for k, v in data.items():
with open(data_file, 'wb') as f:
pickle.dump(data, f)
with open(data_file, 'wb') as f:
pickle.dump(data, f)
def prefix_lines(text, prefix):
@@ -264,6 +261,7 @@ def prefix_lines(text, prefix):
def run(objdir):
ret = 0
output = ''
with open(os.path.join(objdir, CONFIGURE_DATA), 'rb') as f:
data = pickle.load(f)
@@ -335,16 +333,14 @@ def run(objdir):
# We're going to run it ourselves.
command += ['--no-create']
print(prefix_lines('configuring', relobjdir))
print(prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir))
print prefix_lines('configuring', relobjdir)
print prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir)
sys.stdout.flush()
try:
raw_output = subprocess.check_output(command,
output += subprocess.check_output(command,
stderr=subprocess.STDOUT, cwd=objdir, env=data['env'])
output += raw_output.decode(encoding, errors='replace')
except subprocess.CalledProcessError as e:
err = e.output.decode(encoding, errors='replace')
return relobjdir, e.returncode, err
return relobjdir, e.returncode, e.output
# Leave config.status with a new timestamp if configure is newer than
# its original mtime.
@@ -372,13 +368,12 @@ def run(objdir):
if not skip_config_status:
if skip_configure:
print(prefix_lines('running config.status', relobjdir))
print prefix_lines('running config.status', relobjdir)
sys.stdout.flush()
try:
raw_output = subprocess.check_output([data['shell'], '-c',
output += subprocess.check_output([data['shell'], '-c',
'./config.status'], stderr=subprocess.STDOUT, cwd=objdir,
env=data['env'])
output += raw_output.decode(encoding, errors='replace')
except subprocess.CalledProcessError as e:
ret = e.returncode
output += e.output
@@ -400,9 +395,9 @@ def subconfigure(args):
args, others = parser.parse_known_args(args)
subconfigures = args.subconfigures
if args.list:
subconfigures.extend(open(args.list, 'r', encoding=encoding, errors='replace').read().splitlines())
subconfigures.extend(open(args.list, 'rb').read().splitlines())
if args.skip:
skips = set(open(args.skip, 'r', encoding=encoding, errors='replace').read().splitlines())
skips = set(open(args.skip, 'rb').read().splitlines())
subconfigures = [s for s in subconfigures if s not in skips]
if not subconfigures:
@@ -415,7 +410,7 @@ def subconfigure(args):
pool = Pool(len(subconfigures))
for relobjdir, returncode, output in \
pool.imap_unordered(run, subconfigures):
print(prefix_lines(output, relobjdir))
print prefix_lines(output, relobjdir)
sys.stdout.flush()
ret = max(returncode, ret)
if ret:
+7 -1
View File
@@ -290,6 +290,11 @@ fi
if [ -n "$LD_LIBRARY_PATH_64" ]; then
LD_LIBRARY_PATH_64=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARY_PATH_64:+":$LD_LIBRARY_PATH_64"}
fi
#
#
## Set SHLIB_PATH for HPUX
SHLIB_PATH=${MOZ_DIST_BIN}:${MRE_HOME}${SHLIB_PATH:+":$SHLIB_PATH"}
#
## Set LIBPATH for AIX
LIBPATH=${MOZ_DIST_BIN}:${MRE_HOME}${LIBPATH:+":$LIBPATH"}
#
@@ -334,6 +339,7 @@ then
fi
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
echo " LIBRARY_PATH=$LIBRARY_PATH"
echo " SHLIB_PATH=$SHLIB_PATH"
echo " LIBPATH=$LIBPATH"
echo " ADDON_PATH=$ADDON_PATH"
echo " MOZ_PROGRAM=$MOZ_PROGRAM"
@@ -344,7 +350,7 @@ then
fi
#
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
export LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
export SHLIB_PATH LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
if [ $moz_debug -eq 1 ]
then
+17 -17
View File
@@ -104,10 +104,10 @@ def DoSSHCommand(command, user, host, port=None, ssh_key=None):
try:
output = f(cmdline, stderr=STDOUT).strip()
except CalledProcessError as e:
print("failed ssh command output:")
print('=' * 20)
print(e.output)
print('=' * 20)
print "failed ssh command output:"
print '=' * 20
print e.output
print '=' * 20
raise
return output
@@ -118,7 +118,7 @@ def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None,
"""Upload file to user@host:remote_path using scp. Optionally use
port and ssh_key, if provided."""
if log:
print('Uploading %s' % file)
print 'Uploading %s' % file
cmdline = ["scp"]
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
cmdline.extend([WindowsPathToMsysPath(file),
@@ -221,8 +221,8 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
if not host or not user:
return {}
if (not path and not upload_to_temp_dir) or (path and upload_to_temp_dir):
print("One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
"defined.")
print "One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
"defined."
sys.exit(1)
if upload_to_temp_dir:
@@ -269,18 +269,18 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
if post_upload_command is not None:
if verbose:
print("Running post-upload command: " + post_upload_command)
print "Running post-upload command: " + post_upload_command
file_list = '"' + '" "'.join(remote_files) + '"'
output = DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
# We print since mozharness may parse URLs from the output stream.
print(output)
print output
properties = GetUrlProperties(output, package)
finally:
if upload_to_temp_dir:
DoSSHCommand("rm -rf %s" % path, user, host, port=port,
ssh_key=ssh_key)
if verbose:
print("Upload complete")
print "Upload complete"
return properties
def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
@@ -299,7 +299,7 @@ def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
if not os.path.exists(target_path):
os.makedirs(target_path)
if verbose:
print("Copying " + file + " to " + target_path)
print "Copying " + file + " to " + target_path
shutil.copy(file, target_path)
def WriteProperties(files, properties_file, url_properties, package):
@@ -341,20 +341,20 @@ if __name__ == '__main__':
help="Name of the main package.")
(options, args) = parser.parse_args()
if len(args) < 1:
print("You must specify at least one file to upload")
print "You must specify at least one file to upload"
sys.exit(1)
if not options.properties_file:
print("You must specify a --properties-file")
print "You must specify a --properties-file"
sys.exit(1)
if host == "localhost":
if upload_to_temp_dir:
print("Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost")
print "Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost"
sys.exit(1)
if post_upload_command:
# POST_UPLOAD_COMMAND is difficult to extract from the mozharness
# scripts, so just ignore it until it's no longer used anywhere
print("Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost")
print "Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost"
try:
if host == "localhost":
@@ -370,6 +370,6 @@ if __name__ == '__main__':
package=options.package, verbose=True)
WriteProperties(args, options.properties_file, url_properties, options.package)
except IOError as strerror:
print(strerror)
except IOError, (strerror):
print strerror
sys.exit(1)
+3 -3
View File
@@ -36,7 +36,7 @@ def count_ctors(filename):
# Even if we have .ctors, we shouldn't have any constructors in .ctors.
# Complain if .ctors does not look how we expect it to.
if have_ctors and n_ctors_ctors != 0:
print("Unexpected .ctors contents for", filename, file=sys.stderr)
print >>sys.stderr, "Unexpected .ctors contents for", filename
sys.exit(1)
return n_init_array_ctors
if have_ctors:
@@ -44,7 +44,7 @@ def count_ctors(filename):
# We didn't find anything; somebody switched initialization mechanisms on
# us, or the binary is completely busted. Complain either way.
print("Couldn't find .init_array or .ctors in", filename, file=sys.stderr)
print >>sys.stderr, "Couldn't find .init_array or .ctors in", filename
sys.exit(1)
if __name__ == '__main__':
@@ -60,5 +60,5 @@ if __name__ == '__main__':
}]}
]
}
print("PERFHERDER_DATA: %s" % json.dumps(perfherder_data))
print "PERFHERDER_DATA: %s" % json.dumps(perfherder_data)
+7 -7
View File
@@ -2,8 +2,8 @@
import os
import re
import subprocess
from urllib.parse import urlsplit
from configparser import RawConfigParser
from urlparse import urlsplit
from ConfigParser import RawConfigParser
from util.commands import run_cmd, get_output, remove_path
from util.retry import retry
@@ -105,7 +105,7 @@ def purge(dest):
try:
run_cmd(['hg', '--config', 'extensions.purge=', 'purge',
'-a', '--all', dest], cwd=dest)
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError, e:
log.debug('purge failed: %s' % e)
raise
@@ -306,7 +306,7 @@ def out(src, remote, **kwargs):
branch = "default"
revs.append((rev, branch))
return revs
except subprocess.CalledProcessError as inst:
except subprocess.CalledProcessError, inst:
# In some situations, some versions of Mercurial return "1"
# if no changes are found, so we need to ignore this return code
if inst.returncode == 1:
@@ -500,7 +500,7 @@ def apply_and_push(localrepo, remote, changer, max_attempts=10,
push(src=localrepo, remote=remote, ssh_username=ssh_username,
ssh_key=ssh_key, force=force)
return
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError, e:
log.debug("Hit error when trying to push: %s" % str(e))
if n == max_attempts:
log.debug("Tried %d times, giving up" % max_attempts)
@@ -515,7 +515,7 @@ def apply_and_push(localrepo, remote, changer, max_attempts=10,
try:
run_cmd(['hg', '--config', 'ui.merge=internal:merge',
'rebase'], cwd=localrepo)
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError, e:
log.debug("Failed to rebase: %s" % str(e))
update(localrepo, branch=branch)
for r in reversed(new_revs):
@@ -578,7 +578,7 @@ def adjust_paths(dest, **paths):
config.add_section('paths')
changed = False
for path_name, path_value in list(paths.items()):
for path_name, path_value in paths.items():
if (not config.has_option('paths', path_name) or
config.get('paths', path_name) != path_value):
changed = True
+1 -1
View File
@@ -11,6 +11,7 @@ mozbuild.pth:python/mozbuild
mozversioncontrol.pth:python/mozversioncontrol
mozlint.pth:python/mozlint
pymake.pth:build/pymake
optional:setup.py:python/psutil:build_ext:--inplace
optional:psutil.pth:python/psutil
which.pth:python/which
ply.pth:other-licenses/ply/
@@ -28,7 +29,6 @@ moztreedocs.pth:tools/docs
packages.txt:testing/mozbase/packages.txt
objdir:build
gyp.pth:media/webrtc/trunk/tools/gyp/pylib
six.pth:python/requests/requests/packages/urllib3/packages
pyasn1.pth:python/pyasn1
pyasn1_modules.pth:python/pyasn1-modules
bitstring.pth:python/bitstring
+11 -13
View File
@@ -23,8 +23,8 @@ BINSCOPE_OUTPUT_LOGFILE = r".\binscope_xml_output.log"
# usage
if len(sys.argv) < 3:
print("""usage : autobinscope.by path_to_binary path_to_symbols [log_file_path]"
log_file_path is optional, log will be written to .\binscope_xml_output.log by default""")
print """usage : autobinscope.by path_to_binary path_to_symbols [log_file_path]"
log_file_path is optional, log will be written to .\binscope_xml_output.log by default"""
sys.exit(0)
binary_path = sys.argv[1]
@@ -40,7 +40,7 @@ else:
try:
binscope_path = os.environ['BINSCOPE']
except KeyError:
print("BINSCOPE environment variable is not set, can't check DEP/ASLR etc. status.")
print "BINSCOPE environment variable is not set, can't check DEP/ASLR etc. status."
sys.exit(0)
try:
@@ -51,15 +51,13 @@ try:
"/c", "CompilerVersionCheck", "/c", "SafeSEHCheck", "/c", "SNCheck",
"/c", "DBCheck"], stdout=subprocess.PIPE)
except OSError as e:
errno = e.errno
strerror = e.strerror or str(e)
except WindowsError, (errno, strerror):
if errno != 2 and errno != 3:
print("Unexpected error ! \nError " + str(errno) + " : " + strerror + "\nExiting !\n")
print "Unexpected error ! \nError " + str(errno) + " : " + strerror + "\nExiting !\n"
sys.exit(0)
else:
print("Could not locate binscope at location : %s\n" % binscope_path)
print("Binscope wasn't installed or the BINSCOPE env variable wasn't set correctly, skipping this check and exiting...")
print "Could not locate binscope at location : %s\n" % binscope_path
print "Binscope wasn't installed or the BINSCOPE env variable wasn't set correctly, skipping this check and exiting..."
sys.exit(0)
proc.wait()
@@ -68,10 +66,10 @@ output = proc.communicate()[0]
# is this a PASS or a FAIL ?
if proc.returncode != 0:
print("Error count: %d" % proc.returncode)
print("TEST-UNEXPECTED-FAIL | autobinscope.py | %s is missing a needed Windows protection, such as /GS or ASLR" % binary_path)
print "Error count: %d" % proc.returncode
print "TEST-UNEXPECTED-FAIL | autobinscope.py | %s is missing a needed Windows protection, such as /GS or ASLR" % binary_path
logfile = open(log_file_path, "r")
for line in logfile:
print((line), end=' ')
print(line),
else:
print("TEST-PASS | autobinscope.py | %s succeeded" % binary_path)
print "TEST-PASS | autobinscope.py | %s succeeded" % binary_path
+1 -1
View File
@@ -39,6 +39,6 @@ def MergePGOFiles(basename, pgddir, pgcdir):
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: pgomerge.py <binary basename> <dist/bin>", file=sys.stderr)
print >>sys.stderr, "Usage: pgomerge.py <binary basename> <dist/bin>"
sys.exit(1)
MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])
+3 -3
View File
@@ -40,9 +40,9 @@ if __name__ == '__main__':
0, # no inherit
int(pid))
if handle:
print("Process %s:" % pid)
print "Process %s:" % pid
vsize, peak_vsize = get_vmsize(handle)
print("peak vsize: %d" % peak_vsize)
print "peak vsize: %d" % peak_vsize
ctypes.windll.kernel32.CloseHandle(handle)
else:
print("Couldn't open process %s" % pid)
print "Couldn't open process %s" % pid
+6 -6
View File
@@ -200,7 +200,7 @@ def format_manifest(manifest):
def write_zip(zip_path, prefix=None):
"""Write toolchain data to a zip file."""
if isinstance(prefix, str):
if isinstance(prefix, unicode):
prefix = prefix.encode('utf-8')
with JarWriter(file=zip_path, optimize=False, compress=5) as zip:
@@ -226,7 +226,7 @@ def write_zip(zip_path, prefix=None):
if __name__ == '__main__':
if len(sys.argv) != 3:
print(('usage: %s create-zip <path-prefix>' % sys.argv[0]))
print('usage: %s create-zip <path-prefix>' % sys.argv[0])
sys.exit(1)
assert sys.argv[1] == 'create-zip'
@@ -244,7 +244,7 @@ if __name__ == '__main__':
sha256.update(data)
sha512.update(data)
print(('Hashes of %s (size=%d)' % (destzip, len(data))))
print(('SHA-1: %s' % sha1.hexdigest()))
print(('SHA-256: %s' % sha256.hexdigest()))
print(('SHA-512: %s' % sha512.hexdigest()))
print('Hashes of %s (size=%d)' % (destzip, len(data)))
print('SHA-1: %s' % sha1.hexdigest())
print('SHA-256: %s' % sha256.hexdigest())
print('SHA-512: %s' % sha512.hexdigest())
+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',
+1 -1
View File
@@ -16,7 +16,7 @@ EXPORTS.mozilla.chrome += [
'RegistryMessageUtils.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'nsChromeProtocolHandler.cpp',
'nsChromeRegistry.cpp',
'nsChromeRegistryChrome.cpp',
+1 -1
View File
@@ -66,7 +66,7 @@ endif
SH := /bin/sh
PERL ?= perl
PYTHON ?= $(shell which python3 > /dev/null 2>&1 && echo python3 || echo python)
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
ifdef CONFIG_GUESS_SCRIPT
+12 -12
View File
@@ -22,7 +22,7 @@ if topsrcdir == '':
topsrcdir = '.'
def check_call_noisy(cmd, *args, **kwargs):
print("Executing command:", cmd)
print "Executing command:", cmd
check_call(cmd, *args, **kwargs)
def do_hg_pull(dir, repository, hg):
@@ -67,22 +67,22 @@ def do_cvs_export(modules, tag, cvsroot, cvs):
cvs_module = module_tuple[1]
fullpath = os.path.join(topsrcdir, module)
if os.path.exists(fullpath):
print("Removing '%s'" % fullpath)
print "Removing '%s'" % fullpath
shutil.rmtree(fullpath)
(parent, leaf) = os.path.split(module)
print("CVS export begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC"))
print "CVS export begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
check_call_noisy([cvs, '-d', cvsroot,
'export', '-r', tag, '-d', leaf, cvs_module],
cwd=os.path.join(topsrcdir, parent))
print("CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC"))
print "CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
def toggle_trailing_blank_line(depname):
"""If the trailing line is empty, then we'll delete it.
Otherwise we'll add a blank line."""
lines = open(depname, "r").readlines()
if not lines:
print("unexpected short file", file=sys.stderr)
print >>sys.stderr, "unexpected short file"
return
if not lines[-1].strip():
@@ -95,7 +95,7 @@ def toggle_trailing_blank_line(depname):
def get_trailing_blank_line_state(depname):
lines = open(depname, "r").readlines()
if not lines:
print("unexpected short file", file=sys.stderr)
print >>sys.stderr, "unexpected short file"
return "no blank line"
if not lines[-1].strip():
@@ -104,18 +104,18 @@ def get_trailing_blank_line_state(depname):
return "no blank line"
def update_nspr_or_nss(tag, depfile, destination, hgpath):
print("reverting to HG version of %s to get its blank line state" % depfile)
print "reverting to HG version of %s to get its blank line state" % depfile
check_call_noisy([options.hg, 'revert', depfile])
old_state = get_trailing_blank_line_state(depfile)
print("old state of %s is: %s" % (depfile, old_state))
print "old state of %s is: %s" % (depfile, old_state)
do_hg_replace(destination, hgpath, tag, HG_EXCLUSIONS, options.hg)
new_state = get_trailing_blank_line_state(depfile)
print("new state of %s is: %s" % (depfile, new_state))
print "new state of %s is: %s" % (depfile, new_state)
if old_state == new_state:
print("toggling blank line in: ", depfile)
print "toggling blank line in: ", depfile
toggle_trailing_blank_line(depfile)
tag_file = destination + "/TAG-INFO"
print(tag, file=file(tag_file, "w"))
print >>file(tag_file, "w"), tag
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname")
o.add_option("--skip-mozilla", dest="skip_mozilla",
@@ -139,7 +139,7 @@ except IndexError:
sys.exit(2)
if action in ('checkout', 'co'):
print("Warning: client.py checkout is obsolete.", file=sys.stderr)
print >>sys.stderr, "Warning: client.py checkout is obsolete."
pass
elif action in ('update_nspr'):
tag, = args[1:]
+5 -5
View File
@@ -46,7 +46,7 @@ class ZipFile(zipfile.ZipFile):
date_time=time.localtime(time.time()))
zinfo.compress_type = self.compression
# Add some standard UNIX file access permissions (-rw-r--r--).
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16L
else:
zinfo = zinfo_or_arcname
@@ -58,7 +58,7 @@ class ZipFile(zipfile.ZipFile):
# as the old, reuse the existing entry.
doSeek = False # store if we need to seek to the eof after overwriting
if zinfo.filename in self.NameToInfo:
if self.NameToInfo.has_key(zinfo.filename):
# Find the last ZipInfo with our name.
# Last, because that's catching multiple overwrites
i = len(self.filelist)
@@ -109,14 +109,14 @@ class ZipFile(zipfile.ZipFile):
# adjust file mode if we originally just wrote, now we rewrite
self.fp.close()
self.fp = open(self.filename, 'r+b')
all = [(zi, True) for zi in self.filelist] + \
[(zi, False) for zi in self._remove]
all = map(lambda zi: (zi, True), self.filelist) + \
map(lambda zi: (zi, False), self._remove)
all.sort(lambda l, r: cmp(l[0].header_offset, r[0].header_offset))
# empty _remove for multiple closes
self._remove = []
lengths = [all[i+1][0].header_offset - all[i][0].header_offset
for i in range(len(all)-1)]
for i in xrange(len(all)-1)]
lengths.append(self.end - all[-1][0].header_offset)
to_pos = 0
for (zi, keep), length in zip(all, lengths):
-354
View File
@@ -1,354 +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 https://mozilla.org/MPL/2.0/.
*
* C++ replacement for mozbuild/action/cl.py that wraps cl.exe on Windows.
* This is a Windows-only host tool, built well before XPCOM.
*/
#include <windows.h>
#include <string> // We don't use XPCOM string classes here.
#include <vector>
#include <fstream>
#include <algorithm>
#pragma warning(disable:4530)
using namespace std;
/* Make passed argv into a command line for cl.exe */
static wstring quoteArg(const wstring& aCmdArgv) {
bool addQuotes = aCmdArgv.find_first_of(L" \t\"") != wstring::npos;
if (!addQuotes) {
return aCmdArgv;
}
wstring out = L"\"";
size_t backslash = 0;
for (wchar_t ch : aCmdArgv) {
if (ch == L'\\') {
backslash++;
} else if (ch == L'"') {
// Escape all backslashes before a quote
out.append(backslash * 2, L'\\');
backslash = 0;
out += L"\\\"";
} else {
out.append(backslash, L'\\');
backslash = 0;
out += ch;
}
}
out.append(backslash * 2, L'\\');
out += L"\"";
return out;
}
/* We need to detect the showIncludes prefix to extract raw paths for
dep files, and drop the lines from display to avoid console spam. */
static string showIncludesPrefixDetection(const string& aLine) {
// Look for absolute Windows paths
size_t pos = string::npos;
// Drive letter: C:\...
for (size_t i = 0; i + 2 < aLine.size(); i++) {
if (isalpha((unsigned char)aLine[i]) &&
aLine[i + 1] == ':' &&
(aLine[i + 2] == '\\' || aLine[i + 2] == '/')) {
pos = i;
break;
}
}
// UNC path: \\server\share
if (pos == string::npos) {
if (aLine.size() >= 2 && aLine[0] == '\\' && aLine[1] == '\\') {
pos = 0;
}
}
if (pos == string::npos) {
return "";
}
// Prefix is everything before the path
return aLine.substr(0, pos);
}
/* Extract the header path from an include line using the known prefix */
static string extractHeaderPath(const string& aLine, const string& aPrefix) {
if (aLine.rfind(aPrefix, 0) != 0) {
return "";
}
// Strip prefix
string path = aLine.substr(aPrefix.size());
// Trim leading whitespace
while (!path.empty() && (path[0] == ' ' || path[0] == '\t')) {
path.erase(0, 1);
}
// Remove trailing newline
if (!path.empty() && (path.back() == '\n' || path.back() == '\r')) {
path.pop_back();
}
return path;
}
/* Sanitize a dependency path for Makefile depfiles.
Performs:
1. Strip trailing CR/LF
2. Strip leading MSVC indentation
3. Normalize slashes to '/'
4. Escape spaces and backslashes for Make */
static string sanitizeMakeDeps(string aLine) {
// 1. Strip trailing CR/LF
while (!aLine.empty() && (aLine.back() == '\r' || aLine.back() == '\n')) {
aLine.pop_back();
}
// 2. Strip leading indentation (MSVC indents include lines)
while (!aLine.empty() && (aLine.front() == ' ' || aLine.front() == '\t')) {
aLine.erase(aLine.begin());
}
// 3. Normalize slashes
for (char& ch : aLine) {
if (ch == '\\') {
ch = '/';
}
}
// 4. Escape for Make
string out;
out.reserve(aLine.size() * 2);
for (char ch : aLine) {
if (ch == ' ') {
out += "\\ ";
} else if (ch == '\\') {
// After normalization this shouldn't occur, but safe anyway
out += "\\\\";
} else {
out += ch;
}
}
return out;
}
/* MSYS1 does not use wide APIs, so ensure we get the narrow version here. */
static string getWinEnvVar(const char* aName) {
char buffer[32768];
DWORD length = GetEnvironmentVariableA(aName, buffer, sizeof(buffer));
if (length == 0 || length >= sizeof(buffer)) {
return string();
}
return string(buffer, length);
}
/* Exclude system headers by ignoring anything not in our directories.
* We don't know where people will put their objdir, so it has to be
* tracked separately.
*/
static bool isProjectDep(const string& aPath,
const string& aTopSrcDir,
const string& aTopObjDir) {
// We need forward slashes for our build system.
auto norm = [](string aStr) {
replace(aStr.begin(), aStr.end(), '\\', '/');
return aStr;
};
string path = norm(aPath);
string topSrcDir = norm(aTopSrcDir);
string topObjDir = norm(aTopObjDir);
// Must be absolute or relative under one of the two roots
return (path.rfind(topSrcDir, 0) == 0) ||
(path.rfind(topObjDir, 0) == 0);
}
/* Read stdout from the compiler pipe line-by-line, filtering include
lines and collecting dependency paths. */
static vector<string> processOutput(HANDLE aReadPipe) {
string lineBuf;
vector<string> deps;
string topSrcDir = getWinEnvVar("CL_TOPSRCDIR");
string topObjDir = getWinEnvVar("CL_TOPOBJDIR");
char buffer[4096];
DWORD bytesRead;
string includePrefix;
bool prefixFound = false;
while (ReadFile(aReadPipe, buffer, sizeof(buffer), &bytesRead, nullptr)) {
lineBuf.append(buffer, bytesRead);
size_t pos;
while ((pos = lineBuf.find('\n')) != string::npos) {
string line = lineBuf.substr(0, pos + 1);
lineBuf.erase(0, pos + 1);
if (!prefixFound) {
string maybe = showIncludesPrefixDetection(line);
if (!maybe.empty()) {
includePrefix = maybe;
prefixFound = true;
}
}
// If prefix is known and this line starts with it, it's an include line
if (prefixFound && line.rfind(includePrefix, 0) == 0) {
string header = extractHeaderPath(line, includePrefix);
if (!header.empty()) {
header = sanitizeMakeDeps(header);
if (isProjectDep(header, topSrcDir, topObjDir)) {
deps.push_back(header);
}
}
// This is an include line, don't print it
continue;
}
// Otherwise, just print
fwrite(line.data(), 1, line.size(), stdout);
}
}
if (!lineBuf.empty()) {
fwrite(lineBuf.data(), 1, lineBuf.size(), stdout);
}
return deps;
}
/* Convert a UTF-16 wide string to a UTF-8 narrow string. */
static string wideToUtf8(const wstring& aWide) {
if (aWide.empty()) {
return {};
}
int len = WideCharToMultiByte(CP_UTF8, 0, aWide.c_str(), -1, nullptr, 0, nullptr, nullptr);
string out(len - 1, '\0');
WideCharToMultiByte(CP_UTF8, 0, aWide.c_str(), -1, &out[0], len - 1, nullptr, nullptr);
return out;
}
/* Compute the .pp depfile path next to the given object file. */
static string makeDepfilePath(const string& aObjUtf8) {
size_t pos = aObjUtf8.find_last_of("/\\");
string dir = (pos == string::npos) ? "" : aObjUtf8.substr(0, pos + 1);
string base = (pos == string::npos) ? aObjUtf8 : aObjUtf8.substr(pos + 1);
return dir + ".deps/" + base + ".pp";
}
/* Write a Make-style dependency file for the given object and dep list. */
static void writeDepfile(const wstring& aObjFile, const vector<string>& aDeps) {
string objUtf8 = wideToUtf8(aObjFile);
string ppName = makeDepfilePath(objUtf8);
ofstream out(ppName);
out << objUtf8 << ":";
for (auto& dep : aDeps) {
out << " " << dep;
}
out << "\r\n";
}
int wmain(int argc, wchar_t** argv) {
if (argc < 2) {
fwprintf(stderr, L"Usage: action_cl.exe <compiler> [args...]\n");
return 1;
}
const wchar_t* compiler = argv[1];
// Build command line
wstring cmd = quoteArg(compiler);
wstring objFile;
wstring sourceFile;
cmd += L" -showIncludes";
for (int i = 2; i < argc; i++) {
cmd += L" ";
cmd += quoteArg(argv[i]);
}
vector<wchar_t> cmdLine(cmd.begin(), cmd.end());
cmdLine.push_back(L'\0');
for (int i = 2; i < argc; i++) {
wstring arg = argv[i];
if (arg.rfind(L"/Fo", 0) == 0 || arg.rfind(L"-Fo", 0) == 0) {
objFile = arg.substr(3); // strip /Fo or -Fo
}
if (!arg.empty() && arg[0] != L'-' && arg[0] != L'/') {
sourceFile = arg; // last non-flag argument is the source file
}
}
// Create pipe for capturing stdout
HANDLE readPipe, writePipe;
SECURITY_ATTRIBUTES sa = { sizeof(sa), nullptr, TRUE };
if (!CreatePipe(&readPipe, &writePipe, &sa, 0)) {
fwprintf(stderr, L"Failed to create pipe\n");
return 1;
}
SetHandleInformation(readPipe, HANDLE_FLAG_INHERIT, 0);
STARTUPINFOW si = { sizeof(si) };
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdOutput = writePipe;
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
PROCESS_INFORMATION pi;
BOOL ok = CreateProcessW(nullptr, cmdLine.data(), nullptr, nullptr, TRUE, 0, nullptr, nullptr, &si, &pi);
CloseHandle(writePipe);
if (!ok) {
fwprintf(stderr, L"Failed to launch compiler: %ls (error %lu)\n", compiler, GetLastError());
CloseHandle(readPipe);
return 1;
}
// Read compiler output and collect dependencies
auto deps = processOutput(readPipe);
CloseHandle(readPipe);
WaitForSingleObject(pi.hProcess, INFINITE);
DWORD exitCode = 0;
GetExitCodeProcess(pi.hProcess, &exitCode);
// Write the depfile only if we know the output object path
if (!objFile.empty()) {
string srcUtf8 = wideToUtf8(sourceFile);
deps.insert(deps.begin(), sanitizeMakeDeps(srcUtf8));
writeDepfile(objFile, deps);
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return exitCode;
}
+1 -1
View File
@@ -275,7 +275,7 @@ def check_style():
edges[inclname] = set()
# Process all the JS files.
for filename in list(js_names.keys()):
for filename in js_names.keys():
inclname = js_names[filename]
file_kind = FileKind.get(filename)
if file_kind == FileKind.C or file_kind == FileKind.CPP or \
+3 -4
View File
@@ -120,8 +120,8 @@ CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
ifdef _MSC_VER
CC_WRAPPER ?= $(DEPTH)/config/action_cl$(BIN_SUFFIX)
CXX_WRAPPER ?= $(DEPTH)/config/action_cl$(BIN_SUFFIX)
CC_WRAPPER ?= $(call py_action,cl)
CXX_WRAPPER ?= $(call py_action,cl)
endif # _MSC_VER
CC := $(CC_WRAPPER) $(CC)
@@ -562,8 +562,7 @@ endif
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
export CL_TOPOBJDIR = $(MOZ_BUILD_ROOT)
export CL_TOPSRCDIR = $(EXTERNAL_SOURCE_DIR)
export CL_INCLUDES_PREFIX
# Make sure that the build system can handle non-ASCII characters
# in environment variables to prevent it from breking silently on
# non-English systems.
+2 -4
View File
@@ -56,12 +56,10 @@ def generate_precomplete(root_path):
precomplete_file = open(precomplete_file_path, "wb")
rel_file_path_list, rel_dir_path_list = get_build_entries(root_path)
for rel_file_path in rel_file_path_list:
line = "remove \""+rel_file_path+"\"\n"
precomplete_file.write(line.encode('utf-8'))
precomplete_file.writelines("remove \""+rel_file_path+"\"\n")
for rel_dir_path in rel_dir_path_list:
line = "rmdir \""+rel_dir_path+"\"\n"
precomplete_file.write(line.encode('utf-8'))
precomplete_file.writelines("rmdir \""+rel_dir_path+"\"\n")
precomplete_file.close()
+2 -2
View File
@@ -36,7 +36,7 @@ def ensureParentDir(file):
if dir and not os.path.exists(dir):
try:
os.makedirs(dir)
except OSError as error:
except OSError, error:
if error.errno != errno.EEXIST:
raise
@@ -140,4 +140,4 @@ class ExpandArgs(list):
return [relativize(arg)]
if __name__ == '__main__':
print(" ".join(ExpandArgs(sys.argv[1:])))
print " ".join(ExpandArgs(sys.argv[1:]))
+7 -7
View File
@@ -305,11 +305,11 @@ class SectionFinder(object):
return syms
def print_command(out, args):
print("Executing: " + " ".join(args), file=out)
print >>out, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print(tmp + ":", file=out)
print >>out, tmp + ":"
with open(tmp) as file:
print("".join([" " + l for l in file.readlines()]), file=out)
print >>out, "".join([" " + l for l in file.readlines()])
out.flush()
def main(args, proc_callback=None):
@@ -339,14 +339,14 @@ def main(args, proc_callback=None):
proc = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
if proc_callback:
proc_callback(proc)
except Exception as e:
print('error: Launching', args, ':', e, file=sys.stderr)
except Exception, e:
print >>sys.stderr, 'error: Launching', args, ':', e
raise e
(stdout, stderr) = proc.communicate()
if proc.returncode and not options.verbose:
print_command(sys.stderr, args)
sys.stderr.buffer.write(stdout)
sys.stderr.buffer.flush()
sys.stderr.write(stdout)
sys.stderr.flush()
if proc.returncode:
return proc.returncode
return 0
+1 -1
View File
@@ -38,4 +38,4 @@ if __name__ == '__main__':
ensureParentDir(options.output)
with open(options.output, 'w') as outfile:
print(generate(args), file=outfile)
print >>outfile, generate(args)
-2
View File
@@ -101,8 +101,6 @@ else:
ASFLAGS += ['-no-integrated-as']
elif CONFIG['FFI_TARGET'] == 'AARCH64':
ffi_srcs = ('sysv.S', 'ffi.c')
elif CONFIG['FFI_TARGET'] == 'LOONGARCH64':
ffi_srcs = ('ffi.c', 'sysv.S')
elif CONFIG['FFI_TARGET'] == 'X86':
ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S')
elif CONFIG['FFI_TARGET'] == 'X86_64':
+1 -4
View File
@@ -29,10 +29,7 @@ if CONFIG['MOZ_WEBM_ENCODER']:
external_dirs += ['media/libvpx']
if CONFIG['MOZ_AV1']:
if CONFIG['AV1_USE_AOM']:
external_dirs += ['media/libaom']
else:
external_dirs += ['media/libdav1d']
external_dirs += ['media/libaom']
external_dirs += ['media/libpng']
+1 -1
View File
@@ -81,7 +81,7 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(addprefix $(TOPOBJDIR)/
--track install_$(subst /,_,$*).track \
$(TOPOBJDIR)/$* \
-DAB_CD=en-US \
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/$(MOZ_BUILD_APP)/locales/en-US/profile \
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \
$(ACDEFINES) \
install_$(subst /,_,$*)
+2 -2
View File
@@ -95,12 +95,12 @@ def count_lines():
"""Keep track of the amount of times individual lines occur, in order to
prioritize the errors which occur most frequently."""
counts = {}
for string,count in list(blacklist.items()):
for string,count in blacklist.items():
for line in string.split("\n"):
counts[line] = counts.get(line, 0) + count
lines = []
for k,v in list(counts.items()):
for k,v in counts.items():
lines.append("{0:6}: {1}".format(v, k))
lines.sort()
+2 -2
View File
@@ -18,7 +18,7 @@ def periodically_print_status(proc):
time.sleep(0.5)
idleTime += 0.5
if idleTime > 20 * 60:
print("Still linking, 20 minutes passed...")
print "Still linking, 20 minutes passed..."
sys.stdout.flush()
idleTime = 0
@@ -42,6 +42,6 @@ def wrap_linker(args):
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: link.py <commandline>", file=sys.stderr)
print >>sys.stderr, "Usage: link.py <commandline>"
sys.exit(1)
sys.exit(wrap_linker(sys.argv[1:]))
+1 -1
View File
@@ -8,4 +8,4 @@
# Referenced by milestone.py.
#--------------------------------------------------------
6.9.0
6.8.0
-8
View File
@@ -23,19 +23,11 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
'nsinstall.c',
'pathsub.c',
]
# stdc++compat depends on config/export, so avoid a circular
# dependency added by HostProgram depending on stdc++compat,
# while the program here is in C.
HostProgram('nsinstall_real', c_only=True)
if CONFIG['HOST_OS_ARCH'] == 'WINNT':
HOST_SOURCES +=[
'action_cl.cpp',
]
HostProgram('action_cl')
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True
+7 -7
View File
@@ -5,7 +5,7 @@
from unittest import TextTestRunner as _TestRunner, TestResult as _TestResult
import unittest
import inspect
from io import StringIO
from StringIO import StringIO
import os
import sys
@@ -140,7 +140,7 @@ class MockedOpen(object):
'''
def __init__(self, files = {}):
self.files = {}
for name, content in files.items():
for name, content in files.iteritems():
self.files[normcase(os.path.abspath(name))] = content
def __call__(self, name, mode = 'r'):
@@ -158,19 +158,19 @@ class MockedOpen(object):
return file
def __enter__(self):
import builtins
self.open = builtins.open
import __builtin__
self.open = __builtin__.open
self._orig_path_exists = os.path.exists
self._orig_path_isdir = os.path.isdir
self._orig_path_isfile = os.path.isfile
builtins.open = self
__builtin__.open = self
os.path.exists = self._wrapped_exists
os.path.isdir = self._wrapped_isdir
os.path.isfile = self._wrapped_isfile
def __exit__(self, type, value, traceback):
import builtins
builtins.open = self.open
import __builtin__
__builtin__.open = self.open
os.path.exists = self._orig_path_exists
os.path.isdir = self._orig_path_isdir
os.path.isfile = self._orig_path_isfile
+6 -3
View File
@@ -149,7 +149,7 @@ def _nsinstall_internal(argv):
# nsinstall as a native command is always UTF-8
def nsinstall(argv):
return _nsinstall_internal([str(arg, "utf-8") for arg in argv])
return _nsinstall_internal([unicode(arg, "utf-8") for arg in argv])
if __name__ == '__main__':
# sys.argv corrupts characters outside the system code page on Windows
@@ -173,7 +173,10 @@ if __name__ == '__main__':
# The first argv will be "python", the second will be the .py file
argv = argv_arr[1:argc.value]
else:
# On Py3, we shouldn't do this for non-Windows. sys.argv is UTF-8 (or ASCII on old Unix).
argv = sys.argv
# For consistency, do it on Unix as well
if sys.stdin.encoding is not None:
argv = [unicode(arg, sys.stdin.encoding) for arg in sys.argv]
else:
argv = [unicode(arg) for arg in sys.argv]
sys.exit(_nsinstall_internal(argv[1:]))
+6 -6
View File
@@ -5,27 +5,27 @@
import configobj
import sys
import re
from io import StringIO
from StringIO import StringIO
try:
(file, section, key) = sys.argv[1:]
except ValueError:
print("Usage: printconfigsetting.py <file> <section> <setting>")
print "Usage: printconfigsetting.py <file> <section> <setting>"
sys.exit(1)
with open(file) as fh:
content = re.sub(r'^\s*;', '#', fh.read(), flags=re.M)
content = re.sub('^\s*;', '#', fh.read(), flags=re.M)
c = configobj.ConfigObj(StringIO(content))
try:
s = c[section]
except KeyError:
print("Section [%s] not found." % section, file=sys.stderr)
print >>sys.stderr, "Section [%s] not found." % section
sys.exit(1)
try:
print(s[key])
print s[key]
except KeyError:
print("Key %s not found." % key, file=sys.stderr)
print >>sys.stderr, "Key %s not found." % key
sys.exit(1)
+2 -2
View File
@@ -9,7 +9,7 @@ Run a python script, adding extra directories to the python path.
def main(args):
def usage():
print("pythonpath.py -I directory script.py [args...]", file=sys.stderr)
print >>sys.stderr, "pythonpath.py -I directory script.py [args...]"
sys.exit(150)
paths = []
@@ -45,7 +45,7 @@ def main(args):
frozenglobals['__name__'] = '__main__'
frozenglobals['__file__'] = script
exec(compile(open(script, "rb").read(), script, 'exec'), frozenglobals)
execfile(script, frozenglobals)
# Freeze scope here ... why this makes things work I have no idea ...
frozenglobals = globals()
+5 -5
View File
@@ -18,7 +18,7 @@ def rebuild_check(args):
deps = args[1:]
t = mtime(target)
if t < 0:
print(target)
print target
return
newer = []
@@ -31,13 +31,13 @@ def rebuild_check(args):
newer.append(dep)
if newer and removed:
print('Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed)))
print 'Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed))
elif newer:
print('Rebuilding %s because %s changed' % (target, ', '.join(newer)))
print 'Rebuilding %s because %s changed' % (target, ', '.join(newer))
elif removed:
print('Rebuilding %s because %s was removed' % (target, ', '.join(removed)))
print 'Rebuilding %s because %s was removed' % (target, ', '.join(removed))
else:
print('Rebuilding %s for an unknown reason' % target)
print 'Rebuilding %s for an unknown reason' % target
if __name__ == '__main__':
import sys
+4
View File
@@ -348,7 +348,11 @@ ifdef SHARED_LIBRARY
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -bundle
else
ifdef MOZ_IOS
_LOADER_PATH := @rpath
else
_LOADER_PATH := @executable_path
endif
EXTRA_DSO_LDOPTS += -dynamiclib -install_name $(_LOADER_PATH)/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module
endif
endif
+3
View File
@@ -335,6 +335,8 @@ curses.h
cxxabi.h
DateTimeUtils.h
dbus/dbus.h
dbus/dbus-glib.h
dbus/dbus-glib-lowlevel.h
ddeml.h
Debug.h
dem.h
@@ -448,6 +450,7 @@ gtk/gtkx.h
gtk/gtkunixprint.h
HIToolbox/HIToolbox.h
hlink.h
ia64/sys/inline.h
Icons.h
iconv.h
ieeefp.h
+3 -2
View File
@@ -7,7 +7,7 @@ from tempfile import mkdtemp
from shutil import rmtree
import mozunit
from collections import UserString
from UserString import UserString
# Create a controlled configuration for use by expandlibs
config_win = {
'AR': 'lib',
@@ -120,7 +120,8 @@ class ReplicateTests(type):
del dict[name]
return type.__new__(cls, clsName, bases, dict)
class TestCaseWithTmpDir(unittest.TestCase, metaclass=ReplicateTests):
class TestCaseWithTmpDir(unittest.TestCase):
__metaclass__ = ReplicateTests
def init(self):
self.tmpdir = os.path.abspath(mkdtemp(dir=os.curdir))
+21 -21
View File
@@ -28,9 +28,9 @@ class TestNsinstall(unittest.TestCase):
# Unicode strings means non-ASCII children can be deleted properly on
# Windows
if sys.stdin.encoding is None:
tmpdir = str(self.tmpdir)
tmpdir = unicode(self.tmpdir)
else:
tmpdir = str(self.tmpdir, sys.stdin.encoding)
tmpdir = unicode(self.tmpdir, sys.stdin.encoding)
rmtree(tmpdir)
# utility methods for tests
@@ -50,14 +50,14 @@ class TestNsinstall(unittest.TestCase):
"Test nsinstall -D <dir>"
testdir = os.path.join(self.tmpdir, "test")
self.assertEqual(nsinstall(["-D", testdir]), 0)
self.assertTrue(os.path.isdir(testdir))
self.assert_(os.path.isdir(testdir))
def test_nsinstall_basic(self):
"Test nsinstall <file> <dir>"
testfile = self.touch("testfile")
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall([testfile, testdir]), 0)
self.assertTrue(os.path.isfile(os.path.join(testdir, "testfile")))
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
def test_nsinstall_basic_recursive(self):
"Test nsinstall <dir> <dest dir>"
@@ -76,12 +76,12 @@ class TestNsinstall(unittest.TestCase):
'-X', Xdir]), 0)
testdir = os.path.join(destdir, "sourcedir")
self.assertTrue(os.path.isdir(testdir))
self.assertTrue(os.path.isfile(os.path.join(testdir, "testfile")))
self.assertTrue(not os.path.exists(os.path.join(testdir, "Xfile")))
self.assertTrue(os.path.isdir(os.path.join(testdir, "copieddir")))
self.assertTrue(os.path.isfile(os.path.join(testdir, "copieddir", "testfile2")))
self.assertTrue(not os.path.exists(os.path.join(testdir, "Xdir")))
self.assert_(os.path.isdir(testdir))
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
self.assert_(not os.path.exists(os.path.join(testdir, "Xfile")))
self.assert_(os.path.isdir(os.path.join(testdir, "copieddir")))
self.assert_(os.path.isfile(os.path.join(testdir, "copieddir", "testfile2")))
self.assert_(not os.path.exists(os.path.join(testdir, "Xdir")))
def test_nsinstall_multiple(self):
"Test nsinstall <three files> <dest dir>"
@@ -91,7 +91,7 @@ class TestNsinstall(unittest.TestCase):
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall(testfiles + [testdir]), 0)
for f in testfiles:
self.assertTrue(os.path.isfile(os.path.join(testdir,
self.assert_(os.path.isfile(os.path.join(testdir,
os.path.basename(f))))
def test_nsinstall_dir_exists(self):
@@ -99,7 +99,7 @@ class TestNsinstall(unittest.TestCase):
srcdir = self.mkdirs("test")
destdir = self.mkdirs("testdir/test")
self.assertEqual(nsinstall([srcdir, os.path.dirname(destdir)]), 0)
self.assertTrue(os.path.isdir(destdir))
self.assert_(os.path.isdir(destdir))
def test_nsinstall_t(self):
"Test that nsinstall -t works (preserve timestamp)"
@@ -110,7 +110,7 @@ class TestNsinstall(unittest.TestCase):
os.utime(testfile, (t, t))
self.assertEqual(nsinstall(["-t", testfile, testdir]), 0)
destfile = os.path.join(testdir, "testfile")
self.assertTrue(os.path.isfile(destfile))
self.assert_(os.path.isfile(destfile))
self.assertEqual(os.stat(testfile).st_mtime,
os.stat(destfile).st_mtime)
@@ -125,7 +125,7 @@ class TestNsinstall(unittest.TestCase):
self.assertEqual(nsinstall(["-m", "{0:04o}"
.format(mode), testfile, testdir]), 0)
destfile = os.path.join(testdir, "testfile")
self.assertTrue(os.path.isfile(destfile))
self.assert_(os.path.isfile(destfile))
self.assertEqual(os.stat(testfile).st_mode,
os.stat(destfile).st_mode)
@@ -136,25 +136,25 @@ class TestNsinstall(unittest.TestCase):
testdir = self.mkdirs("testdir")
destdir = os.path.join(testdir, "subdir")
self.assertEqual(nsinstall(["-d", testfile, destdir]), 0)
self.assertTrue(os.path.isdir(os.path.join(destdir, "testfile")))
self.assert_(os.path.isdir(os.path.join(destdir, "testfile")))
if RUN_NON_ASCII_TESTS:
def test_nsinstall_non_ascii(self):
"Test that nsinstall handles non-ASCII files"
filename = "\u2325\u3452\u2415\u5081"
filename = u"\u2325\u3452\u2415\u5081"
testfile = self.touch(filename)
testdir = self.mkdirs("\u4241\u1D04\u1414")
testdir = self.mkdirs(u"\u4241\u1D04\u1414")
self.assertEqual(nsinstall([testfile.encode("utf-8"),
testdir.encode("utf-8")]), 0)
destfile = os.path.join(testdir, filename)
self.assertTrue(os.path.isfile(destfile))
self.assert_(os.path.isfile(destfile))
def test_nsinstall_non_ascii_subprocess(self):
"Test that nsinstall as a subprocess handles non-ASCII files"
filename = "\u2325\u3452\u2415\u5081"
filename = u"\u2325\u3452\u2415\u5081"
testfile = self.touch(filename)
testdir = self.mkdirs("\u4241\u1D04\u1414")
testdir = self.mkdirs(u"\u4241\u1D04\u1414")
# We don't use subprocess because it can't handle Unicode on
# Windows <http://bugs.python.org/issue1759845>. mozprocess calls
# CreateProcessW directly so it's perfect.
@@ -166,7 +166,7 @@ class TestNsinstall(unittest.TestCase):
self.assertEqual(rv, 0)
destfile = os.path.join(testdir, filename)
self.assertTrue(os.path.isfile(destfile))
self.assert_(os.path.isfile(destfile))
#TODO: implement -R, -l, -L and test them!
+11 -12
View File
@@ -11,7 +11,6 @@ import sys
import random
import copy
from string import letters
from functools import reduce
'''
Test case infrastructure for MozZipFile.
@@ -39,7 +38,7 @@ leafs = (
'firstdir/oneleaf',
'seconddir/twoleaf',
'thirddir/with/sub/threeleaf')
_lengths = [n * 64 for n in [16, 64, 80]]
_lengths = map(lambda n: n * 64, [16, 64, 80])
lengths = 3
writes = 5
@@ -72,7 +71,7 @@ def getid(descs):
def getContent(length):
'Get pseudo random content of given length.'
rv = [None] * length
for i in range(length):
for i in xrange(length):
rv[i] = random.choice(letters)
return ''.join(rv)
@@ -134,13 +133,13 @@ class TestExtensiveStored(unittest.TestCase):
def _verifyZip(self):
zf = zipfile.ZipFile(self.f)
badEntry = zf.testzip()
self.assertFalse(badEntry, badEntry)
self.failIf(badEntry, badEntry)
zlist = zf.namelist()
zlist.sort()
vlist = list(self.ref.keys())
vlist = self.ref.keys()
vlist.sort()
self.assertEqual(zlist, vlist)
for leaf, content in self.ref.items():
for leaf, content in self.ref.iteritems():
zcontent = zf.read(leaf)
self.assertEqual(content, zcontent)
@@ -159,16 +158,16 @@ class TestExtensiveStored(unittest.TestCase):
open(self.leaf('stage', leaf), 'w').write(content)
# all leafs in all lengths
atomics = list(prod(range(len(leafs)), range(lengths)))
atomics = list(prod(xrange(len(leafs)), xrange(lengths)))
# populate TestExtensiveStore with testcases
for w in range(writes):
for w in xrange(writes):
# Don't iterate over all files for the the first n passes,
# those are redundant as long as w < lengths.
# There are symmetries in the trailing end, too, but I don't know
# how to reduce those out right now.
nonatomics = [list(prod(list(range(min(i,len(leafs)))), range(lengths)))
for i in range(1, w+1)] + [atomics]
nonatomics = [list(prod(range(min(i,len(leafs))), xrange(lengths)))
for i in xrange(1, w+1)] + [atomics]
for descs in prod(*nonatomics):
suffix = getid(descs)
dicts = [dict(leaf=leaf, length=length) for leaf, length in descs]
@@ -182,9 +181,9 @@ for w in range(writes):
# and then write all atomics again.
# This should catch more or less all artifacts generated
# by the final ordering step when closing the jar.
files = [list(prod([i], range(lengths))) for i in range(len(leafs))]
files = [list(prod([i], xrange(lengths))) for i in xrange(len(leafs))]
allfiles = reduce(lambda l,r:l+r,
[list(prod(*files[:(i+1)])) for i in range(len(leafs))])
[list(prod(*files[:(i+1)])) for i in xrange(len(leafs))])
for first in allfiles:
testbasename = 'test{0}_'.format(getid(first))
+1 -1
View File
@@ -22,4 +22,4 @@ SRCDIR=$(dirname $0)
TOPSRCDIR="$SRCDIR"
export OLD_CONFIGURE="$SRCDIR"/old-configure
which python3 > /dev/null && exec python3 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
+22 -17
View File
@@ -10,11 +10,13 @@ import subprocess
import sys
import textwrap
base_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
from mozbuild.configure import ConfigureSandbox
from mozbuild.util import (
indented_repr,
encode,
)
@@ -34,24 +36,20 @@ def config_status(config):
# Ideally, all the backend and frontend code would handle the booleans, but
# there are so many things involved, that it's easier to keep config.status
# untouched for now.
def sanitized_values(v):
def sanitized_bools(v):
if v is True:
return '1'
if v is False:
return ''
if isinstance(v, dict):
return {key: sanitized_values(value) for key, value in v.items()}
if isinstance(v, (list, tuple)):
return [sanitized_values(value) for value in v]
return v
sanitized_config = {}
sanitized_config['substs'] = {
key: sanitized_values(value) for key, value in config.items()
if key not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
k: sanitized_bools(v) for k, v in config.iteritems()
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
}
sanitized_config['defines'] = {
key: sanitized_values(value) for key, value in config['DEFINES'].items()
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
}
sanitized_config['non_global_defines'] = config['non_global_defines']
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
@@ -62,16 +60,19 @@ def config_status(config):
# here, when we're able to skip configure tests/use cached results/not rely
# on autoconf.
print("Creating config.status", file=sys.stderr)
with codecs.open('config.status', 'w', encoding='utf-8', errors='replace') as fh:
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
with codecs.open('config.status', 'w', encoding) as fh:
fh.write(textwrap.dedent('''\
#!%(python)s
# coding=%(encoding)s
from __future__ import unicode_literals
''') % {'python': config['PYTHON'], 'encoding': 'utf-8'})
from mozbuild.util import encode
encoding = '%(encoding)s'
''') % {'python': config['PYTHON'], 'encoding': encoding})
# A lot of the build backend code is currently expecting byte
# strings and breaks in subtle ways with unicode strings. (bug 1296508)
for k, v in sanitized_config.items():
fh.write('%s = %s\n' % (k, indented_repr(v)))
for k, v in sanitized_config.iteritems():
fh.write('%s = encode(%s, encoding)\n' % (k, indented_repr(v)))
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
"'non_global_defines', 'substs', 'mozconfig']")
@@ -87,14 +88,18 @@ def config_status(config):
# executable permissions.
os.chmod('config.status', 0o755)
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
os.environ['WRITE_MOZINFO'] = '1'
os.environ[b'WRITE_MOZINFO'] = b'1'
from mozbuild.config_status import config_status
# Some values in sanitized_config also have more complex types, such as
# EnumString and tuples. Converting string subclasses to plain strings
# and tuples to lists keeps this code path consistent with the
# generated config.status file, which serializes iterables as lists.
return config_status(args=[], **sanitized_config)
# EnumString, which using when calling config_status would currently
# break the build, as well as making it inconsistent with re-running
# config.status. Fortunately, EnumString derives from unicode, so it's
# covered by converting unicode strings.
# A lot of the build backend code is currently expecting byte strings
# and breaks in subtle ways with unicode strings.
return config_status(args=[], **encode(sanitized_config, encoding))
return 0
@@ -143,8 +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" &&
value !== "revert" && value !== "revert-layer") {
if (value !== "inherit" && value !== "unset" && value !== "initial" && value !== "revert") {
tooltipType = TOOLTIP_FONTFAMILY_TYPE;
}
}
+6 -7
View File
@@ -204,22 +204,21 @@ function initialHTML(doc) {
os = "linux";
}
// The appRoot URI is prepended to all URIs instead of using a <base> element
// because the latter can cause spurious network requests (UXP Issue #3122)
let appRoot = "resource://devtools/client/jsonview/";
let base = doc.createElement("base");
base.href = "resource://devtools/client/jsonview/";
let style = doc.createElement("link");
style.rel = "stylesheet";
style.type = "text/css";
style.href = appRoot +"css/main.css";
style.href = "css/main.css";
let script = doc.createElement("script");
script.src = appRoot + "lib/require.js";
script.dataset.main = appRoot + "viewer-config.js";
script.src = "lib/require.js";
script.dataset.main = "viewer-config";
script.defer = true;
let head = doc.createElement("head");
head.append(style, script);
head.append(base, style, script);
return "<!DOCTYPE html>\n" +
startTag("html", {
@@ -4,8 +4,6 @@ subsuite = devtools
support-files =
array_json.json
array_json.json^headers^
csp_json.json
csp_json.json^headers^
doc_frame_script.js
head.js
invalid_json.json
@@ -24,7 +22,6 @@ subsuite = clipboard
subsuite = clipboard
[browser_jsonview_copy_rawdata.js]
subsuite = clipboard
[browser_jsonview_csp_json.js]
[browser_jsonview_filter.js]
[browser_jsonview_invalid_json.js]
[browser_jsonview_valid_json.js]
@@ -1,17 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_JSON_URL = URL_ROOT + "csp_json.json";
add_task(function* () {
info("Test CSP JSON started");
yield addJsonViewTab(TEST_JSON_URL);
let count = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
is(count, 1, "There must be one row");
});
@@ -1 +0,0 @@
{"csp": true}
@@ -1,2 +0,0 @@
Content-Type: application/json
Content-Security-Policy: default-src 'none'; base-uri 'none';
+1 -1
View File
@@ -23,7 +23,7 @@
* of the code base, so it's consistent and modules can be easily reused.
*/
require.config({
baseUrl: "resource://devtools/client/jsonview/",
baseUrl: ".",
paths: {
"devtools/client/shared": "resource://devtools/client/shared",
"devtools/shared": "resource://devtools/shared",
@@ -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.
+1 -1
View File
@@ -3,6 +3,6 @@
# 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/.
JS_PREFERENCE_FILES += [
JS_PREFERENCE_PP_FILES += [
'devtools.js',
]
+1 -2
View File
@@ -10,8 +10,7 @@ const SPECIALVALUES = new Set([
"initial",
"inherit",
"unset",
"revert",
"revert-layer"
"revert"
]);
const {getCSSLexer} = require("devtools/shared/css/lexer");
@@ -99,14 +99,7 @@ const filterList = [
];
// Valid values that shouldn't be parsed for filters.
const SPECIAL_VALUES = new Set([
"none",
"unset",
"initial",
"inherit",
"revert",
"revert-layer"
]);
const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit", "revert"]);
/**
* A CSS Filter editor widget used to add/remove/modify
@@ -103,6 +103,12 @@ function StyleSheetEditor(styleSheet, win, file, isNew, walker, highlighter) {
}
};
this._styleSheetFilePath = null;
if (styleSheet.href &&
Services.io.extractScheme(this.styleSheet.href) == "file") {
this._styleSheetFilePath = this.styleSheet.href;
}
this._onPropertyChange = this._onPropertyChange.bind(this);
this._onError = this._onError.bind(this);
this._onMediaRuleMatchesChange = this._onMediaRuleMatchesChange.bind(this);
@@ -658,7 +664,8 @@ StyleSheetEditor.prototype = {
if (this._friendlyName) {
defaultName = OS.Path.basename(this._friendlyName);
}
showFilePicker(file, true, this._window, onFile, defaultName);
showFilePicker(file || this._styleSheetFilePath, true, this._window,
onFile, defaultName);
},
/**
@@ -1,112 +1,98 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that 'Save' function works.
const TESTCASE_URI_HTML = TEST_BASE_HTTP + "simple.html";
const TESTCASE_URI_CSS = TEST_BASE_HTTP + "simple.css";
var tempScope = {};
Components.utils.import("resource://gre/modules/FileUtils.jsm", tempScope);
Components.utils.import("resource://gre/modules/NetUtil.jsm", tempScope);
var FileUtils = tempScope.FileUtils;
var NetUtil = tempScope.NetUtil;
add_task(function* () {
let htmlFile = yield copy(TESTCASE_URI_HTML, "simple.html");
const cssFile = await copy(TESTCASE_URI_CSS, "simple.css");
let uri = Services.io.newFileURI(htmlFile);
let filePath = uri.resolve("");
let { ui } = yield openStyleEditorForURL(filePath);
let editor = ui.editors[0];
yield editor.getSourceEditor();
is(
editor.savedFile,
null,
"savedFile should not be pre-populated from the source file"
);
info("Editing the style sheet.");
let dirty = editor.sourceEditor.once("dirty-change");
let beginCursor = {line: 0, ch: 0};
editor.sourceEditor.replaceText("DIRTY TEXT", beginCursor, beginCursor);
yield dirty;
is(editor.sourceEditor.isClean(), false, "Editor is dirty.");
ok(editor.summary.classList.contains("unsaved"),
"Star icon is present in the corresponding summary.");
info(
"Saving the changes with an explicit file (simulating a user-chosen save location)."
);
dirty = editor.sourceEditor.once("dirty-change");
editor.saveToFile(cssFile, function (file) {
ok(file, "file should get saved when explicitly passing a file");
});
yield dirty;
is(editor.sourceEditor.isClean(), true, "Editor is clean.");
ok(!editor.summary.classList.contains("unsaved"),
"Star icon is not present in the corresponding summary.");
is(
editor.savedFile?.path,
cssFile.path,
"savedFile should now be set on the editor"
);
});
function copy(srcChromeURL, destFileName) {
let deferred = defer();
let destFile = FileUtils.getFile("ProfD", [destFileName]);
write(read(srcChromeURL), destFile, deferred.resolve);
return deferred.promise;
}
function read(srcChromeURL) {
let scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
.getService(Ci.nsIScriptableInputStream);
let channel = NetUtil.newChannel({
uri: srcChromeURL,
loadUsingSystemPrincipal: true
});
let input = channel.open2();
scriptableStream.init(input);
let data = "";
while (input.available()) {
data = data.concat(scriptableStream.read(input.available()));
}
scriptableStream.close();
input.close();
return data;
}
function write(data, file, callback) {
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
let istream = converter.convertToInputStream(data);
let ostream = FileUtils.openSafeFileOutputStream(file);
NetUtil.asyncCopy(istream, ostream, function (status) {
if (!Components.isSuccessCode(status)) {
info("Couldn't write to " + file.path);
return;
}
callback(file);
});
}
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that 'Save' function works.
const TESTCASE_URI_HTML = TEST_BASE_HTTP + "simple.html";
const TESTCASE_URI_CSS = TEST_BASE_HTTP + "simple.css";
var tempScope = {};
Components.utils.import("resource://gre/modules/FileUtils.jsm", tempScope);
Components.utils.import("resource://gre/modules/NetUtil.jsm", tempScope);
var FileUtils = tempScope.FileUtils;
var NetUtil = tempScope.NetUtil;
add_task(function* () {
let htmlFile = yield copy(TESTCASE_URI_HTML, "simple.html");
yield copy(TESTCASE_URI_CSS, "simple.css");
let uri = Services.io.newFileURI(htmlFile);
let filePath = uri.resolve("");
let { ui } = yield openStyleEditorForURL(filePath);
let editor = ui.editors[0];
yield editor.getSourceEditor();
info("Editing the style sheet.");
let dirty = editor.sourceEditor.once("dirty-change");
let beginCursor = {line: 0, ch: 0};
editor.sourceEditor.replaceText("DIRTY TEXT", beginCursor, beginCursor);
yield dirty;
is(editor.sourceEditor.isClean(), false, "Editor is dirty.");
ok(editor.summary.classList.contains("unsaved"),
"Star icon is present in the corresponding summary.");
info("Saving the changes.");
dirty = editor.sourceEditor.once("dirty-change");
editor.saveToFile(null, function (file) {
ok(file, "file should get saved directly when using a file:// URI");
});
yield dirty;
is(editor.sourceEditor.isClean(), true, "Editor is clean.");
ok(!editor.summary.classList.contains("unsaved"),
"Star icon is not present in the corresponding summary.");
});
function copy(srcChromeURL, destFileName) {
let deferred = defer();
let destFile = FileUtils.getFile("ProfD", [destFileName]);
write(read(srcChromeURL), destFile, deferred.resolve);
return deferred.promise;
}
function read(srcChromeURL) {
let scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
.getService(Ci.nsIScriptableInputStream);
let channel = NetUtil.newChannel({
uri: srcChromeURL,
loadUsingSystemPrincipal: true
});
let input = channel.open2();
scriptableStream.init(input);
let data = "";
while (input.available()) {
data = data.concat(scriptableStream.read(input.available()));
}
scriptableStream.close();
input.close();
return data;
}
function write(data, file, callback) {
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
let istream = converter.convertToInputStream(data);
let ostream = FileUtils.openSafeFileOutputStream(file);
NetUtil.asyncCopy(istream, ostream, function (status) {
if (!Components.isSuccessCode(status)) {
info("Couldn't write to " + file.path);
return;
}
callback(file);
});
}
@@ -28,10 +28,7 @@ add_task(function* () {
let HTMLFile = yield copy(TESTCASE_URI_HTML, ["sourcemaps.html"]);
let CSSFile = yield copy(TESTCASE_URI_CSS,
["sourcemap-css", "sourcemaps.css"]);
const SCSSFile = await copy(TESTCASE_URI_SCSS, [
"sourcemap-sass",
"sourcemaps.scss",
]);
yield copy(TESTCASE_URI_SCSS, ["sourcemap-sass", "sourcemaps.scss"]);
yield copy(TESTCASE_URI_MAP, ["sourcemap-css", "sourcemaps.css.map"]);
yield copy(TESTCASE_URI_REG_CSS, ["simple.css"]);
@@ -62,7 +59,7 @@ add_task(function* () {
// Edit and save Sass in the editor. This will start off a file-watching
// process waiting for the CSS file to change.
yield editSCSS(SCSSFile, editor);
yield editSCSS(editor);
// We can't run Sass or another compiler, so we fake it by just
// directly changing the CSS file.
@@ -76,12 +73,12 @@ add_task(function* () {
is(color, "rgb(0, 0, 255)", "div is blue after saving file");
});
function editSCSS(SCSSFile, editor) {
function editSCSS(editor) {
let deferred = defer();
editor.sourceEditor.setText(CSS_TEXT);
editor.saveToFile(SCSSFile, function (file) {
editor.saveToFile(null, function (file) {
ok(file, "Scss file should be saved");
deferred.resolve();
});
+1 -2
View File
@@ -20,8 +20,7 @@ const SPECIALVALUES = new Set([
"inherit",
"transparent",
"unset",
"revert",
"revert-layer"
"revert"
]);
/**
@@ -43,7 +43,7 @@ class MachCommands(MachCommandBase):
if not os.path.exists(generated_dir):
generated_dir = mozpath.join(self.topsrcdir, 'platform',
'devtools/shared/css/generated')
if not os.path.exists(generated_dir):
else:
raise Exception('Directory expected at %s does not exist.' % generated_dir)
self.generated_dir = generated_dir
@@ -75,9 +75,6 @@ class MachCommands(MachCommandBase):
contents = subprocess.check_output([xpcshell_path, '-g', gre_path,
'-a', browser_path, script_path],
env = sub_env)
if not isinstance(contents, str):
contents = contents.decode('utf-8')
# Extract just the output between the delimiters as the xpcshell output can
# have extra output that we don't want.
contents = contents.split('DEVTOOLS_CSS_DB_DELIMITER')[1]
@@ -91,13 +88,13 @@ class MachCommands(MachCommandBase):
destination_path = mozpath.join(self.generated_dir,
'properties-db.js')
with open(js_template_path, 'r') as handle:
with open(js_template_path, 'rb') as handle:
js_template = handle.read()
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
contents = string.Template(js_template).substitute(substitutions)
with open(destination_path, 'w') as destination:
with open(destination_path, 'wb') as destination:
destination.write(preamble + contents)
print(('The database was successfully generated at ' + destination_path))
print('The database was successfully generated at ' + destination_path)
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1113,9 +1113,9 @@ Animation::ResumeAt(const TimeDuration& aReadyTime)
// but it's currently not necessary.
MOZ_ASSERT(mPendingState == PendingState::PlayPending,
"Expected to resume a play-pending animation");
MOZ_ASSERT(mHoldTime.IsNull() != mStartTime.IsNull(),
MOZ_ASSERT(!mHoldTime.IsNull() || !mStartTime.IsNull(),
"An animation in the play-pending state should have either a"
" resolved hold time or resolved start time (but not both)");
" resolved hold time or resolved start time");
// If we aborted a pending pause operation we will already have a start time
// we should use. In all other cases, we resolve it from the ready time.
+6 -9
View File
@@ -1,4 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
@@ -35,16 +36,12 @@ NS_INTERFACE_MAP_END
void
AnimationTimeline::NotifyAnimationUpdated(Animation& aAnimation)
{
if (mAnimations.Contains(&aAnimation)) {
return;
if (mAnimations.EnsureInserted(&aAnimation)) {
if (aAnimation.GetTimeline() && aAnimation.GetTimeline() != this) {
aAnimation.GetTimeline()->RemoveAnimation(&aAnimation);
}
mAnimationOrder.insertBack(&aAnimation);
}
if (aAnimation.GetTimeline() && aAnimation.GetTimeline() != this) {
aAnimation.GetTimeline()->RemoveAnimation(&aAnimation);
}
mAnimations.PutEntry(&aAnimation);
mAnimationOrder.insertBack(&aAnimation);
}
void
Loaded 100 of 5667 files, more files were not shown because too many files have changed in this diff. Show more