Re: [JS-internals] Removing the MIPS back-end

2019-04-15 Thread Kannan Vijayan
There are significant constraints that are being imposed on other parts of the codebase to support this extra architecture branch. From the perspective of a production spidermonkey build, it often lags behind in feature support, correctness, and bugfixes. It imposes API requirements on the masm,

Re: [JS-internals] Proposal: always use braces for if/for/while statements

2018-09-04 Thread Kannan Vijayan
I'm a "yes" on this as well. I really don't care much either way in terms of personal preference, but the consistency argument works for me as it does for sfink. Kannan On Tue, Sep 4, 2018 at 12:04 PM Steve Fink wrote: > Heh. I find the bug argument unconvincing. It's true that the > always-br

Re: [JS-internals] How JS team members decide what to work on

2017-04-12 Thread Kannan Vijayan
It's possible to expose in the profiler UI, although the granularity might be too high and skew might be an issue. Really this is more of a telemetry-style metric - we can accumulate counts for how often fallbacks are hit (or how often we generalize into a polymorphic stub) and report that as a si

Re: [JS-internals] Looking for help on a problem I've found in JS.

2016-08-16 Thread Kannan Vijayan
Hi Susruthan, Your code is not producing an error because it is valid code. Bare braces represent blocks of code. They don’t always have to have an ‘if’, ‘while’, or ‘for’ statement associated with them. For example: function foo() { // some code { # block begins here

Re: [JS-internals] Optimization tracking API landed

2015-02-07 Thread Kannan Vijayan
Should be no problem. Optinfo hangs off of the JitcodeGlobalTable's IonEntry entries. There are also IonCacheEntry structs that we could hang optinfo for ICs from. We are already hanging some opt-info off of the BaselineEntry structs. These are used when we fail to Ion-compile - so we attac

Re: [JS-internals] 'in' operator is slow?

2014-07-31 Thread Kannan Vijayan
or ping me on irc.mozilla.org #jsapi (my nick is djvj). If I'm not around or not responding, you can also potentially ask jandem, nbp, or h4writer about stuff. Cheers! Kannan On 2014-07-31, 10:35 AM, Kannan Vijayan wrote: Hi Ting, Of course, that's fantastic :) I can mentor the

Re: [JS-internals] 'in' operator is slow?

2014-07-31 Thread Kannan Vijayan
? Thanks, Ting - Original Message - From: "Kannan Vijayan" To: dev-tech-js-engine-internals@lists.mozilla.org Sent: Wednesday, July 30, 2014 9:44:12 PM Subject: Re: [JS-internals] 'in' operator is slow? The simple reason is that we don't optimize this case in Ion yet. Looking

Re: [JS-internals] 'in' operator is slow?

2014-07-30 Thread Kannan Vijayan
The simple reason is that we don't optimize this case in Ion yet. Looking at IonBuilder's handling of JSOP_IN, it optimizes the case where the property being checked for is a dense element and the object is well-known, but it doesn't optimize property checks. The "full treatment" of this op w

Re: [JS-internals] Growing arrays

2014-07-17 Thread Kannan Vijayan
On 2014-07-17, 4:35 AM, Jan de Mooij wrote: On Thu, Jul 17, 2014 at 8:34 AM, Nicholas Nethercote wrote: Oh wait. It depends on the value of |length|. If it's 2050 or less, then the right-sized array is allocated immediately. Otherwise, it allocates 10 elements and then does the doubling thing.

Re: [JS-internals] Improving JavaScript Performance by Deconstructing the Type System

2014-06-20 Thread Kannan Vijayan
Thanks for linking, Nicholas, that was an interesting read. With respect to SpiderMonkey, some but not all of the problems they identify exist. On the issue of map-explosion due to function proto generation we have a lesser variant of the problem they describe. TypeObjects in TI are paramet

Re: [JS-internals] Congratulations Terrence!

2014-05-14 Thread Kannan Vijayan
Nice! Congrats Terrence :) Kannan On 2014-05-13, 2:38 PM, Naveed Ihsanullah wrote: Hello Team, Please join me in congratulating Terrence Cole in his new role as a Supervisor on the JavaScript team. Terrence joined Mozilla back in September of 2011. He was focused on JavaScript Garbage Colle

Re: [JS-internals] Why atomize strings in code?

2014-02-10 Thread Kannan Vijayan
On 2/7/2014, 4:55 PM, Nicholas Nethercote wrote: And as I said before, choosing to not atomize based on length is a bad idea: if 99% of the strings you deal with in a particular place are atomized, but 1% are not, then you can't use pointer equality. Forgot to reply to this earlier. I don't th

Re: [JS-internals] Why atomize strings in code?

2014-02-10 Thread Kannan Vijayan
On 2/7/2014, 4:55 PM, Nicholas Nethercote wrote: On Fri, Feb 7, 2014 at 1:40 PM, Kannan Vijayan wrote: Not hashing the entire string sounds like a collision attack vector. Any app or page coded in such a way as to enable an attacker to create interned strings would open the browser to a DoS

Re: [JS-internals] Why atomize strings in code?

2014-02-07 Thread Kannan Vijayan
On 2/7/2014, 4:11 PM, Nicholas Nethercote wrote: On Fri, Feb 7, 2014 at 8:31 AM, Kannan Vijayan wrote: Atomizing string literals is definitely a good idea, although it might make sense to put a length limit - say 32 or 64 chars (do we already do this, maybe?). We don't. If there were

Re: [JS-internals] Why atomize strings in code?

2014-02-07 Thread Kannan Vijayan
String literals are used heavily in run-time reflection, e.g.: Object.getOwnPropertyDescriptor(obj, 'foo') typeof(x) === "object") String literals are also used to represent symbolic values in JS. It's not uncommon to see things like: var Days = { Monday:'Monday', Tuesday:'Tuesday', ...

Re: [JS-internals] Reviving a JS specific tree

2013-12-12 Thread Kannan Vijayan
Isn't part of the reason for that the fact that TraceMonkey (and with Jaeger, Ion, and with Baseline, etc.) wasn't really a JS-specific tree? They were jit-specific trees, and the jits generally have a lot of cross-talk with the main JS VM. I would expect far less overlap between "general bro

Re: [JS-internals] Reviving a JS specific tree

2013-12-12 Thread Kannan Vijayan
I second this. If JS devs push a broken patch, it would be confined to the JS tree and not block other landings on the main tree. Likewise for broken m-i blocking JS landings. m-i bustage is becoming a bit of a bottleneck. Kannan On 12/12/2013, 3:08 PM, Brian Hackett wrote: I think mozill

Re: [JS-internals] Browser sluggishness due to GetElementIC, TypeMonitorResult, Shape::search, and others

2013-11-03 Thread Kannan Vijayan
You're hitting slowpath named property accesses (JSOP_GETELEM style) which are going through an Ion IC, but which are not getting optimized stubs added to handle them. Tracking down the relevant code with the in-browser might be helpful... The gecko profiler addon should be able to help here.

Re: [JS-internals] new JS module owner

2013-10-01 Thread Kannan Vijayan
Sounds like a reasonable move. Congrats Jason :) Kannan On 13-10-01 2:59 PM, Luke Wagner wrote: JS engine hackers, I'd like to make Jason Orendorff the new JS engine module owner. My reasoning: Since creating the js/jit submodule and making Jan the owner, I've been thinking about the new

Re: [JS-internals] Revisiting the removal of __noSuchMethod__

2013-09-11 Thread Kannan Vijayan
On 13-09-10 6:08 PM, Bobby Holley wrote: On Tue, Sep 10, 2013 at 2:25 PM, Kannan Vijayan wrote: I think in addition to those steps, we could also change the semantics of __noSuchMethod__ such that it only gets called for lookups of non-existant properties, as opposed to all lookups which

Re: [JS-internals] Revisiting the removal of __noSuchMethod__

2013-09-10 Thread Kannan Vijayan
On 13-09-10 4:41 PM, Luke Wagner wrote: Is the baseline JIT enabled in whatever sandbox/execution-environment these addons using the addon SDK run in? I don't know. But as Kannan says, the JITs still do the __noSuchMethod__ thing in the common case. Oh, I missed that, I was assuming we just ne

Re: [JS-internals] Revisiting the removal of __noSuchMethod__

2013-09-10 Thread Kannan Vijayan
Method__ usecases with proxies. (Or will be, once bug 878605 lands.) On Tue, Sep 10, 2013 at 5:35 PM, Kannan Vijayan wrote: I'd like to dredge up this topic and resolve it once and for all. Please see bug 912303 for why I'm bringing this up now: https://bugzilla.mo

Re: [JS-internals] Revisiting the removal of __noSuchMethod__

2013-09-10 Thread Kannan Vijayan
e in the compartment or whatever the right unit of isolation is? IIRC we did this for mutated Array.prototype at one point. Mike On Tuesday, September 10, 2013, Kannan Vijayan wrote: I'd like to dredge up this topic and resolve it once and for all. Please see bug 912303 for why

[JS-internals] Revisiting the removal of __noSuchMethod__

2013-09-10 Thread Kannan Vijayan
I'd like to dredge up this topic and resolve it once and for all. Please see bug 912303 for why I'm bringing this up now: https://bugzilla.mozilla.org/show_bug.cgi?id=912303 As it stands, our current JITs (neither Ion nor Baseline, nor Jaeger before that) do not respect __noSuchMethod__ seman

Re: [JS-internals] new js jit sub-module and owner

2013-07-30 Thread Kannan Vijayan
This makes a lot of sense to me and I think Jan is the right person for the job. Agreed on both counts. Kannan On 13-07-29 8:24 PM, Luke Wagner wrote: JS engine hackers, for the last five years, we've had an exciting sequence of jit compilers added, redesigned and removed. With the recent

Re: [JS-internals] Octane (with pdf.js)

2012-08-21 Thread Kannan Vijayan
On my macbook: ION + JM: Richards11180 Deltablue 10916 Crypto 15238 Raytrace7681 EarleyBoyer 13064 Regexp 2022 Splay 11539 NavierStokes22854 pdf.js 6201 Mandreel9316 GB Emulator