[turbofan] Reland "Add new JSFrameSpecialization reducer." and "Perform OSR deconstru...
authorbmeurer <bmeurer@chromium.org>
Mon, 6 Jul 2015 11:11:15 +0000 (04:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 6 Jul 2015 11:11:26 +0000 (11:11 +0000)
commitef661b080426d88be188342b4d8b9df3edd49026
tree8944a893dd37719527779389eaeb832da6bea141
parentb199bcdd47ae97ec116b430e34ab42001c8f04c0
[turbofan] Reland "Add new JSFrameSpecialization reducer." and "Perform OSR deconstruction early and remove type propagation.".

We have to reland these two commits at once, because the first breaks
some asm.js benchmarks without the second. The change was reverted
because of bogus checks in the verifier, which will not work in the
presence of OSR (and where hidden because of the type back propagation
hack in OSR so far). Original messages are below:

[turbofan] Add new JSFrameSpecialization reducer.

The JSFrameSpecialization specializes an OSR graph to the current
unoptimized frame on which we will perform the on-stack replacement.
This is used for asm.js functions, where we cannot reuse the OSR
code object anyway because of context specialization, and so we could as
well specialize to the max instead.

It works by replacing all OsrValues in the graph with their values
in the JavaScriptFrame.

The idea is that using this trick we get better performance without
doing the unsound backpropagation of types to OsrValues later. This
is the first step towards fixing OSR for TurboFan.

[turbofan] Perform OSR deconstruction early and remove type propagation.

This way we don't have to deal with dead pre-OSR code in the graph
and risk optimizing the wrong code, especially we don't make
optimistic assumptions in the dead code that leaks into the OSR code
(i.e. deopt guards are in dead code, but the types propagate to OSR
code via the OsrValue type back propagation).

BUG=v8:4273
LOG=n
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1226673005

Cr-Commit-Position: refs/heads/master@{#29486}
12 files changed:
BUILD.gn
src/compiler.cc
src/compiler.h
src/compiler/js-frame-specialization.cc [new file with mode: 0644]
src/compiler/js-frame-specialization.h [new file with mode: 0644]
src/compiler/osr.cc
src/compiler/pipeline.cc
src/compiler/typer.cc
src/compiler/verifier.cc
src/runtime/runtime-compiler.cc
test/cctest/compiler/test-osr.cc
tools/gyp/v8.gyp