Yes=0, No=1

2018-07-12 Thread Jason Orendorff
The codebase has a few bool-like enum classes like this: enum class HolodeckSafetyProtocolsEnabled { Yes, No }; Note that `bool(HolodeckSafetyProtocolsEnabled::Yes)` is false. ...This is bad, right? Asking for a friend. -j ___ dev-plat

Re: Coding style for C++ enums

2016-04-12 Thread Jason Orendorff
On Mon, Apr 11, 2016 at 7:58 PM, Jeff Gilbert wrote: > On Mon, Apr 11, 2016 at 4:00 PM, Bobby Holley > wrote: > > On Mon, Apr 11, 2016 at 2:12 PM, Jeff Gilbert > wrote: > >> I think the whole attempt is > >> increasingly a distraction vs the alternative, and I say this as > >> someone who write

Re: Out parameters, References vs. Pointers (was: Proposal: use nsresult& outparams in constructors to represent failure)

2016-04-21 Thread Jason Orendorff
More evidence that our coding conventions need an owner... -j On Wed, Apr 20, 2016 at 10:07 PM, Kan-Ru Chen (陳侃如) wrote: > Nicholas Nethercote writes: > > > Hi, > > > > C++ constructors can't be made fallible without using exceptions. As a > result, > > for many classes we have a constructor

Re: Static analysis for "use-after-move"?

2016-05-02 Thread Jason Orendorff
On Sun, May 1, 2016 at 7:39 PM, Gerald Squelart wrote: > Thinking of it, I suppose lots (all?) of these optimized content-stealing > actions could be done through differently-named methods (e.g. 'Take()'), so > they could not possibly be confused with C++ move semantics. > Yes. I think that will

Re: ICU proposing to drop support for WinXP (and OS X 10.6)

2016-05-03 Thread Jason Orendorff
It's not just strange. It's against Ecma's explicit organization-wide policy. -j On Tue, May 3, 2016 at 1:13 AM, Anne van Kesteren wrote: > On Tue, May 3, 2016 at 2:17 AM, Jeff Walden wrote: > > Using a library to do certain things we do other ways right now, in > sometimes inferior fashion, d

How should I measure responsiveness?

2016-05-17 Thread Jason Orendorff
Hi everyone. I'm trying to figure out how to measure the effects of a possible change Morgan Phillips is making to the Slow Script dialog.[1] One specific thing we want to measure is "responsiveness" in the few seconds after a user chooses to stop a slow script. Whatever "responsiveness" means. W

Re: How should I measure responsiveness?

2016-05-18 Thread Jason Orendorff
On Tue, May 17, 2016 at 4:13 PM, Jason Orendorff wrote: > I'm trying to figure out how to measure the effects of a possible change > Morgan Phillips is making to the Slow Script dialog.[1] One specific thing > we want to measure is "responsiveness" in the few seconds a

Re: Introducing mozilla::Result for better error handling

2016-12-21 Thread Jason Orendorff
On Tue, Dec 20, 2016 at 10:31 AM, Ehsan Akhgari wrote: > > Result Baz() { MOZ_TRY(Bar()); ... } > > I have one question: what is Bar() expected to return here? Result where F is implicitly convertible to E. An E type, > or a type that's implicitly convertible to E > (

Re: Extensibility of JavaScript modules

2013-10-08 Thread Jason Orendorff
On Tue, Oct 8, 2013 at 8:24 AM, Till Schneidereit wrote: > Interesting. I wonder if the monkey patching will even still work once we > have es6 modules and use them in the platform. > > Jason and Eddy, you probably know, but I'm under the impression that monkey > patching an es6 module requires

Re: Extensibility of JavaScript modules

2013-10-09 Thread Jason Orendorff
On 10/8/13 4:27 PM, David Rajchenbach-Teller wrote: That sounds quite sufficient for me. Do we have plans to backport Cu.import to ES6 modules? No plans yet. Want to work on it with us? We're not ready to start just now, but parser support for ES6 modules is being added, and the self-hosted i

Re: Extensibility of JavaScript modules

2013-10-09 Thread Jason Orendorff
On 10/9/13 12:56 PM, David Rajchenbach-Teller wrote: I am interested, although my buglist is rather full. What kind of help would be useful? When it's time, we'll need to: 1. write Loader hooks to make the `import` keyword behave like Cu.import 2. somehow have those hooks installed by default

Re: What platform features can we kill?

2013-10-10 Thread Jason Orendorff
On 10/10/13 2:54 AM, Chris Peterson wrote: The meta bug for removing JSD is bug 800200. I believe the primary blocking issue is bug 716647 ("allow Debugger to be enabled with debuggee frames on the stack"), which jorendorff is starting to work on. Well, I tried it a year and a half ago. jandem

Re: Analyze C++/compiler usage and code stats easily

2013-11-15 Thread Jason Orendorff
On 11/14/13 11:43 PM, Gregory Szorc wrote: > * Why does lots of js/'s source code gravitate towards the "bad" > extreme for most of the metrics (code size, compiler time, > preprocessor size)? We use templates very heavily and we inline like mad. Templates make C++ compilers go slowly. The GC sma

Re: Is for...of on a live DOM node list supposed to do the right thing?

2013-11-22 Thread Jason Orendorff
On 11/22/13 8:40 AM, Benjamin Smedberg wrote: > Is for..of on live DOM nodelists supposed to correctly iterate even > when items are removed from the list? I have a testcase where this > does not seem to be working correctly: > > http://jsfiddle.net/f8xzQ/ > > Is there a simple way to do this corre

Re: Can we start using C++ STL containers in Mozilla code?

2013-12-10 Thread Jason Orendorff
On 12/10/13 9:09 AM, Boris Zbarsky wrote: > On 12/10/13 9:49 AM, Benoit Jacob wrote: >> since AFAIK we don't have a HashSet class in mfbt or xpcom. > > It's called nsBaseHashtable. Granted, using it as a hashset is not > that intuitive. There's also js::HashSet in js/public/HashTable.h. -j

Re: [JS-internals] Improvements to the Sphinx in-tree documentation generation

2013-12-19 Thread Jason Orendorff
Moving back to dev-platform. On 12/17/13 4:41 PM, Gregory Szorc wrote: > I guess what I'm trying to say is that SpiderMonkey/JavaScript appears > lacking in the "language services" arena. The concrete features you mentioned are extracting doc comments and minimization, so that's what I'll address

js-inbound as a separate tree

2013-12-19 Thread Jason Orendorff
On dev-tech-js-engine-internals, there's been some discussion about reviving a separate tree for JS engine development. The tradeoffs are like any other team-specific tree. Pro: - protect the rest of the project from closures and breakage due to JS patches - protect the JS team from closures and

Re: js-inbound as a separate tree

2013-12-19 Thread Jason Orendorff
On 12/19/13 4:55 PM, David Burns wrote: > On 19/12/2013 18:48, Jason Orendorff wrote: >> Con: >> - more work for sheriffs (mostly merges) > > If mostly merges, are you suggesting there will be little traffic on > the branch or the JS team will watch the tree for failures?

Re: A proposal to reduce the number of styles in Mozilla code

2014-01-06 Thread Jason Orendorff
On 1/6/14 3:27 PM, Brian Smith wrote: > On Sun, Jan 5, 2014 at 6:34 PM, Nicholas Nethercote > wrote: >> - There is an semi-official policy that the owner of a module can dictate its >> style. Examples: SpiderMonkey, Storage, MFBT. > AFAICT, there are not many rules that module owners are bound b

Re: Exact rooting is now enabled on desktop

2014-01-17 Thread Jason Orendorff
On 1/17/14 3:24 PM, Terrence Cole wrote: > Exact stack rooting is now enabled by default on desktop builds of firefox. *standing ovation forever* -j ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-pla

Re: Intent to ship DOM Promises

2014-01-30 Thread Jason Orendorff
On 1/30/14 9:06 AM, Boris Zbarsky wrote: > On 1/30/14 5:03 AM, Till Schneidereit wrote: >> What are the plans for moving Promises into SpiderMonkey? > > Moving Promises per se is not hard. > > The hard part is that this requires SpiderMonkey to grow a concept of > an even loop. The event loop itse

Re: Column numbers appended to URLs recently

2014-03-04 Thread Jason Orendorff
On 3/3/14, 12:54 PM, Jan Honza Odvarko wrote: > URLs in stack traces for exception objects have been recently changed. There > is a column number appended at the end (I am seeing this in Nightly, but it > could be also in Aurora). Code that parses error.stack now needs to handle the case where b

Re: Memory management in features implemented in JS

2014-03-21 Thread Jason Orendorff
On 3/21/14, 5:42 PM, Jim Blandy wrote: > On 03/21/2014 03:34 PM, Jim Blandy wrote: >> What if these DOM nodes could use a special class of observers / >> listeners that automatically set themselves aside when the node is >> deleted from the document, and re-instate themselves if the node is >> re-i

Re: Memory management in features implemented in JS

2014-03-21 Thread Jason Orendorff
On 3/21/14, 10:23 PM, K. Gadd wrote: > A hypothetical scenario (please ignore any minor detail errors, I'm > using this to illustrate the scenario): Let's say I have a main > document and it spawns 3 popup windows as documents. The popup windows > have references to the parent document and use them

Re: Memory management in features implemented in JS

2014-03-23 Thread Jason Orendorff
On 3/22/14, 7:26 AM, K. Gadd wrote: > The window and children example is intended to illustrate > that manual cycle-breaking is non-trivial; in this case it requires a > robust reference counting mechanism and code audits to ensure > reference increments/decrements are carefully matched and put in

Re: Memory management in features implemented in JS

2014-03-24 Thread Jason Orendorff
On 3/24/14, 2:42 AM, K. Gadd wrote: > It is, however, my understanding that cycle collections in > SpiderMonkey are separate from non-cycle-collections and occur less > often; is that still true? There are two collectors. The JS engine's garbage collector runs more frequently. It collects cycles

Re: MOZ_ASSUME_UNREACHABLE is being misused

2014-04-01 Thread Jason Orendorff
On 4/1/14, 9:57 AM, Benjamin Smedberg wrote: > On 4/1/2014 10:54 AM, Benoit Jacob wrote: >> Let's see if we can wrap up this conversation soon now. How about: >> >> MOZ_MAKE_COMPILER_BELIEVE_IS_UNREACHABLE > I counter-propose that we remove the macro entirely. I don't believe > that the potent

Re: MOZ_ASSUME_UNREACHABLE is being misused

2014-04-01 Thread Jason Orendorff
On 4/1/14, 10:05 AM, Benoit Jacob wrote: > This macro is especially heavily used in SpiderMonkey. Maybe > SpiderMonkey developers could weigh in on how large are the benefits > brought by UNREACHABLE there? I don't believe there are any benefits. Those uses of MOZ_ASSUME_UNREACHABLE are not intend

Re: MOZ_ASSUME_UNREACHABLE is being misused

2014-04-01 Thread Jason Orendorff
On 4/1/14, 4:37 PM, Karl Tomlinson wrote: > Jason and I spoke on irc and realised that we were talking about 2 > slightly different things. Yep. Filed bug 990764. If someone wants to take, we can continue discussion there. -j ___ dev-platform mailing li

Re: Argument validation as a JSM?

2014-05-19 Thread Jason Orendorff
On 05/15/2014 10:58 AM, ajvinc...@gmail.com wrote: Re: readability, that's something to think about, but when I write code like this: if ((typeof num != "number") || (Math.floor(num) != num) || isNaN(num) || (num < 0) || Math.abs(num) == Infinity) {

Are you interested in doing dynamic analysis of JS code?

2014-06-25 Thread Jason Orendorff
that's you, please speak up and tell us how you'd like to instrument JS code. -- Nicolas B. Pierron Jason Orendorff (JavaScript engine developers) ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: Are you interested in doing dynamic analysis of JS code?

2014-06-25 Thread Jason Orendorff
On 06/25/2014 01:04 PM, Fitzgerald, Nick wrote: Yes! We'd absolutely love to show code coverage in the debugger's source editor! We've played with implementations based on Debugger.prototype.onEnterFrame and hidden breakpoints, but it is pretty slow and feels like a huge hack. Would this work

Re: Are you interested in doing dynamic analysis of JS code?

2014-06-27 Thread Jason Orendorff
On 06/25/2014 05:40 PM, Robert O'Callahan wrote: On Thu, Jun 26, 2014 at 8:06 AM, Jason Orendorff mailto:jorendo...@mozilla.com>> wrote: An alternative involves letting you modify JS code just before it's compiled (source-to-source transformation). This is more ge

JS assertions that get optimized away! (was: Are you interested in doing dynamic analysis of JS code?)

2014-06-27 Thread Jason Orendorff
On 06/26/2014 06:59 AM, David Rajchenbach-Teller wrote: I would be interested in adding boundary checks and invariant checks that could be eliminated in opt builds. Is this in the scope of your project? No, I don't think so. S2S could certainly do it, but you wouldn't want to use S2S on all b

Exposing JIT performance faults in profiler/devtools (was: Are you interested in doing dynamic analysis of JS code?)

2014-06-27 Thread Jason Orendorff
On 06/25/2014 05:51 PM, Katelyn Gadd wrote: Maybe you could use mutation/method call tracing to do a profile-guided-optimization equivalent for JS where you record argument types and clone functions per-callsite to ensure everything is monomorphic? Yes, I think this is something that could be

Re: c++ unit test in content process

2014-10-06 Thread Jason Orendorff
On 10/03/2014 08:59 AM, Benjamin Smedberg wrote: On 10/3/2014 9:46 AM, Patrick Wang wrote: The test I am writing is to test an implementation of WebRTC's TCP socket in content process. These codes are build on top of TCPSocket's IPDL in C++ and don't have IDL so it cannot be called directly fro

Re: About the bitfield requirement for portibility

2014-11-06 Thread Jason Orendorff
I guess I was a little irked that people are still tripping over this ancient document (didn't we delete that?), because I just took the time to clobber most of it and update what was left. https://developer.mozilla.org/en-US/docs/Mozilla/Cpp_portability_guide -j _

Is anyone still using JS strict warnings?

2014-12-19 Thread Jason Orendorff
So if you go to about:config and set the javascript.options.strict pref, you'll get warnings about accessing undefined properties. js> Math.TAU undefined /!\ ReferenceError: reference to undefined property Math.TAU (It says "ReferenceError", but your code still runs normally; it reall

Re: Is anyone still using JS strict warnings?

2014-12-19 Thread Jason Orendorff
On Fri, Dec 19, 2014 at 5:13 PM, Jim Blandy wrote: > The bug is surprising, in that it claims that the bytecode that consumes > the value determines whether a warning is issued (SETLOCAL;CALL), rather > than the bytecode doing the fetch. > > Is that the intended behavior? I can't see how that mak

Re: Type-based alias analysis and Gecko C++

2019-02-15 Thread Jason Orendorff
On Fri, Feb 15, 2019 at 8:43 AM David Major wrote: > [...] If we can easily remove (or reduce) uses of this flag, I think > that would be pretty uncontroversial. > It sounds risky to me. My impression is we have a lot of TBAA violations, which would make every compiler version bump a game of UB

Re: Type-based alias analysis and Gecko C++

2019-02-19 Thread Jason Orendorff
I accidentally sent a question to Henri only. Re-adding the list. -j On Mon, Feb 18, 2019 at 1:24 AM Henri Sivonen wrote: > On Fri, Feb 15, 2019 at 6:27 PM Jason Orendorff > wrote: > > > > On Fri, Feb 15, 2019 at 3:00 AM Henri Sivonen > wrote: > >> > >>

Intent to ship: String.prototype.matchAll

2019-03-04 Thread Jason Orendorff
In Firefox 67 I plan to ship String.prototype.matchAll. It's behind a Nightly-only #ifdef right now (since December). Volunteer contributor André Bargull wrote our implementation of this feature. Tests too. Thank him if you see him. ## Standards Proposal (with examples and rationale): https://gi

Re: android-em-4-3-armv7-api16 possibly falsy timeout

2019-03-19 Thread Jason Orendorff
Here is another bug with the same pattern (recently added, unrelated to the others, no other failures on this test, timeout "literally" "impossible", log shows that the test is not timing out): https://bugzilla.mozilla.org/show_bug.cgi?id=1533500 It would be good to have a single bug to dup all o

Danger: `hg rebase` with format-source seems to be eating patches

2019-04-09 Thread Jason Orendorff
If you use `hg rebase` or `hg pick`, you should disable the format-source extension until this is resolved: (data loss) Suspected bad interaction between hg rebase and format-source https://bugzilla.mozilla.org/show_bug.cgi?id=1542871 You can disable this extension by commenting out a line in you

Re: Upcoming changes to our JS coding style

2019-06-13 Thread Jason Orendorff
On Thu, Jun 13, 2019 at 1:42 PM Victor Porof wrote: > To improve developer productivity, we plan to automate JS formatting using > Prettier , a broadly adopted tool specifically > designed for this task and maintained by well known stakeholders. This > should reduce the amou

Re: Upcoming changes to our JS coding style

2019-06-13 Thread Jason Orendorff
On Thu, Jun 13, 2019 at 3:32 PM Dave Townsend wrote: > Prettier will share eslint's list of things to ignore and those tests are > already ignored: > https://searchfox.org/mozilla-central/rev/1133b6716d9a8131c09754f3f29288484896b8b6/.eslintignore#239 > . > > Of course if you want parts of that di

Re: Upcoming C++ standards meeting in Cologne

2019-07-18 Thread Jason Orendorff
Botond, Presumably it's too late for the ongoing meeting, but I'm very concerned about C++20 assertions. The proposal says that in a release build, any contract violation is undefined behavior. Sounds reasonable enough. Every assertion adds potential UB. Hmm. ISTM this makes the feature very mu

Intent to ship: Promise.allSettled

2019-10-30 Thread Jason Orendorff
In Firefox 71, we'll ship Promise.allSettled, a standard way to `await` several promises at once. André Bargull [:anba] contributed the implementation of this feature. It's in Nightly now. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1539694 Shipped in: https://bugzilla.mozilla.org/show_bug.c

Re: Intent to ship: Promise.allSettled

2019-10-30 Thread Jason Orendorff
On Wed, Oct 30, 2019 at 5:20 PM Jan-Ivar Bruaroey wrote: > This always seemed trivial to me to do with: > > Promise.all(promises.map(p => p.catch(e => e))) > I guess it depends on your definition of "trivial". If everyone knows de Morgan's laws, we don't need *both* `||` and `&&` operators.

Re: Consider avoiding allSettled in tests (was: Re: Intent to ship: Promise.allSettled)

2019-10-31 Thread Jason Orendorff
On Thu, Oct 31, 2019 at 4:10 AM Paolo Amadini wrote: >// INCORRECT >//await Promise.allSettled([promise1, promise2]); > > The last example silently loses any rejection state. > Ignoring the awaited value here is like using `catch {}` to squelch all exceptions, or ignoring the return valu

Intent to Ship: String.prototype.replaceAll()

2019-11-14 Thread Jason Orendorff
String.prototype.replaceAll() is a convenience method for text processing. André Bargull [:anba] contributed the implementation of this feature. It's in Nightly now. The proposal is at Stage 3 of the TC39 Process[1]. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1540021 Proposed standard: ht

Intent to Implement and Ship: Promise.any

2019-11-14 Thread Jason Orendorff
We intend to implement and ship Promise.any, a proposed way to `await` several promises and continue as soon as any of them becomes fulfilled. André Bargull [:anba] has contributed patches implementing this feature. It will land in Nightly soon. We'll ship it once we're confident the specification

Re: Please don't use functions from ctype.h and strings.h

2020-06-26 Thread Jason Orendorff
This turns out to be super easy to do in clang-tidy, so I took bug 1485588. -j On Wed, Jun 24, 2020 at 2:35 PM Chris Peterson wrote: > On 8/27/2018 7:00 AM, Henri Sivonen wrote: > > I think it's worthwhile to have a lint, but regexps are likely to have > > false positives, so using clang-tidy i

New JavaScript engine module owner

2021-03-09 Thread Jason Orendorff
Hi, everyone. I'm pleased to announce that Jan De Mooij has agreed to take ownership of the JavaScript engine module. Following a Mozilla tradition that was venerable when I got here, Jan has been doing the job already for quite some time. Please join me in congratulating Jan and thanking him for