On 2015/03/06 21:20:40, titzer wrote:
On 2015/03/06 14:20:35, dougc wrote:
> On 2015/03/05 19:44:45, titzer wrote:
...
> var buffer = new ArrayBuffer(16*1024*1024);
> var asm = (function test (glob, env, b) {
...
Ok, we need to look into why context specialization doesn't catch this.
Moz
shouldn't be using const for these bindings. The semantics differs
between VMs
and on V8 there is a tricky live range hole.
Const seems useful as it allows the value to be baked in before parsing the
entire scope. Currently Odin will only bake in a const initialized to a
literal
number, not a var. Const is defined in ES6 and V8 appears to have no problem
optimizing it's use well. Even a semantic difference between throwing versus
ignoring mutation is not of practical importance.
Could you give an example of how to tickle a 'live range hole' for the mode
==
CONST case? Is this hole check even necessary in this case?
There is some discussion in:
https://code.google.com/p/v8/issues/detail?id=3898
https://code.google.com/p/v8/issues/detail?id=327
Emscripten emits a 'var' for the arrays, so the above example was not so
representative. However the follow pattern is being discussed for
Emscripten and
is also not well optimized by TurboFan.
var i32 = new glob.Int32Array(b);
const MASK = env.MASK|0;
The hole check is problematic because the result of the
throw-reference-error
also feeds into a Phi. Context specialization replaces the JSLoadContext
with
the constant value, but the Phi remains. I assume the throw can not return,
so
should the Phi have been optimized away?
Could the hole checks be emitted after context specialization, and any
needed
state be noted in a flag on JSLoadContext?
The common path is expected to be no-hole-check so it might be more
efficient to
only emit the hole checks when needed, rather than emitting them for all
loads
and then optimizing them away.
https://codereview.chromium.org/967093002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.