emberjs/ember.js — pull request #5232 by twokul (2014-07-25 18:25:07+00:00)
Title: Replaces META_KEY with `__ember_meta__`

V8 deoptimizes access to the object property:

```javascript
function finishChains() {
// Access to `obj[META_KEY]` will be deoptimized
var m = obj[META_KEY], chains = m && m.chains;
if (chains) {
// ...
}
}
```

[Relevant V8 trace](https://gist.github.com/twokul/00b0369dbe86f1ffa011#file-code-asm-L630-L640)
[Hygrogen trace](https://gist.github.com/twokul/dad7e4b671235bd64284#file-hydrogen-cfg-L23837)

Here's the sample that was profiled:

```javascript
function createPeople() {
var people = [];

for (var i = 0; i < 500; i++) {
people.push(
Ember.Object.create()
);
}

return people;
}
```

Result:

```sh
[benchmark.js] META_KEY createPeople x 306 ops/sec ±0.60% (89 runs sampled)
[benchmark.js] '__ember_meta__' createPeople x 336 ops/sec ±0.60% (87 runs sampled)
```

Related [V8 bug](https://code.google.com/p/v8/issues/detail?id=3167).

Tested against:

+ [V8 3.26](https://github.com/v8/v8/commits/3.26), Chrome 36.0.1985.125.
+ [V8 master](https://github.com/v8/v8/commits/master), Chrome 38.0.2104.0.