Bug 645416, part 4 - Rename DefinePropertiesAndBrand -> DefinePropertiesAndFunctions. r=bhackett.

--HG--
extra : rebase_source : beadd475b66cb17c7fe6f74766a5d90767817cf0
Bug 645416, part 5 - Add the Symbol constructor and Symbol wrapper objects. r=efaust.

This exposes a new primitive type to scripts for the first time since
JavaScript first shipped in Netscape 2, over 13 years ago.

The tests focus on identity, equality, and being able to pass a symbol around
as a value. Of course the point of symbols is that they can be property keys,
but that will have to wait for a later patch in this series.

--HG--
extra : rebase_source : c22cf4b774cca8e7c9f6c757079e054a6eb0f307
Bug 645416, part 6 - JIT support for symbol values. r=jandem.

Symbols are not yet supported as property keys at this point in the stack. The
work here is to pass symbol pointers around in Ion JIT code unboxed.

The baseline compiler doesn't need much new code. A few kinds of ICs need to
know all the primitive types.

--HG--
extra : rebase_source : 3addcd18e913e5879b0ee3700ecf9660b14b1e05
Bug 645416, part 7 - Support symbols as Map keys. r=terrence.

--HG--
extra : rebase_source : 5e40fe2514e7eb9ca874b1c271ed4a4e11f9c2ff
Bug 645416, part 8 - Support passing symbols across compartment boundaries. r=terrence.

Trivial. Since symbols are always allocated in the atoms compartment and all
compartments are allowed to have direct references to them, Compartment::wrap
on a symbol is a no-op.

--HG--
extra : rebase_source : 2f51ff0b3870885de8c6ef6a82efa7398e17d5e8
Bug 645416, part 9 - Implement the symbol registry and Symbol.for(). r=terrence,r=efaust.

--HG--
extra : rebase_source : df06d065f70756dea63dfd8e9df56610ff46d393
Bug 645417, part 10 - Well-known symbols. r=terrence,r=efaust.

At present there is only one, Symbol.iterator, and it is not hooked up to
anything (this happens in bug 918828). ES6 defines 8 well-known symbols. Each
one is attached to a feature, so we'll add the symbols as we add features.
Symbol.create will appear when @@create semantics are implemented.

--HG--
extra : rebase_source : aab40a7487708c8bbd23dcfbe935ece1903d75ff
Bug 645416, part 11 - Update GDB pretty-printers for symbols. r=jimb.

--HG--
extra : rebase_source : ab2063ab6073b748069c6a8ad1cd34ab0d5e7d86
Bug 645416, part 12 - Update ToBoolean for symbols. r=sfink.

--HG--
extra : rebase_source : 24d444b77bbfdbc35e3f99c73e5b182e2ecad029
Bug 645416, part 13 - Update ToNumber for symbols. r=sfink.

Not terribly interesting; converting a symbol to a number always produces NaN.

--HG--
extra : rebase_source : ded251ef9e92d92483b5cc18cf16e2910084bbff
Bug 645416, part 14 - Update ToString for symbols. r=sfink.

The change in jit-test/tests/symbol/toString.js is that we now check that an
exception is actually thrown. Until this patch, stringifying a symbol did not
throw. (The test was mainly checking that we did not assert in Ion.)

No changes in Ion. If a symbol is being stringified, it's ok to be in a slow
path because that is going to throw anyway.

--HG--
extra : rebase_source : 9cf314dafa7392a20fee9d3b5acc4ad7fc1c5229
Bug 645417, part 15 - Tests for ToObject on symbols. r=sfink.

The test as-base-value.js is not testing symbols as property keys (which is
implemented in a later patch), but on the other side of the . operator: as
things that can have property accesses done to them, just like you can do
"name".length or (3.14).toString().

--HG--
extra : rebase_source : 3dac7660999bd021ec32c13985471e1608a29f64
Bug 645416, part 16 - Implement Symbol.prototype.valueOf. r=sfink.

--HG--
extra : rebase_source : 12dfad71e0933ccc3e553854f44bdf0f85eccf64
Bug 645416, part 17 - Implement ToPrimitive on Symbol wrapper objects. r=sfink.

The spec defines this by way of a @@toPrimitive method. We fake it using a
JSClass::convert hook. (Once @@toPrimitive is implemented, convert hooks
can be removed entirely, but we need symbols first.)

--HG--
extra : rebase_source : c8c7ed3eead8bd79bb38b70f448ebb98c5b3d780
Bug 645416, part 18 - Update ValueToSource for symbols. r=sfink.

--HG--
extra : rebase_source : 8d3702bd625ba2126f691810e1ea2a7736fd77e7
Bug 645416, part 19 - Update assertDeepEq for symbols. r=till.

The contract of assertDeepEq(a, b) is that the assertion passes iff a and b
have the isomorphic heap graphs. Symbols, like objects, are treated as nodes in
this graph. So, for example, if a and b are distinct symbols, then [a, b] is
not deepEq to [b, b] because they have distinct graphs. There are three nodes
in [a, b]: the array, a, and b.  There are only two nodes in [b, b]: the array,
and b.

--HG--
extra : rebase_source : 9415559bab9f0ed132dd49d3790892b3209fa77b
Bug 645416, part 20 - Add JS::Symbol::dump() method for debugging. r=efaust.

--HG--
extra : rebase_source : 2e2539f319593d51876ef39caa0c96800b6d605e
Bug 645416, part 21 - Add symbol jsids (SYMBOL_TO_JSID), removing the legacy support for object jsids (OBJECT_TO_JSID). r=terrence,r=jimb,r=efaust.

With just this patch, there are not actually any symbol jsids flowing through
the system, just as there are not actually any object jsids. But a subsequent
patch (part 23) changes this.

This patch deletes some code in CTypes.cpp that is simply confused about how
element accesses work: Int64 and UInt64 objects were never actually converted
to object jsids, so the code being removed here was already dead code.

--HG--
extra : rebase_source : 86f421c6454344e76ce5219b7b1aed5c83b45f24
Bug 645416, part 22 - Remove JSCompartment::wrapId. r=terrence.

This is unnecessary now that object jsids no longer exist. Both string and
symbol jsids point only to GC things in the atoms compartment, which are safe
to pass to any compartment without wrapping.

--HG--
extra : rebase_source : 82c21e8474df05b1bb42c14d872c981205bbe879
Bug 645416, part 23 - Implement ValueToId for symbols. This makes symbols work as property keys. r=efaust.

--HG--
extra : rebase_source : eec18157d90daf54afc300b81d351011e5b669d5