Commit Graph

65533 Commits

Author SHA1 Message Date
Jeff Walden
7ed2b26ceb Bug 1472031 - Introduce a drainCharBufferIntoAtom function to clear charBuffer and create an atom from the chars that were in it. r=arai
--HG--
extra : rebase_source : bd8f3114f8704b7a266ccf21d4c110fe28ab77f1
2018-06-28 15:31:13 -07:00
Jeff Walden
da3129de0b Bug 1467336 - Change a bunch of 'character' nomenclature in token stream code to 'code unit', completing the transition from tokenizing by UTF-16 'character' to tokenizinng by UTF-8/16 code unit. (There are straggling places where algorithms will need to be specialized for UTF-8, or functions will need to move within the TokenStream* hierarchy to permit such; but what is in the tree now universally acts on code units first, full code points second.) r=arai
--HG--
extra : rebase_source : 06fa722d16b801f9db7f38110756d8a8f62b6617
2018-06-28 02:30:08 -07:00
Jeff Walden
8d4d43a2d1 Bug 1467336 - Remove GeneralTokenStreamChars::{,un}getChar now that they're unused. r=arai
--HG--
extra : rebase_source : 908ffc7370dafe00bb6266ec5817b40bb353d93f
2018-06-28 02:27:50 -07:00
Jeff Walden
3da23e1993 Bug 1471465 - Fix some issues with ungetting LineTerminatorSequence in certain places. r=arai
--HG--
extra : rebase_source : 82a7a98fc500d26be67363c45f91662887b12091
2018-06-27 13:26:14 -07:00
Jeff Walden
69afaf684f Bug 1471464 - Make getNonAsciiCodePoint, getFullAsciiCodePoint, and isAsciiCodePoint all take |int32_t| and not |CharT|, because they're all passed |int32_t| from |getCodeUnit()| or a code point-getting mechanism. r=arai
--HG--
extra : rebase_source : 2582f93ab5c048bb0df42563331a450423529e3c
2018-06-27 13:26:13 -07:00
Jeff Walden
9d4fe70e96 Bug 1471463 - Move TokenStreamCharsBase::tokenbuf and related functions into a new TokenStreamCharsShared base class, make the character type always char16_t, and rename it/them to 'charBuffer' for clarity. r=arai
--HG--
extra : rebase_source : ac4e81db943a1f69a8caa0722d4239b4fb5dc1c1
2018-06-27 13:25:57 -07:00
Jeff Walden
8fc3ac9afc Remove a |false &&| inadvertently left in a patch as part of testing a fallback code path. Followup to bug 1457560, r=me, thanks to IRC for pointing it out recently
--HG--
extra : rebase_source : e1561f2e42d23d7c0ee38599b16661f85f3fa7c4
2018-06-29 18:01:07 -07:00
Jeff Walden
83a1c5a302 Fully privatize the contents of the JS::Value union now that it cannot be POD because it has a non-trivial default constructor. No bug, r=me as trivial
--HG--
extra : rebase_source : 222290ba211e2fbe1693498a42d43a2064af45b8
2018-06-26 16:18:55 -07:00
André Bargull
e09a53c18a Bug 1471788: Apply ToNumber conversion even when the typed array write is out-of-bounds. r=evilpie
--HG--
extra : rebase_source : 9c1cc0307b8c1800f99e0884975ecd935b0e5a5d
2018-06-29 13:46:04 -07:00
André Bargull
4db79fda8c Bug 1471931 - Part 5: Use MakeUnique in more places and replace manual js_delete with UniquePtr. r=sfink
--HG--
extra : rebase_source : cb6018da067352c1c1a04c3ff0385fa0cf70e020
2018-06-29 02:33:51 -07:00
André Bargull
8695012030 Bug 1471931 - Part 4: Add NewString and NewStringDontDeflate functions which accept UniquePtr. r=sfink
--HG--
extra : rebase_source : 19abdbf337c92c6d01440330fd582852b2821753
2018-06-28 09:30:46 -07:00
André Bargull
996da1bf7f Bug 1471931 - Part 3: Switch to pod_calloc_with_extra, new_, make_pod_array, and make_zeroed_pod_array where possible. r=sfink
--HG--
extra : rebase_source : 221362e7e3932ecb3f5bcf748035d5671e15e63b
2018-06-28 09:26:02 -07:00
André Bargull
3a0781eb94 Bug 1471931 - Part 2: Replace manual memory management with UniquePtr in a few places. r=sfink
--HG--
extra : rebase_source : dbdd66450524fd4b10704a557df0fe5b7c45a040
2018-06-28 09:17:05 -07:00
André Bargull
1a557942d7 Bug 1471931 - Part 1: Replace some js_malloc/js_calloc/js_realloc with their js_pod_malloc/js_pod_calloc/js_pod_realloc counterparts. r=sfink
--HG--
extra : rebase_source : bb479e5f058fe51f62fc5584ec41b33eeffc77f5
2018-06-28 09:07:44 -07:00
David Major
67c0e7ceb2 Bug 1471310: Disable the emptiness assertion in ProtectedRegionTree. r=nbp
This is causing random failures with clang-cl and per the bug discussion we have better mechanisms to catch leaks.
2018-06-29 13:28:09 -04:00
David Major
56b39c6150 Bug 1471310 - Clear the Installed flag when removing the MemoryProtectionExceptionHandler. r=luke 2018-06-29 13:27:57 -04:00
Bogdan Tara
fa8c0e96eb Backed out 4 changesets (bug 1461616, bug 1450261) for wasm related spidermonkey build bustages CLOSED TREE
Backed out changeset aa826be7a24a (bug 1461616)
Backed out changeset b05573ae795a (bug 1450261)
Backed out changeset ddbbcea98cde (bug 1450261)
Backed out changeset 1478fb0f82de (bug 1450261)
2018-06-29 17:28:58 +03:00
Benjamin Bouvier
069e11d14f Bug 1461616: Fix wasm/gc/debugger test so it actually tests something; r=luke
--HG--
extra : rebase_source : edca5efaecd89d0dd4988af0014d34ed47b20308
extra : amend_source : 312f6598d76968d89845bc699cfe7612a62d76b6
2018-06-28 10:13:57 +02:00
Benjamin Bouvier
67ce062fa4 Bug 1450261: Implement Val, a rooted LitVal; r=luke, r=jonco
--HG--
extra : rebase_source : b17dea4782630bda5d9fd7df631016ac4e674750
extra : histedit_source : 65bfbcd5f3b79a50c9ecad66bb035159299195dc
2018-05-24 20:28:37 +02:00
Benjamin Bouvier
0a954cc00a Bug 1450261: Rename Val to LitVal; r=lth
--HG--
extra : rebase_source : 1ed28d91c20ef214b0a0a398624ccf403e7ddfd1
extra : histedit_source : 25d304b8a51618de6e68dad33a50cabf89cebeb6
2018-06-21 14:25:28 +02:00
Benjamin Bouvier
6ed3b0256b Bug 1450261: Implement support of anyref in wasm globals; r=lth
--HG--
extra : rebase_source : 80d1fbc99e2e8aac0b8e6e96e1499347e0ac997e
extra : histedit_source : 5cce99d0778b293dd468aedebf092f1b15e8545b
2018-03-27 15:40:13 +02:00
Julian Seward
65b38c07e5 Bug 1467415 - Importable mutable globals break alias analysis. r=lth.
Currently, do-these-references-alias queries for Wasm global variable
accesses are handled incorrecty.  We fail to identify the case where both
references are indirect (that is, imported) as possibly-aliasing.  This can
lead to incorrect code generation in some pretty simple cases involving
globals, when compiling Wasm via IonMonkey.

This commit fixes that.  It also adds clarifying comments to
MWasmLoadGlobalVar::congruentTo and MWasmLoadGlobalVar::valueHash pertaining
to equivalance-of-loaded-values assessments.

--HG--
extra : rebase_source : 3f77fa1fd0085ab1922b8eaf7cb2d9891bc6e390
2018-06-29 11:49:35 +02:00
Lars T Hansen
1236b3ccb8 Bug 1459900 - Automatic upcasts through prefix supertyping. r=luke
This augments the Ref type patch by making the subtype test perform automatic
upcasts to prefixes.  The prefixes are still quite strict; corresponding Ref
types must name the same underlying type and corresponding fields must have the
same mutability.

--HG--
extra : rebase_source : 43cc552e77f9e3f5d7f7b2fa761d956c9c61f149
extra : intermediate-source : bb1d37aa16dd0dbdf21c80e34156026693b898cf
extra : source : 2c8c0301cc33ca0af490629a999f2d2dd854d72f
2018-06-13 09:51:46 -07:00
Lars T Hansen
d7268b5139 Bug 1459900 - Track structure field mutability. r=luke
The StructType and AstStructType machinery must retain the information about
field mutability (to be used by subsequent patches).

For StructType, I opted to create a StructField structure that holds the
information per field.  This works well except when we (occasionally, not in
this patch) need an array of ValTypes for some existing functionality.

For AstStructType, I opted to keep the array of mutability flags separate from
the arrays of names and field types, because this was simplest.

In either case, we could do it the other way.

--HG--
extra : rebase_source : a99a2ff5619441f4d0d428fdf1890adef892d5aa
extra : source : 78d954331af90f6f81bd86595beef2c15952510f
2018-06-27 13:40:56 +02:00
Lars T Hansen
195b5172c0 Bug 1459900 - Ref types with a simple type calculus. r=luke
We generalize ExprType and StackType in the same way as ValType, in
order to reduce the scope for error.  (Intermediate solutions that
avoided this turned out to be too error-prone.)  ExprType, StackType,
and ValType now share a representation of a TypeCode + reference type
index, called PackedTypeCode, but don't otherwise share much code -
ExprType is going away soon and StackType will change.

We then generalize many of the Ast nodes so that we can represent the
new types available in the binary and textual formats.  This is
wrenching in the same way that generalizing ValType and ExprType was.

Finally we provide parsing, resolution, printing, and validation of
(ref T) where T is some structure type.  This code should be general
enough to later expand it to array types.

The type calculus here is that (ref n) == (ref m) if n == m, ie, these
are nominally equivalent; the only new subtype relationships are that
(ref n) <: (ref n) and (ref n) <: anyref.  If the subtyping of anyref
were to go away there's a small amount of work that would have to be
done to handle the polymorphism of ref.is_null.

--HG--
extra : rebase_source : 7a1a01d1f5624baeb29383a9ae6a5bdf03411181
extra : intermediate-source : dc8f0270e0e3932ba661a57496401d00903c9ba2
extra : source : 3c5da122b7034dae69d16ca9e577afb93cf7b2c1
2018-05-28 18:59:29 +02:00
Lars T Hansen
1bfdd2e36e Bug 1471289 - Handle 'new WebAssembly.Global' on i64 with default value. r=jseward
As a tweak the wasm CG has decided to allow the special case where an i64 global is
created from JS with the default zero value, while we're waiting for BigInt and
more general i64 support.  This amounts to removing the error we would otherwise
signal in this case.

--HG--
extra : rebase_source : 264c1907e0787f067cc954c98726733227e79a78
2018-06-28 10:06:03 +02:00
André Bargull
781fc92292 Bug 1471900: Change return type of JS_EncodeStringToBuffer to bool. r=jandem 2018-06-28 07:35:20 -07:00
Jan de Mooij
b6456d44da Bug 1471924 part 3 - Add a proxy testcase. r=anba 2018-06-29 11:30:27 +02:00
Jan de Mooij
8bbee59a49 Bug 1471924 part 2 - Enter callee's realm when calling Class call/construct hooks. r=luke 2018-06-29 11:21:02 +02:00
Jan de Mooij
341cc8a5d5 Bug 1471924 part 1 - Stop pretending proxies have a JSNative call/construct hook. r=luke 2018-06-29 11:21:02 +02:00
Tooru Fujisawa
c02240a9e5 Bug 1412200 - Do not store the then property into thenable job if it is the original Promise.prototype.then. r=anba 2018-06-29 17:13:01 +09:00
Jan de Mooij
8ac43f77d0 Bug 1471844 - Implement cx->realm switching for optimized DOM calls in Ion. f=bz r=luke 2018-06-29 09:02:46 +02:00
André Bargull
60b6a5b521 Bug 612141: Remove DeflateStringToBuffer so a better interface isn't required anymore. r=jandem 2018-06-26 05:55:48 -07:00
Brindusan Cristian
9facfa9fb7 Backed out changeset f2f1f75b9134 (bug 1471289) for spidermonkey bustages on wasm-testharness.js:31:15. CLOSED TREE 2018-06-29 03:27:01 +03:00
André Bargull
42c56b0858 Bug 1471841: Move WouldDefinePastNonwritableLength into NativeObject.cpp. r=jandem
--HG--
extra : rebase_source : c659116e6b46a116f65af81f9ba9104a29c35536
2018-06-28 13:44:22 -07:00
Lars T Hansen
b13b7027ea Bug 1471289 - Handle 'new WebAssembly.Global' on i64 with default value. r=jseward
As a tweak the wasm CG has decided to allow the special case where an i64 global is
created from JS with the default zero value, while we're waiting for BigInt and
more general i64 support.  This amounts to removing the error we would otherwise
signal in this case.

--HG--
extra : rebase_source : 680e25f094ddf6339e2eacc7a7da2b197d5d1849
2018-06-28 10:06:03 +02:00
Lars T Hansen
b2d8132d07 Bug 1466464 - Part 1: Recognize memory.grow and memory.size syntax. r=jseward
This only recognizes the new syntax and adds a minimal amount of testing for that.
A subsequent patch will do a massive renaming in the wasm module to change
CurrentMemory to MemSize and GrowMemory to MemGrow, and change all test cases.
A final patch will remove support for the old syntax.
2018-06-28 10:44:54 +02:00
Ted Campbell
ab67c3fb81 Bug 1471272 - Add [SMDOC] tags for in-source documentation. r=jandem,nbp
MozReview-Commit-ID: I038aYgvwe4
2018-06-28 15:23:25 -04:00
Cosmin Sabou
a612a6fdf5 Merge mozilla-central to mozilla-inbound. a=merge 2018-06-28 13:13:46 +03:00
Jan de Mooij
62bb224959 Bug 1471169 - Implement realm switching for Wasm calls. r=luke 2018-06-28 12:08:59 +02:00
Cosmin Sabou
f4b3baf021 Merge mozilla-inbound to mozilla-central. a=merge 2018-06-28 13:04:23 +03:00
Benjamin Bouvier
e62f5044db Bug 1447591: Remove wasm::BinaryToText; r=luke
--HG--
extra : rebase_source : dcf0bc7ca5a4f70d1c6d5de6c3aff2f6e0d72faa
2018-06-21 11:49:47 +02:00
Benjamin Bouvier
1c9f5a8af9 Bug 1447591: Stub out a few Debugger APIs for wasm; r=yury
--HG--
extra : rebase_source : b8c8b2afeac3a3bdefa8f412354579f601a3af86
2018-06-20 17:56:19 +02:00
Tiberius Oros
945c24abe5 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-06-28 01:12:18 +03:00
Nicolas B. Pierron
befc08424b Bug 1471589 - Ensure that ranges do not overlap in diagnostic builds. r=tcampbell 2018-06-27 13:41:10 +00:00
Nicolas B. Pierron
ef998f1b54 Bug 1471234 - Assert LifoAlloc::steal does not trash BumpChunks. r=tcampbell 2018-06-27 13:24:05 +00:00
Matthew Gaudet
a2d5894efe Bug 1471361: Keep stack height constant when fastpathing truncation r=tcampbell
--HG--
extra : rebase_source : b2f2238e73a1c24ce3b926dd76d147feef5a0ddf
2018-06-26 18:09:34 -04:00
Alex Gaynor
eac6fdd4b0 Bug 1470890 - handle deserialization failure gracefully in JS IPC; r=evilpie
Summary: This primarily affects the efficiency of fuzzing.

Reviewers: evilpie

Reviewed By: evilpie

Bug #: 1470890

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

--HG--
extra : rebase_source : 43f92c8989262259bb9ec604d2be60b1195ee802
extra : amend_source : 5899b2672fb8602b0b1fb806cb3807677493daa7
2018-06-27 16:10:41 +03:00
Nicolas B. Pierron
3b7262f482 Bug 1470732 - Add test case. r=tcampbell 2018-06-27 12:53:28 +00:00
Nicolas B. Pierron
683ad5a8de Bug 1470732 - Reprotect memory of pending Ion compilations in case of moving GCs. r=jonco 2018-06-27 12:53:01 +00:00