
Firefox 4 Beta 3 Released - mgunes
http://www.mozilla.com/en-US/firefox/4.0b3/releasenotes/
======
euroclydon
Has anyone read the part about the new jsval types?
[http://blog.mozilla.com/rob-sayre/2010/08/02/mozillas-new-
ja...](http://blog.mozilla.com/rob-sayre/2010/08/02/mozillas-new-javascript-
value-representation/)

According to the author, the old way was to store all JS vars in 32bit C
variables, so a small int was able to be stored inline, but floats, objects
and strings were stores as pointers.

The author says that the last four bits stored the type info for the variable.
But, since memory addresses are 8 hex characters long, a bitmask was used to
convert the last four bits into another hex character, thus establishing the
full pointer address.

How does this work? I mean, you only have the four bits, if the info is not
right there in front of my face in those four bits, how can a mask tease out
the hex character?

~~~
NinetyNine
I'm not sure I'm understanding you right; a hex character is four bits. To
tease a hex character out of a 32 bit int, you'd apply a max of 0000000F,
where F is the last four bits.

~~~
euroclydon
In the example, if the last four bits are 1100, it's a string. The first seven
four-bit quadruplets, plus a bitmask'd version of the last quadruplet (1100)
comprised eight sets for four bits. My questions is: how can four bits, if
they don't already encode the hex character I'm looking for, be bitmask'd into
displaying it, and still be capable of encoding any of the 16 possible hex
characters?

~~~
Benjo
Where do you see 4 bits? I only see him mention 3 bits:

The old jsval representation fit in a 32 bit value, using the 3 lowest bits as
a way to tag the value as a particular type. These were called type tags.

In the examples given, the lowest three bits are masked to 0s when determining
the address. That's a loss of precision, meaning there's no way to represent a
pointer to an address that's not modulo 8 == 0. Another way of saying this is
that objects must be aligned to 8 byte boundaries.

Isn't this a waste of space? Probably not. My guess is very few objects are
less than 8 bytes in length, so that space is not really wasted. Even if
objects ARE shorter, this is a dynamically typed language, we probably want to
keep spare memory anyway, to reduce the chance that adding values to an object
will require costly memory allocation.

------
timmfin
Don't get the regular beta, get the one with Tab Candy built in:
[http://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-
bui...](http://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-
builds/edward.lee@engineering.uiuc.edu-f193f519573b/) . It's definitely my
favorite (and most used) feature in FF 4.

------
vito
Wow, that's a whole lot of pretty major changes just for this beta. It's great
that the Add-Ons manager is in a tab now rather than a window. Hopefully the
Downloads window gets the same treatment.

Also: The "tabs on top" on OS X could use some touching-up - right now the tab
bar is just swapped with the toolbar, and still below the window's title area.
Something more like Chrome (or that Safari beta, for that matter) would be
nice.

------
wwortiz
Kind of makes me sad that it still looks like crap on linux, turns me
completely off of testing it.

Oh well, hopefully it is fixed by the time it is actually released.

~~~
bconway
By crap, do you mean "not like Windows," or actually crap? It looks native to
me ("good" in my book), just like every other GTK app that I use.

------
nailer
Awesome, but I predict most of HN won't be able to update until the similarly-
awesome Firebug is updated for FF 4.

~~~
saint-loup
Works here with an alpha version of Firebug and the Compatiblity Reporter
Addon.

~~~
jseifer
Link to alpha version: <http://blog.getfirebug.com/2010/08/10/firebug-1-6a19/>

------
newman314
Just a reminder that the changes in Beta 2 broke most of the extensions for
me. (and no, the compat extension does not fix this).

Also, copy and paste was broken in B2, anyone know if this is fixed in B3?

------
retube
Websockets question: will this allow direct p2p (browser to browser)
communication?

~~~
cx01
No. The WebSockets API in Javascript only allows acting as a client, not as a
server.

