Граф коммитов

66319 Коммитов

Автор SHA1 Сообщение Дата
Matthew Gaudet 56663db2cb Bug 1341261: [Part 1] Enable CacheIR Compare ICs in Ion r=tcampbell
--HG--
extra : rebase_source : 788f7bb1eda50759165850e9f78ba41985563f0c
2018-05-15 16:10:50 -04:00
Matthew Gaudet 080064785c Bug 1341261: [Part 0] Enhance compare test case r=tcampbell
--HG--
extra : rebase_source : 29e7b183e0ea5452aa5af9a700ce5f0fd9a67079
2018-06-15 15:56:39 -07:00
Tooru Fujisawa da07964ec2 Bug 1476203 - Separate IfEmitter and CondEmitter. r=jwalden 2018-08-13 05:19:47 -07:00
Jon Coppeard babb91a3ce Bug 1481093 - Also update children of typed object type descriptor objects when compacting r=sfink a=abillings 2018-08-13 13:21:34 +01:00
Lars T Hansen 2f619dcffb Bug 1481171 - Properly emit signal handling metadata for wasm on aarch64. r=luke
As the aarch64 instruction emitters do not return the BufferOffset of
the access instruction, we have to resort to AutoForbidPools to keep
the metadata emitted at the correct address of the access.  Manual
inspection of the assembler code and the addressing modes used reveals
that this is viable, if it's done just so.

I've added comments to highlight the fact that it is a little brittle,
and the AutoForbidPools with an instruction window of 1 instruction
will cause failures if assumptions about the machine code should be
violated accidentally in the future.

--HG--
extra : rebase_source : 892744f1b16e970243ca2b2a11fa476b192cf615
extra : amend_source : e7d33696d0f02a48592d8a73f7eaafa32d443656
2018-08-10 11:09:44 +02:00
Nicholas Nethercote b9e071e2e8 Bug 1481998 - Make mozilla::Hash{Map,Set}'s entry storage allocation lazy. r=luke,sfink
Entry storage allocation now occurs on the first lookupForAdd()/put()/putNew().
This removes the need for init() and initialized(), and matches how
PLDHashTable/nsTHashtable work. It also removes the need for init() functions
in a lot of types that are built on top of mozilla::Hash{Map,Set}.

Pros:

- No need for init() calls and subsequent checks.

- No memory allocated for empty tables, which are not that uncommon.

Cons:

- An extra branch in lookup() and lookupForAdd(), but not in put()/putNew(),
  because the existing checkOverloaded() can handle it.

Specifics:

- Construction now can take a length parameter.

- init() is removed. Explicit length-setting, when necessary, now occurs in the
  constructors.

- initialized() is removed.

- capacity() now returns zero when the entry storage is absent.

- lookupForAdd() is no longer `const`, because it can instantiate the storage,
  which requires modifications.

- lookupForAdd() can now return an invalid AddPtr in two cases:

  - old: hashing failure (due to OOM in the hasher)

  - new: OOM while instantiating entry storage

  The existing failure handling paths for the old case work for the new case.

- clear(), finish(), and clearAndShrink() are replaced by clear(), compact(),
  and reserve(). The old compactIfUnderloaded() is also removed.

- Capacity computation code is now in its own functions, bestCapacity() and
  hashShift(). setTableSizeLog2() is removed.

- uint32_t is used throughout for capacities, instead of size_t, for
  consistency with other similar values.

- changeTableSize() now takes a capacity instead of a deltaLog2, and it can now
  handle !mTable.

Measurements:

- Total source code size is reduced by over 900 lines. Also, lots of existing
  lines got shorter (i.e. two checks were reduced to one).

- Executable size barely changed, down by 2 KiB on Linux64. The extra branches
  are compensated for by the lack of init() calls.

- Speed changed negligibly. The instruction count for Bench_Cpp_MozHash
  increased from 2.84 billion to 2.89 billion but any execution time change was
  well below noise.
2018-08-10 18:00:29 +10:00
Jan de Mooij b3d493f06a Bug 1482423 part 2 - Use js::IsSystemCompartment in xpc::AccessCheck::isChrome. r=mrbkap
--HG--
extra : rebase_source : 7998deb57b0fd8fddcc822bb726a29d3942d3601
2018-08-11 13:12:49 +02:00
Jan de Mooij ab76b86554 Bug 1482423 part 1 - Assert compartments don't contain both system/non-system realms. r=luke
--HG--
extra : rebase_source : 44c6949467eb246ac523fae3dbe96f5848ff2602
2018-08-11 13:12:49 +02:00
André Bargull 73eb837842 Bug 1481247: Don't compare pointers twice in MacroAssembler::compareStrings. r=tcampbell 2018-08-10 05:43:44 -07:00
Boris Zbarsky 4af64d8709 Bug 1479793. Throw when someone tries to define an accessor property with an integer name on a DOM proxy with an indexed setter. r=qdot,jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D2571

--HG--
extra : moz-landing-system : lando
2018-08-10 17:04:58 +00:00
Benjamin Bouvier 9671d15a89 Bug 1482365: Sync stack before branching in wasm baseline compiler's emitSetGlobal; r=lth
--HG--
extra : rebase_source : 7f879dcbda2f9d290f9767d85a4c331c42f9eb64
2018-08-10 12:00:41 +02:00
Jan de Mooij 17094cb561 Bug 1472976 part 6 - Remove unused xpc::AccessCheck::getPrincipal method. r=mrbkap 2018-08-10 11:57:40 +02:00
Jan de Mooij 0fdef26898 Bug 1472976 part 5 - Use xpc::GetRealmPrincipal instead of xpc::GetCompartmentPrincipal in xpc::GetObjectPrincipal. r=mrbkap 2018-08-10 11:57:40 +02:00
Jan de Mooij 90d9694728 Bug 1472976 part 4 - Use JS::GetRealmPrincipals instead of JS_GetCompartmentPrincipals in XPCWrappedNativeScope::GetPrincipal. r=mrbkap 2018-08-10 11:57:40 +02:00
Lars T Hansen 3956b572e1 Bug 1481171 - Remove failure path for lookupTrap(). r=luke
With asm.js atomics gone and wasm atomics opting in to standard
trap-based OOB handling, we should never fail to find a trap site.  So
assert that we always find it, and remove code that is now dead.

--HG--
extra : rebase_source : 5ae030ab9ac92f48d84328c7ed5048ced299eb20
extra : source : 7dc12de9bf40160f8809bbe4fc16f4b54f6e5fa6
extra : histedit_source : 240aef6bd1195f13789d4da8d28a6698bc3dbbff
2018-08-03 12:04:53 +02:00
Lars T Hansen d62785a24b Bug 1481171 - Wasm-specific atomics operations. r=luke
A large and mostly mechanical change: Prune the non-JS atomic APIs in
MacroAssembler.h and add many wasm-specific APIs instead.

The three non-JS APIs that remain in MacroAssembler.h could also be
removed but are used in multiple places to implement the JS APIs, and
it seemed fine to just leave them in.  They are after all generally
useful.

Note, this patch changes MIPS code so that it compiles, but it does
not insert the necessary emitting of metadata, partly because the
mechanics of that for 64-bit ops on 32-bit systems depends on the
implementation of those 64-bit ops, and partly because I am happy to
let the MIPS maintainers do the work and check it.  I have left behind
FIXME comments where changes are needed.

The one additional test case in jit-test is a result of closely
reading existing code and finding a bug that should have caused a
failure, but didn't, once the wasm/asm.js fallback for signal handling
was removed.

--HG--
extra : rebase_source : 4958997adb6050222bcde609dca6d00108c0a8f9
extra : histedit_source : b7fbcf868c60d7079d7827d98c7e7aad2d7d1f32
2018-08-06 15:55:49 +02:00
Gabriele Svelto 15adf94f4d Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.

--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 15:42:11 +02:00
Jim Blandy c5c3c1155d Bug 1481858: Update JS shell's newGlobal function's docs. r=jandem
--HG--
extra : rebase_source : f65e0992d81c0f9bc28dc8bd53ddd7685dc08d1a
2018-08-08 09:02:25 -07:00
Tooru Fujisawa 0fe826b214 Bug 1456404 - Part 7: Remove unused code/comment for SRC_FOR. r=jwalden 2018-08-10 07:49:18 +09:00
Tooru Fujisawa 978464da73 Bug 1456404 - Part 6: Add DoWhileEmitter. r=jwalden 2018-08-10 07:49:18 +09:00
Tooru Fujisawa d5a7f8c86f Bug 1456404 - Part 5: Add WhileEmitter. r=jwalden 2018-08-10 07:49:18 +09:00
Tooru Fujisawa c222abbe9c Bug 1456404 - Part 4: Add ForOfEmitter. r=jwalden 2018-08-10 07:49:18 +09:00
Tooru Fujisawa dcdb65e46d Bug 1456404 - Part 3: Add ForInEmitter. r=jwalden 2018-08-10 07:49:17 +09:00
Tooru Fujisawa 267bd83861 Bug 1456404 - Part 2: Add CForEmitter. r=jwalden 2018-08-10 07:49:17 +09:00
Tooru Fujisawa ccad82538f Bug 1456404 - Part 1: Move loop related bytecode/offset handling to LoopControl. r=jwalden 2018-08-10 07:49:17 +09:00
Tooru Fujisawa f3ffec503c Bug 1478936 - Fix the comment for JS_GetFunctionArity, and add JS_GetFunctionLength which matches to the original comment, and fixed consumer. r=jandem 2018-08-10 07:49:17 +09:00
Jon Coppeard cfb6e5c306 Bug 1482135 - Always root Scope::Data pointers when creating scopes r=jandem 2018-08-09 18:19:47 +01:00
Matthew Gaudet bbe9f6cb48 Bug 1482133 - [Part 3] Stop using shared stubs machinery r=jandem
--HG--
extra : rebase_source : fe94f04c7a46378cf65aefc43f81a8531371fec4
2018-08-09 10:38:43 -04:00
Matthew Gaudet 1db44eaa6c Bug 1482133 - [Part 2] Relocate NewArrayFallback to Baseline r=jandem
--HG--
extra : rebase_source : 3c1d173a9ed150c51bfdcc8fee03aa225cbfccc2
2018-08-08 17:00:33 -04:00
Matthew Gaudet 30e0d94a23 Bug 1482133 - [Part 1] Disable NewArray Ion Shared Stub r=jandem
--HG--
extra : rebase_source : 60afdef52bf63bbf514372592dd401c5702e178a
2018-08-08 15:58:16 -04:00
Lars T Hansen 5284e9667e Bug 1343981 - Perform unaligned memory accesses from high to low on ARM, and emit metadata. r=bbouvier
Three interlocking changes here:

- when accessing an unaligned word, access bytes in high-to-low order
- emit metadata for the first (highest) byte accessed
- when accessing a multi-word item (i64, f64), access the highest
  addressed word first

Most of these changes are straightforward.  In a couple of cases I
un-nested tangled control flows by breaking things into cases; this
leads to a little duplicated code but is IMO much easier to follow.

--HG--
extra : rebase_source : cd3b856b60b22c9e153452e984feeadc64103f25
2018-08-07 18:55:34 +02:00
Jan de Mooij ece8e1f443 Bug 1481793 part 4 - Use the CCW's realm for Debugger.Object referents. r=jimb
--HG--
extra : rebase_source : eedfb6967d7d1a47b163d70daa8c435a1c0d48a9
2018-08-09 13:34:40 +02:00
Jan de Mooij fc69dc387b Bug 1481793 part 3 - Assert cross-compartment wrappers don't wrap other CCWs. r=luke
--HG--
extra : rebase_source : 0c46484c8271ca11aa1c2fcf22833a72c14022af
2018-08-09 13:34:40 +02:00
Jan de Mooij ae8dfe71f2 Bug 1481793 part 2 - Do a CheckedUnwrap in JS_StructuredClone. r=luke
--HG--
extra : rebase_source : 765d3c0be208b6aabc2db0c2aef52a31914b97c8
2018-08-09 13:34:40 +02:00
Jan de Mooij 5149585ee0 Bug 1481793 part 1 - Use assertSameCompartment instead of AutoRealm in JSStructuredCloneWriter::write. r=luke
--HG--
extra : rebase_source : b22d34f26062550f76a8017503c90ae2152c35d2
2018-08-09 13:34:40 +02:00
Jan de Mooij 2c9cefda61 Bug 1480678 part 11 - Wrap the typed array in the current compartment instead of entering its realm in WriteStructuredCloneImageData. r=bz
This is also better security-wise: if we're writing the structured clone in some compartment that shouldn't have access to the underlying data of the ImageData, we shouldn't be giving that access here.
2018-08-09 10:48:29 +02:00
Jan de Mooij 6b5c6b10aa Bug 1481772 - Remove unnecessary JSAutoRealm in mozJSComponentLoader::ImportInto. r=kmag 2018-08-09 10:48:29 +02:00
Ted Campbell 3d03b347e6 Bug 1479900 - Part 2: Refactor GC relocation to use a reserved flag. r=sfink
This refactors gc::Cell derived types to start with a uintptr_t-sized
field with the low bits reserved for the GC and uses these bits for
relocation mechanism.

- JSString now stores flags in a uintptr_t. On 32-bit platforms, a
  second field is used to hold length.
- Redefine JSString flag bit positions to avoid cell reserved bits.
- Forwarded Cells are now indicated by a reserved flag instead of a
  magic invalid-pointer-like value.
- gc::RelocationOverlay now extends gc::Cell
- Update js::Symbol, js::Scope and js::BigInt fields to be compatible.

MozReview-Commit-ID: Cs5OavbHmqK
2018-08-08 18:16:43 -04:00
Ted Campbell c8528d6865 Bug 1479900 - Part 1: Use accessor methods for JSString::flags/length. r=sfink
Add accessor methods so that underlying storage strategy can be changed
later. This patch should not change current behaviour.

MozReview-Commit-ID: IRA53TQShe6
2018-08-08 18:16:42 -04:00
Daniel Varga 31ff8cd9c8 Merge mozilla-central to mozilla inbound. a=merge 2018-08-09 01:10:56 +03:00
Mike Hommey 6d197a0707 Bug 1481719 - Disable profile-instr-out-of-date warnings explicitly rather than allowing all warnings where they appear. r=dmajor 2018-08-09 06:07:33 +09:00
Nathan Froyd 49dcc19d92 Bug 1481505 - add aarch64 bits to DEFINES and DSO_LDOPTS; r=dmajor
Not having _ARM64_ in DEFINES makes any number of things go wrong.
2018-08-08 16:37:05 -04:00
Matthew Gaudet daab071c17 Bug 1480493 - Remove initializer kind from JSOP_NEWINIT r=arai
Differential Revision: https://phabricator.services.mozilla.com/D2675

--HG--
extra : moz-landing-system : lando
2018-08-08 00:01:52 +00:00
Chris Peterson dc642862f3 Bug 1481097 - wasm: Remove inline template workaround for gcc 4.8.5 bug. r=lth
This gcc 4.8.5 workaround (from bug 1316850) is no longer needed because Firefox currently requires gcc 6.1 or later (as of bug 1444274).

MozReview-Commit-ID: 4JFmOYoJnMH

--HG--
extra : rebase_source : f348a629f25f6852250306d969262372460a677a
extra : source : cb42b2192694148ffdf97c3a5c2fabb2578a0ec0
2018-07-22 00:21:45 -07:00
Brindusan Cristian 37bf8a10b0 Backed out 3 changesets (bug 1378808) for wpt failures on /content-security-policy/securitypolicyviolation/targeting.html.
Backed out changeset 6c6a609463ab (bug 1378808)
Backed out changeset 6dd9c641346a (bug 1378808)
Backed out changeset e732697778c2 (bug 1378808)
2018-08-08 04:40:19 +03:00
Kris Maglione 25c94b46d8 Bug 1481021: Part 1 - Fix tests that rely on permissive COWs or SpecialPowers side-effects in frame script scopes. r=bz
Right now, a lot of test code relies on side-effects of SpecialPowers being
loaded into frame script globals. In particular:

- It forces permissive COWs from those scopes, which allows frame scripts to
  pass objects from those scopes to unprivileged content that they otherwise
  wouldn't.
- It imports a bunch of helper modules and WebIDL globals which would
  otherwise not be available.

Fortunately, this seems to only impact test code at this point. But there's a
real down-the-road risk of it impacting shipping code, which ends up working
in automation due to the side-effects of SpecialPowers, but failing in real
world use.

MozReview-Commit-ID: G27eSSOHymX

--HG--
extra : rebase_source : 1702e63fed719fc92def2bdbbb8a7c53572432db
extra : source : 41bedc526dd6ec6b7e8c7be1c832ac60c81d6263
2018-08-07 14:13:06 -07:00
Brindusan Cristian 16ec846afc Backed out 2 changesets (bug 1481021) for bc failures on security/sandbox/test/browser_bug1393259.js.
Backed out changeset c53c7b0249ad (bug 1481021)
Backed out changeset 41bedc526dd6 (bug 1481021)
2018-08-08 03:22:16 +03:00
Jim Blandy 1d92752dd6 Bug 1073753: Document GC sensitivity of Debugger.prototype.onNewGlobalObject. r=jorendorff DONTBUILD 2018-08-07 11:33:56 -07:00
Luke Wagner e3bab28609 Bug 1469395 - Baldr: remove dead JS::WasmModule::notifyWhenCompilationComplete() support (r=lth) 2018-08-08 12:14:38 -05:00
Luke Wagner fda4936899 Bug 1469395 - Remove support for storing WebAssembly.Modules in IDB (r=lth,janv,Ms2ger)
--HG--
extra : rebase_source : 12926772e15c8a46d25e7c3927754d25fcdbed87
2018-08-08 12:13:16 -05:00
Bogdan Tara 80c3d569e2 Backed out 5 changesets (bug 1473213) for devtools/client/debugger/new/test/mochitest/browser_dbg_rr_breakpoints-01.js failures
Backed out changeset 29f9f3ab9b41 (bug 1473213)
Backed out changeset 129c9ab66f59 (bug 1473213)
Backed out changeset 96e57dd562b8 (bug 1473213)
Backed out changeset e40d822d886b (bug 1473213)
Backed out changeset 8a10fc261acb (bug 1473213)
2018-08-08 18:14:29 +03:00
André Bargull eb97fc0f86 Bug 1481248: Use strict instead of sloppy equals for 'throw' method check in yield*. r=arai
--HG--
extra : rebase_source : 2f870217171182dad620aa2a873cd682e28f95e3
2018-08-06 08:43:43 -07:00
André Bargull df8bb57817 Bug 1481032: Non-extensible arrays are already shrunk to capacity. r=jandem
--HG--
extra : rebase_source : 2f16cef5abeb8531323afd2dbb1d1cfa83d5a784
2018-08-06 08:35:36 -07:00
André Bargull d536179485 Bug 1480963: Remove initialized-length is equal to capacity check in getDenseInitializedLength. r=jandem
--HG--
extra : rebase_source : baa4d514ad2b1085f7763f0b0de488c458b7340d
2018-08-06 08:34:42 -07:00
André Bargull 90eb5c8d04 Bug 1480575: Implement cmp32 with Address operands for ARM MacroAssembler and use it in LIsPackedArray. r=mgaudet
--HG--
extra : rebase_source : f564e6187b568ed32604ba0f974bfd2a938c3f92
2018-08-02 13:24:02 -07:00
Jan de Mooij 1b991ab653 Bug 1481467 part 3 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in XrayTraits::attachExpandoObject. r=bz
Because XrayTraits::attachExpandoObject operates in the Xray target realm/compartment and we cannot use the Xray wrapper with JSAutoRealm, we pass the caller's global as exclusiveWrapperGlobal and use that.

This also changes XrayWrapper<Base, Traits>::defineProperty to call ensureExpandoObject in the wrapper (instead of target) realm. This didn't matter before, because ensureExpandoObject immediately entered the target realm anyway.
2018-08-08 15:14:02 +02:00
Jan de Mooij 48b99bc1f0 Bug 1481467 part 2 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in JSXrayTraits::getOwnPropertyFromTargetIfSafe. r=bz
Because getOwnPropertyFromTargetIfSafe operates in the Xray target realm/compartment and we cannot use the Xray wrapper with JSAutoRealm, we pass the caller's global as wrapperGlobal and use that.
2018-08-08 15:12:16 +02:00
Jan de Mooij 21af7a61b0 Bug 1481467 part 1 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in mozJSComponentLoader::ImportInto. r=kmag
The targetVal argument is always same-compartment with the JSContext, so we only need to use JSAutoRealm in the FindTargetObject case.
2018-08-08 15:07:41 +02:00
Jon Coppeard 9169087867 Bug 1481484 - Type Scope::data_ r=jandem 2018-08-08 13:22:56 +01:00
Jon Coppeard 9d6255073d Bug 1481196 - Compile module scripts to a JSScript like we do for classic scripts r=jandem r=baku 2018-08-08 10:40:03 +01:00
Paul Bone ae0b1db9bd Bug 1473213 (Part 5) - Only record allocation counts on Nightly builds r=jonco
--HG--
extra : rebase_source : fc08649811bfce781660667256f0541e692d7b65
2018-07-26 00:35:25 +10:00
Paul Bone 0c73982d50 Bug 1473213 (Part 4) - Add cells allocated statistics r=sfink
--HG--
extra : rebase_source : 667c5db83b674e28602fe38ca73bc6f250717c64
2018-08-08 12:54:50 +10:00
Paul Bone 3e4c1ee795 Bug 1473213 (Part 3) - Refactor JSContext code for changing zones r=sfink
* Introduce a setZone method that changes the zone and the freelist.
 * leaveAtomsZone() private

--HG--
extra : rebase_source : 1da68a20211b410b651a4d12548f09b3b942b017
2018-08-08 12:05:59 +10:00
Paul Bone 0647dd2041 Bug 1473213 (Part 2) - add a comment about an invariant required by the JIT r=sfink
--HG--
extra : rebase_source : 0e2b341e0a12917f0584143803a39140a060886d
extra : source : 4e59349dd9776f329c9545aa994c6f490f11d105
2018-07-16 11:36:49 +10:00
Paul Bone e0abcaa9c4 Bug 1473213 (Part 1) - Track the number of tenured cells r=jonco
--HG--
extra : rebase_source : ea625486c1c067d2a5ce4686f32f93886c16aded
extra : source : 445b672aa024fdfca38a2e819f54bcbf28e922dd
2018-07-20 15:09:01 +10:00
agashlin@mozilla.com a03dfcbd42 bug 1397297, make SnowWhite freeing more incremental, r=smaug
--HG--
extra : rebase_source : 0772adabddb6cee33d83184d32c981d3920ea6e6
2018-08-08 09:14:58 +03:00
Logan F Smyth 96dd9699d1 Bug 1378808 - Use ::Arguments or ::PropertyName location for method call column offsets. r=jorendorff
MozReview-Commit-ID: G8mG1qsIO21

--HG--
extra : rebase_source : b5a72b239156617319fc6dabe111c02c13f621c9
2018-07-12 11:51:17 -07:00
Logan F Smyth 190da876ea Bug 1378808 - Add a new ParseNodeKind::PropertyName to hold location information about property access name. r=jorendorff
MozReview-Commit-ID: J4vHz4ln5Zt

--HG--
extra : rebase_source : ef066b750f7fac7057335446dd6040da8b7de8e8
extra : source : 3b4f4db5d3d78170faf00bdf9fe2a562ad155fd5
2018-07-12 11:29:05 -07:00
Logan F Smyth fa5586057e Bug 1378808 - Add a new ParseNodeKind::Arguments node type for call argument lists. r=jorendorff
MozReview-Commit-ID: 7L4nNHjVoZo

--HG--
extra : rebase_source : 8ccc04cb335a227c45a332ded88408d6a2ec7c09
2018-07-12 11:24:59 -07:00
Kris Maglione c1969dbca2 Bug 1481021: Part 1 - Fix tests that rely on permissive COWs or SpecialPowers side-effects in frame script scopes. r=bz
Right now, a lot of test code relies on side-effects of SpecialPowers being
loaded into frame script globals. In particular:

- It forces permissive COWs from those scopes, which allows frame scripts to
  pass objects from those scopes to unprivileged content that they otherwise
  wouldn't.
- It imports a bunch of helper modules and WebIDL globals which would
  otherwise not be available.

Fortunately, this seems to only impact test code at this point. But there's a
real down-the-road risk of it impacting shipping code, which ends up working
in automation due to the side-effects of SpecialPowers, but failing in real
world use.

MozReview-Commit-ID: G27eSSOHymX

--HG--
extra : rebase_source : c528dffe3a54eec75ad6cb358980b783b00eb4a4
2018-08-07 14:13:06 -07:00
Nathan Froyd c69869e83a Bug 1481239 - fix non-DEBUG VIXL_UNREACHABLE; r=jandem
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE takes a reason string, which
wasn't being provided, which in turn led to a lot of warning spam.
2018-08-07 08:37:17 -04:00
Jan de Mooij caa8441bb2 Bug 1481229 part 2 - Always use the unwrapped object in Logging::formatObject. r=evilpie 2018-08-07 14:06:45 +02:00
Jan de Mooij b5ec5d2e1e Bug 1481229 part 1 - Remove unnecessary realm entering in JavaScriptShared::findObjectById. r=evilpie
ToWindowProxyIfWindow does not rely on the current realm in any way.
2018-08-07 14:06:45 +02:00
Jan de Mooij 5824a03a39 Bug 1478359 - Store a global object in nsXPCWrappedJS and use it for realm-entering. r=mccr8
The problem we're solving here: getting/entering the realm/global of a cross-compartment wrapper doesn't make sense once there are multiple realms in a compartment and the CCW will be shared by all of them. Because nsXPCWrappedJS can store a CCW, we will no longer be able to use this JSObject to enter the target realm.

What this patch does: we pass a JSContext* to nsXPCWrappedJS::GetNewOrUsed and we use this to store a global object in nsXPCWrappedJS (with the invariant that the object and global stored in nsXPCWrappedJS are same-compartment). Then when we want to enter the nsXPCWrappedJS's target realm, we use this global object instead of the maybe-CCW object. Because we currently still have one realm per compartment and the objects are same-compartment, this is guaranteed to preserve behavior for now.

nsXPCWrappedJS has some code to deal with weak pointers. Fortunately this applies only to root wrappers and root wrappers always store an unwrapped JSObject, so the extra global we store is guaranteed to be marked by the GC in that case (a global object is never collected when there are live JSObjects belonging to the same realm).
2018-08-07 11:57:41 +02:00
arthur.iakab 2d528aa145 Merge mozilla-central to inbound 2018-08-07 12:41:15 +03:00
Ms2ger 8f6fcafd68 Bug 1480454 - Part e: Stop running disabled wpt tests in jstests; r=jgraham 2018-08-07 10:18:31 +02:00
Ms2ger 970755f67e Bug 1480454 - Part d: Don't run wpt jstests in the jsreftest harness; r=bbouvier
These tests already run in the browser within the wpt setup.
2018-08-07 10:18:31 +02:00
Ms2ger c73ddf8544 Bug 1480454 - Part c: Give RefTestCase a useful __repr__ implementation; r=bbouvier 2018-08-07 10:18:31 +02:00
Ms2ger 6cd332bb7f Bug 1480454 - Part b: Improve assertion in _emit_manifest_at; r=bbouvier
This adds a message to the assertion, and removes a leftover pdb invocation
(which causes unnecessary delays if it is triggered in automation).
2018-08-07 10:18:31 +02:00
Ms2ger 82d9496d6a Bug 1480454 - Part a: Add a wasm setting to the wpt .ini expectation files; r=jgraham 2018-08-07 10:18:31 +02:00
Nicholas Nethercote 46db021929 Bug 1481138 - Remove HashMap::lookupWithDefault(). r=luke
Because it's quite strange, badly named, not that useful, and barely used.

Also remove WeakMap::lookupWithDefault(), which is similar, but not used at
all.

MozReview-Commit-ID: IhIl4hQ73U1

--HG--
extra : rebase_source : 7da237a56391836ca5d056248f18bd5e2d8b1564
2018-08-06 09:45:38 +10:00
Nicholas Nethercote d9eb003725 Bug 1481138 - Remove the add() variant in HashTable and GCHashTable that uses a default value. r=luke
Because (a) it's kinda weird, and (b) only used in a single test, where it can
be easily replaced with a vanilla add().

MozReview-Commit-ID: L4RoxFb7yGG

--HG--
extra : rebase_source : 515a5ede5d417686907345ad9069c6a41669dd17
2018-08-06 09:10:05 +10:00
Jan-Ivar Bruaroey f3ef96fcc0 Bug 1480306: Fix unused variable variable 'hasLineOfContext' in TokenStream.cpp. r=Waldo
MozReview-Commit-ID: EK1IAvCZFwv

--HG--
extra : rebase_source : 8ed430ca01927142f77814a81364c6645c3a2581
2018-08-01 22:46:17 -04:00
Masatoshi Kimura 3b21b7868b Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : c09366fb93e5b0f72abe1e99d3094e3d96a934fb
extra : intermediate-source : 5950c9d63c3b4fd63a25464a7b50944aaec7079f
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Lars T Hansen 2bb8c3a9cf Bug 1423577 - Remove asm.js atomics support. r=luke
--HG--
extra : rebase_source : c08664dc1afc6bc458d65d0898a5c2cdfa49fa34
2018-08-03 10:09:10 +02:00
Nicholas Nethercote e39fda4c40 Bug 1480668 - Remove js::CStringHashPolicy. r=luke
It's identical to mozilla::CStringHasher.

Also fix a comment at the top of HashTable.h about CStringHasher.

--HG--
extra : rebase_source : 92176c4f6ea8041f309764b4ce0271a494853a7b
2018-08-06 07:55:50 +10:00
Narcis Beleuzu 7f1248b11b Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-05 12:52:39 +03:00
Sebastian Hengst 818a3f61d2 Bug 1480991 - exit mailbox.js early if wasm threads not supported. r=lth
MozReview-Commit-ID: EvN67pluT09

--HG--
extra : rebase_source : 3d680aa90623bfcd66b5bd82bcbf0d07e0a347cc
2018-08-04 23:14:51 +03:00
Brian Hackett 8eb62dd065 Bug 1479058 Part 8 - Store time warp target on nsIScriptError, r=smaug.
--HG--
extra : rebase_source : 1faf5a0c0ead57f5dfb24c7450873977bf41a022
2018-08-02 23:31:29 +00:00
Brian Hackett 49770ee0cf Bug 1479058 Part 7 - Store time warp target on Error objects, r=jandem.
--HG--
extra : rebase_source : b848b53d363797e2894630b4f9dac59a51481f6d
2018-08-02 23:30:54 +00:00
Noemi Erli 23c8a3a9f3 Backed out changeset 1e9ecba54e7b (bug 1348273) for failing on widget/tests/test_bug1123480.xul 2018-08-04 12:39:40 +03:00
Dorel Luca 33b000ddd1 Merge mozilla-central to mozilla-inbound 2018-08-04 01:31:40 +03:00
Dorel Luca 5c509fd70a Backed out changeset 8c763e66ba84 (bug 1397297) for frequent mochitest failures. a=backout 2018-08-04 01:27:15 +03:00
Nathan Froyd 7074ffc753 Bug 1480588 - restrict rtdsc Time.h functions to x86ish processors on Windows; r=luke
__rtdsc is not going to work so well on AArch64.
2018-08-03 18:07:35 -04:00
Gabriele Svelto 50ba13cce4 Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant functions are updated to take a typed enum (in C++) and an
integer constant (in JavaScript). A JavaScript wrapper around the crash
reporter service is provided to hold the constants. The existing whitelists
and blacklists of annotations are also generated from the YAML file and the
existing duplicate code has been consolidated. Once written out to the .extra
file the annotations are converted in string form and are no different than
the existing ones.

All existing annotations have been included (and some obsolete ones removed)
and all call sites have been updated including tests.

--HG--
extra : rebase_source : b4f0d4bf83c64851028c271d3fab3ebcb6fbcd3e
2018-07-05 15:42:11 +02:00
Nika Layzell 051eb6dcbd Bug 1480624 - Part 2: Add a DestructValue method to XPConnect to run XPT Type destructors, r=mccr8
Summary:
DestructValue acts a lot like CleanupValue, however in addition to normal
cleanup work, it invokes the destructor of complex data types. This is important
to ensure that constructors and destructors are matched for these complex data
types.

CleanupValue is also used to clean up a value without destructing it, so cannot
be modified in-place.

Depends On D2689

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1480624

Differential Revision: https://phabricator.services.mozilla.com/D2690
2018-08-03 15:55:13 -04:00
Nika Layzell f1902ff595 Bug 1480624 - Part 1: Add XPT_FOR_EACH_*_TYPE macros to xptinfo.h, r=mccr8
Summary:
This macro simplifies code which allows performing an operation on or
extracting information from a particular nsXPTType's native representation.

It is also used in part 2 to implement xpc::DestructValue.

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1480624

Differential Revision: https://phabricator.services.mozilla.com/D2689
2018-08-03 15:55:13 -04:00
Coroiu Cristina 1ba19a32ac Backed out changeset 86471a18672f (bug 1348273) for ESlint failure at toolkit/modules/WebNavigationChild.jsm
--HG--
extra : rebase_source : e0c94f49ddc1f1b119b72c06fccc1b4363b9d340
2018-08-03 22:48:51 +03:00
Gabriele Svelto eff24befbd Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant functions are updated to take a typed enum (in C++) and an
integer constant (in JavaScript). A JavaScript wrapper around the crash
reporter service is provided to hold the constants. The existing whitelists
and blacklists of annotations are also generated from the YAML file and the
existing duplicate code has been consolidated. Once written out to the .extra
file the annotations are converted in string form and are no different than
the existing ones.

All existing annotations have been included (and some obsolete ones removed)
and all call sites have been updated including tests.

--HG--
extra : rebase_source : f0e8d229581ac5c0daa0e0454cb258746108e28d
2018-07-05 15:42:11 +02:00
André Bargull f1e256e606 Bug 813836: Optimize comparisons of single-element strings. r=jandem 2018-08-10 08:56:47 -07:00