Commit graph

2057 commits

Author SHA1 Message Date
Nicholas Nethercote
a062b9be51 Bug 1366650 (part 2) - In GeckoProfiler, do all pseudo-stack accesses via the PseudoStack class, instead of via raw array manipulation. r=mstange,shu.
- The profiler gives the JS engine a reference to the pseudo-stack via
  SetContextProfiilngStack(). That function now takes a |PseudoStack*| instead
  of a |ProfileEntry*| and pointer to the stack pointer.

- PseudoStack now has a |kMaxEntries| field, which is easier to work with than
  |mozilla::ArrayLength(entries)|.

- AddressOfStackPointer() is no longer needed.

- The patch also neatens up the push operations significantly. PseudoStack now
  has pushCppFrame() and pushJsFrame(), which nicely encapsulate the two main
  cases. These delegate to the updated initCppFrame() and initJsFrame()
  functions in ProfileEntry.

- Renames max_stck in testProfileStrings.cpp as peakStackPointer, which is a
  clearer name.

- Removes a couple of checks from testProfileStrings.cpp. These checks made
  sense when the pseudo-stack was accessed via raw manipulation, but are not
  applicable now because we can't artificially limit the maximum stack size so
  easily.
2017-05-26 09:51:31 +10:00
Nicolas B. Pierron
9812c67569 Bug 1366773 - Move buffer argument from JS::StartIncrementalEncoding to JS::FinishIncrementalEncoding. r=mrbkap,shu 2017-05-24 18:28:19 +00:00
Till Schneidereit
24952f5a01 Bug 1364348 - Throw instead of failing an assert if drainJobQueue is called after quit. r=jandem
MozReview-Commit-ID: 6UexrG1GNJr
2017-05-23 09:37:15 +02:00
Steve Fink
1514d9b219 Bug 1364287 - Move g{Out,Err}FilePtr into ShellContext for thread safety, r=jonco
MozReview-Commit-ID: KNAAL7pRAMG

--HG--
extra : rebase_source : b1febb564d18601769a19c6c73b16cacdeff4fc3
2017-05-12 17:20:48 -07:00
Shu-yu Guo
0df0e66a59 Bug 1364648 - Fix OOB column handling for default class constructors' toString offsets. (r=jimb)
CompileOptions's column field has been conflating two meanings: the starting
column of the ScriptSource, and the starting column of the current thing
being compiled.

In the shell's evaluate() function, when the "column" option is passed,
it's fine to conflate the two meanings above.

When delazifying functions, it is incorrect to conflate the two
meanings. This is observable when generating SRC_CLASS_SPAN, which is a
srcnote used to save the toString offsets for a default class
constructor. (Since default class constructors aren't syntactically
present, there's no JSFunction made ahead of time. And since class
constructors must be toString'd as the class source instead of the
function source, we save the offsets in a srcnote to use when we
actually create the constructor at runtime.) When we save these offsets,
these are offsets into the ScriptSource buffer, and must be de-offset.
But it's incorrect to subtract the starting column of the lazy function,
which is itself offset from the starting column of the underlying
ScriptSource.
2017-05-18 18:17:23 -07:00
Till Schneidereit
be699bc7bf Bug 1357958 - Move the JS shell's Promise job handling into the engine to be used as a default implementation. r=jandem
The shell has a very basic implementation of Promise job queue handling. This patch moves it into the engine, exposed through friendapi functions. The motivation is that I want to write JSAPI tests for streams, which requires Promise handling. The test harness would need essentially a copy of the shell's Promise handling, which isn't nice.

To be clear, the default implementation isn't used automatically: the embedding has to explicitly request it using js::UseInternalJobQueues.

MozReview-Commit-ID: 6bZ5VG5mJKV
2017-05-11 14:43:22 +02:00
Carsten "Tomcat" Book
df3e065b52 Backed out changeset 03caaa7757d4 (bug 1357958) for bustage in js/src/jit-test/tests/wasm/bench/wasm_box2d.js 2017-05-09 15:51:54 +02:00
Till Schneidereit
1b30c06e4e Bug 1357958 - Move the JS shell's Promise job handling into the engine to be used as a default implementation. r=jandem
The shell has a very basic implementation of Promise job queue handling. This patch moves it into the engine, exposed through friendapi functions. The motivation is that I want to write JSAPI tests for streams, which requires Promise handling. The test harness would need essentially a copy of the shell's Promise handling, which isn't nice.

To be clear, the default implementation isn't used automatically: the embedding has to explicitly request it using js::UseInternalJobQueues.

MozReview-Commit-ID: DwtPsJ0uMtP
2017-05-09 15:04:24 +02:00
Tom Tromey
3e96a70858 Bug 1334278 - have FormatStackDump return UniqueChars; r=froydnj
Change FormatStackDump to return UniqueChars and fix up the users.  This
removes a bit more manual memory management.

MozReview-Commit-ID: 60GBgeS4rzg

--HG--
extra : rebase_source : 15060321f567816ca434cdf1ef816d8322ceefff
2017-04-21 12:47:06 -06:00
Tom Tromey
bcbdcb14bb Bug 1334278 - change JS_smprintf to return UniqueChars; r=froydnj
This changes JS_smprintf to return UniqueChars, rather than relying on
manual memory management.

MozReview-Commit-ID: ENjQJODYdD1

--HG--
extra : rebase_source : 4c8ad4719dce205a7ef25e41eca25c5af793bb47
2017-03-03 15:10:11 -07:00
Tom Tromey
66313f92eb Bug 1349655 - remove sig_safe_t in favor of mozilla::Atomic<uint32_t>; r=djvj,njn
Remove the definition of sig_safe_t, which is only used by PseudoStack,
and replace the uses with mozilla::Atomic<uint32_t>.

MozReview-Commit-ID: GcPd9R94Vci

--HG--
extra : rebase_source : dcc05a219d59ffdc0486ef2e7118d888c6a93fda
2017-03-22 13:57:31 -06:00
Jeff Walden
1c611f08cc Bug 1351107 - Add a |typename CharT| template parameter to Parser, SyntaxParseHandler, and FullParseHandler, *without* otherwise changing functionality. r=arai 2017-04-04 11:27:23 -07:00
Chris Peterson
eea325c79d Bug 1356843 - Fix -Wcomma warnings in js/. r=jorendorff
clang's -Wcomma warning warns about suspicious use of the comma operator such as between two statements or to call a function for side effects within an expression.

js/src/builtin/MapObject.cpp:786:48 [-Wcomma] possible misuse of comma operator here
js/src/builtin/MapObject.cpp:1371:48 [-Wcomma] possible misuse of comma operator here
js/src/builtin/RegExp.cpp:1266:62 [-Wcomma] possible misuse of comma operator here
js/src/jit/x64/BaseAssembler-x64.h:624:99 [-Wcomma] possible misuse of comma operator here
js/src/jsarray.cpp:2416:27 [-Wcomma] possible misuse of comma operator here
js/src/jscompartment.cpp:120:48 [-Wcomma] possible misuse of comma operator here
js/src/jsstr.cpp:3346:14 [-Wcomma] possible misuse of comma operator here
js/xpconnect/src/XPCWrappedNativeJSOps.cpp:316:71 [-Wcomma] possible misuse of comma operator here

MozReview-Commit-ID: BbT4otUXczV

--HG--
extra : rebase_source : b232d10b5280c567f8fe390fcb56012b78da580a
2017-04-09 21:15:01 -07:00
Luke Wagner
193112a244 Bug 1357053 - Baldr: include initial offset in thunk address (r=bbouvier)
MozReview-Commit-ID: LljBXmR7UXj

--HG--
extra : rebase_source : f0034bd782ec02fce00489dd3e2bee5e205a2ba4
2017-04-19 08:55:40 -05:00
Shu-yu Guo
159df826fb Bug 1216630 - Print class source when calling toString on the constructor. (r=Yoric)
This is accomplished in the following ways.

LazyScripts and JSScripts now have 4 offsets:

 - Source begin and end for the actual source. This is used for lazy
   parsing.

 - toString begin and end for toString. Some kinds of functions, like
   async, only have a different begin offset. Class constructors have
   different offsets for both begin and end.

For syntactically present (i.e. non-default) constructors, the class
source span is remembered directly on the LazyScript or JSScript. The
toString implementation then splices out the substring directly.

For default constructors, a new SRC_CLASS SrcNote type is added. It's
binary and has as its arguments the begin and end offsets of the class
expression or statement. MakeDefaultConstructor reads the note and
overrides the cloned self-hosted function's source object. This is
probably the least intrusive way to accomplish this.
2017-04-17 19:51:34 -07:00
Luke Wagner
c39bb259da Bug 1356631 - Change LargeAllocationCallback to be process-wide (r=mccr8)
This is necessary to allow helper threads to attempt large allocations and recover from fragmentation situations with the LargeAllocationFailureCallback.

MozReview-Commit-ID: AyA3pbXcaYy

--HG--
extra : rebase_source : 7a5feb779b690ec7f123481e76f2390c850dac91
2017-04-17 21:19:54 -05:00
André Bargull
4bd07de113 Bug 1345868 - Don't assert when calling getModuleLoadPath in workers. r=jonco
--HG--
extra : rebase_source : ac29f323d2f83ca3319f5225068693bb57cdc575
extra : histedit_source : d31b170b9d2f0356d52a953cb470ef0816fdf524
2017-04-10 13:29:50 +02:00
Lars T Hansen
d4b0fe7948 Bug 1352681 - Overflow checking on SAB reference count. r=sfink
--HG--
extra : rebase_source : 86549600fd1fc755c490546052e1bbd40326331d
2017-04-05 14:07:10 +02:00
Steve Fink
b04182d5a8 Bug 1337209 - Add JS shell test mechanism for gray marking, r=jonco
MozReview-Commit-ID: IhnUy6KKs7O

--HG--
extra : rebase_source : 7370d369d7d33c2c08ec2044521275a134b0208a
2017-03-15 17:03:42 -07:00
Tooru Fujisawa
f1ddcc75d7 Bug 1331092 - Part 2: Implement Async Generator except yield*. r=shu 2017-03-27 23:20:17 +09:00
Benjamin Bouvier
fbe4b31ce5 Bug 1350280: Add a --wasm-test-mode option to the JS shell; r=luke
MozReview-Commit-ID: C6HRf7oDchs

--HG--
extra : rebase_source : 81429f745d54733ff80981ddf621f6ebb3078186
2017-03-23 10:38:28 +01:00
Luke Wagner
2164377bd8 Bug 1334504 - Baldr: maintain fp register instead a virtual fp (r=bbouvier)
MozReview-Commit-ID: 2Mi60u3DyJg

--HG--
extra : rebase_source : 155ce830bcd55e7f9fdf890d4da4b1c12377f12b
2017-03-22 17:26:05 -05:00
Shu-yu Guo
95911a37b3 Bug 1346862 - Fix IteratorClose due to non-local jumps being catchable by try statements inside for-of. (r=arai) 2017-03-21 22:10:02 -07:00
Jan Varga
e161ee742d Bug 1311057 - Part 1: Remove support for packaged apps from asmjscache; r=luke 2017-03-06 18:38:40 +01:00
Carsten "Tomcat" Book
d0bd960945 merge mozilla-inbound to mozilla-central a=merge 2017-03-06 10:53:27 +01:00
Christian Holler (:decoder)
b25bd63bb7 Bug 1341901 - Make timesAccessed property JS shell only. r=jandem
MozReview-Commit-ID: Iq8vqsFCPwj

--HG--
extra : rebase_source : 1b347f0c63f37b056ae1c0a884eb66a4594d66bd
2017-03-03 18:11:07 +01:00
Brian Hackett
8ad28d4fd4 Bug 1341317 - Require runtimes to be single threaded while the Gecko profiler is in use, r=shu.
--HG--
extra : rebase_source : 4dd365b76b2b91b73764bcd28e25cbb5bd324f00
2017-03-02 05:11:28 -07:00
Wes Kocher
9746f81e53 Merge m-c to autoland, a=merge
MozReview-Commit-ID: FzykkWPQCrq

--HG--
rename : browser/modules/test/browser_UsageTelemetry_content.js => browser/modules/test/browser/browser_UsageTelemetry_content.js
rename : browser/modules/test/browser_UsageTelemetry_content_aboutHome.js => browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js
rename : browser/modules/test/browser_UsageTelemetry_searchbar.js => browser/modules/test/browser/browser_UsageTelemetry_searchbar.js
rename : browser/modules/test/browser_UsageTelemetry_urlbar.js => browser/modules/test/browser/browser_UsageTelemetry_urlbar.js
2017-03-01 17:48:44 -08:00
André Bargull
23a673a28d Bug 1340146 - Part 1: Normalize paths for module registry in shell module loader. r=jonco 2017-02-28 03:31:25 -08:00
Brian Hackett
deb1eaae99 Bug 1341321 - Require runtimes to be single threaded when using a Debugger, r=jandem.
--HG--
extra : rebase_source : 42f88769ddd36082339664cad86acd1f6dff5d67
2017-03-01 07:15:50 -07:00
Zibi Braniecki
b6bc066991 Bug 1329904 - Introduce mozIntl.DateTimeFormat. r=Waldo
MozReview-Commit-ID: LKUcrg0bht4

--HG--
extra : rebase_source : abe40dec1d13d3f7d372453ae6bf1a69c1252233
2017-02-14 16:05:47 -08:00
Tom Tromey
550affaf12 Bug 1343292 - change return types in GenericPrinter; r=nbp
MozReview-Commit-ID: 1GJYujhrWj7

--HG--
extra : rebase_source : 90aef429db4285707f23105f950d9d930f98c21b
2017-02-28 14:18:40 -07:00
Tooru Fujisawa
f427819398 Bug 1344479 - Use binary mode for reading source code in JS shell. r=jandem 2017-03-05 01:15:26 +09:00
Tooru Fujisawa
8c428ebcee Bug 1342553 - Part 0.1: Use try-catch for IteratorClose in for-of. r=shu 2017-02-26 14:02:36 +09:00
Luke Wagner
fc5f17cd6c Bug 1341749 - Drain job queue even after error (r=bbouvier)
MozReview-Commit-ID: D7rjnADZ5if

--HG--
extra : rebase_source : 09b662af12898c40fcefc3f294abfa4fd577d97c
2017-02-24 09:30:38 -06:00
Jon Coppeard
161b940553 Bug 1340110 - Make shell resolve root module relative to current directory as happens for non-module scripts r=anba 2017-02-23 16:26:14 +00:00
Tom Schuster
fb8e7cea05 Bug 1319087 - Add nukeCCW to the shell and test it. r=jandem 2017-02-23 15:26:49 +01:00
Carsten "Tomcat" Book
a7cadef96e Merge mozilla-central to mozilla-inbound 2017-02-22 14:40:19 +01:00
Carsten "Tomcat" Book
9d982b9508 merge mozilla-inbound to mozilla-central a=merge 2017-02-22 14:33:38 +01:00
Brian Hackett
5b7a11457c Bug 1341303 - Delete things in the right order when finishing shell worker threads, r=jandem. 2017-02-22 05:25:48 -07:00
Brian Hackett
33310aacec Bug 1341283 - Avoid conflicts between GC zeal behavior and cooperative multithreading context switches, r=jonco. 2017-02-22 05:22:47 -07:00
Brian Hackett
f5cdd08aab Bug 1341358 - Don't accidentally clear the incumbent global callback when finishing a cooperative thread, r=jandem. 2017-02-22 05:16:50 -07:00
Zibi Braniecki
27ba812587 Bug 1312053 - Expose an API to get locale information. r=Waldo
MozReview-Commit-ID: LivVJzrb3X1

--HG--
extra : rebase_source : a8c566cf918f01216e9f22e953da935ce41b7654
2017-02-17 20:06:43 -08:00
Emanuel Hoogeveen
03e78aca95 Bug 1338574 - Part 4: Use MOZ_CRASH_UNSAFE_OOL and MOZ_CRASH_UNSAFE_PRINTF in SpiderMonkey. r=jandem
--HG--
extra : rebase_source : 5fdcd747aa47a4b9ccbfea946089c8d1c36ea56f
2017-02-21 18:01:52 +01:00
Brian Hackett
55ab200a7c Bug 1337968 - Add API and shell harness for cooperative multithreading, r=jandem.
--HG--
extra : rebase_source : 077c7f0d3ba4cb5e45303715809be95690294816
2017-02-17 05:13:11 -07:00
Tooru Fujisawa
f4e61b592f Bug 1283712 - Part 10: Support notes in getLastWarning shell-only testing function. r=jwalden 2017-02-15 23:53:07 +09:00
Jeff Walden
096aac1e32 Bug 1287006 - Adjust js/ code to not pass Maybe (or any class containing a Maybe member) by value, only by reference or pointer. r=luke
--HG--
extra : rebase_source : b26cb2a94fdc218ea7f40931060eecfc50353d48
2017-02-13 09:07:26 -08:00
Brian Hackett
01a649c197 Bug 1337112 - Remove links from JSRuntime to its single context and zone group, r=jandem,jonco.
--HG--
extra : rebase_source : ebf319af724d5f829cdf5c2386dc82d49be89989
2017-02-10 16:47:50 -07:00
Brian Hackett
18bc843966 Bug 1337084 - Tolerate multiple threads running JS in JIT simulators, r=jandem.
--HG--
extra : rebase_source : 63625feccd12838cda50fc3650de12c7b147275a
2017-02-09 13:50:22 -07:00
Brian Hackett
ed08d325f6 Bug 1336603 - Move PCCounts state from ZoneGroup back to the runtime, r=jandem.
--HG--
extra : rebase_source : e9a5901541990061e261f2d185f2b45ea4722775
2017-02-03 15:13:29 -07:00