Sheppy | 8 Feb 19:54
Picon

Wiki Wednesday (SpiderMonkey) - February 8, 2012

Here are today's Wiki Wednesday articles! If you know about these
topics, please try to find a few minutes to look over these articles
that are marked as needing technical intervention and see if you can
fix them up. You can do so either by logging into the wiki and editing
the articles directly, or by emailing your notes, sample code, or
feedback to mdnwiki <at> mozilla.org.

Contributors to Wiki Wednesday will get recognition in the next Wiki
Wednesday announcement. Thanks in advance for your help!

1) JS_ExecuteRegExp ( http://mzl.la/rtGFID )
2) JS_GetOwnPropertyDescriptor ( http://mzl.la/ovjP4q )
3) JS_FlattenString ( http://mzl.la/nKOtqk )
Bob | 8 Feb 15:46
Picon
Gravatar

SML Events

Brethern;
     Regular communication on Feb 13,  6 pm We will have a meal of 1/2
roast chicken.  We will need to know exactly how many will be
attending (reservations) to get the right amount of food.  PLEASE let
me know by Sunday the 12th at the latest otherwise you'll have no
chicken. Cost $10.
 Also Feb 18th film night with jumbalaya.  Reservations required.
Doors open @ 6pm. Cost $10
FOR ALL RESERVATIONS PLEASE CALL THE NUMBER LISTED AND LEAVE A
MESSAGE.
Fraternally
Bob Decelle
Junior Warden
978-409-2375
Masquerade | 7 Feb 10:17
Picon
Favicon

Preventing Decompilation

I would like to use Spidermonkey as the scripting engine of my own
product.  I need to allow users of my product to distribute compiled
script source in binary format that cannot be decompiled easily for
copyright protection.

Currently, my understanding is that I need to XDR the compiled
JSScriptObject() and add my own encryption to it the binary output.
But I also found that the internal JSScript object already contains
information like source notes that allow people to decompile the
scripts.  These source notes seem to be included in the XDR binary
output so reloading an XDR image would simply regenerate the decompile
information for a hacker to see.  Can we remove these source notes
information directly from the JSScript object?  Is there any other
legitimate functionality other than decompilation that depends on the
availability of source notes?
sloisel | 4 Feb 18:24
Picon
Picon
Favicon
Gravatar

Apparent poor performance with some sparse Array uses

Dear Mozilla js developers,

I have discovered a poor performance case for v8 as well as Firefox
and the other browsers. My intuition is that this poor performance is
caused by the use of lots of moderately sparse Arrays. I discovered
this while implementing standard numerical analysis routines. For
most
of my routines, I can get 50-300MFLOPS (millions of floating points
instructions per second), which is not too bad (C would yield some
GFLOPS). When I started implementing sparse linear algebra, the use
of
sparse Arrays was natural. However, I found that, at least when the
sparse Arrays get a little bit dense, the FLOP rate is only about
1-2MFLOPS.

In order to show this behavior in a self-contained example, I've made
a self-contained benchmark here: http://jsperf.com/sparse-array-performance

What do you think?

Thanks,

Sébastien Loisel
Anders Feder | 3 Feb 13:44
Picon

Building SpiderMonkey with Android NDK toolchain

Hi,

I am porting a game using SpiderMonkey to Android. Because I need to
integrate with the game's existing build system, I have to build
SpiderMonkey using the Android NDK standalone toolchain, not the ndk-
build tool. Can anyone please tell me how to accomplish this?

I can see that SpiderMonkey's configure has an --with-android-
toolchain=DIR option, but I am unsure how to use it - specifically,
which other options I need to combine it with?

Thank you.

Anders Feder
Boris Zbarsky | 30 Jan 21:50
Picon
Favicon

Re: Performance: "in" operator vs property access via []

On 1/30/12 3:44 PM, Donny Viszneki wrote:
> There's also the hasOwnProperty() method of Object.prototype which
> does not climb the prototype chain looking for the property. Anyone
> know how this one stacks up?

It's almost certainly slower than a property get from jitted code.

It's probably faster than the "in" operator.

-Boris
Masquerade | 27 Jan 18:04
Picon
Favicon

Making Spidermonkey Parser API Available to JS_CompileFile()

When I use the stand alone Spidermonkey shell to load and execute a
javascript source file by the load() function call,  the
Reflect.parse() global object/function is available.  But when I
compile the same javascript src by the JSAPI function
JS_CompileFile(), the Reflect object is undefined.

How do we enable the Reflect object when using the standard JSAPI
compilation functions?
Sheppy | 26 Jan 01:33
Picon

Wiki Wednesday (SpiderMonkey) - January 25, 2012

Here are today's Wiki Wednesday articles! If you know about these
topics, please try to find a few minutes to look over these articles
that are marked as needing technical intervention and see if you can
fix them up. You can do so either by logging into the wiki and editing
the articles directly, or by emailing your notes, sample code, or
feedback to mdnwiki <at> mozilla.org.

Contributors to Wiki Wednesday will get recognition in the next Wiki
Wednesday announcement. Thanks in advance for your help!

1) JS_ExecuteRegExp ( http://mzl.la/rtGFID )
2) JS_GetGCParameterForThread ( http://mzl.la/pE1jHr )
3) JS_CompileUCFunctionForPrincipalsVersion ( http://mzl.la/prbjUG )
Sheppy | 25 Jan 17:14
Picon

Re: Let's adopt the Firefox/Gecko Version numbers

On Jan 25, 10:23 am, Tom Schuster <t...@schuster.me> wrote:
> At the moment, we don't have any clear way how we mark new versions.
> The last "official" , I am aware of is JavaScript 1.8.5. which we
> shipped with Firefox 4, so like 10 years or something.
>
> We should do the same as Gecko and just use Firefox version numbers.
> We can still consider if we want to release a new version, everytime
> we switch from nightly to aurora.
> The main reason, I would like this change is, that it's very hard to
> talk about JavaScript Engine versions on MDN.

I for one would love this. It would sure make documentation a lot
easier.

Eric Shepherd
Developer Documentation Lead
Mozilla
http://www.bitstampede.com/
Tom Schuster | 25 Jan 16:23

Let's adopt the Firefox/Gecko Version numbers

At the moment, we don't have any clear way how we mark new versions.
The last "official" , I am aware of is JavaScript 1.8.5. which we
shipped with Firefox 4, so like 10 years or something.

We should do the same as Gecko and just use Firefox version numbers.
We can still consider if we want to release a new version, everytime
we switch from nightly to aurora.
The main reason, I would like this change is, that it's very hard to
talk about JavaScript Engine versions on MDN.

Cheers,
Tom
Anton | 22 Jan 22:05
Picon
Gravatar

Threaded debug dump in JSInterpreter

Hi,

I am trying to enable a threaded debug dump in SpiderMonkey, by
editing the jsinterp.cpp file. Basically, the things I am trying to do
are as follows:

   1. Catch a JSScript before the main loop of Interpret() begins.
   2. Open a separate thread.
   3. In that thread, invoke js_Disassemble with the script to get the
machine code.
   4. Write the machine code to a file.

The reason for trying a threaded version is simply for performance
issues. Some addons become "unresponsive" if I run the disassmeble and
write the output in the same thread. I can get some output in a single
thread but it's way too slow.

I followed the tutorial in https://developer.mozilla.org/en/Making_Cross-Thread_Calls_Using_Runnables
for creating threads. But when I built it, I faced 11 "unresolved
external symbol error." Again after some googling, I found out about
setting XPCOM_GLUE by #define XPCOM_GLUE 1. However, this time I am
facing a new problem: "base class nsRunnable not defined". I can't
find a solution for this.

Any help would be appreciated.
Thanks,
Anton

Gmane