Reviewers: Benedikt Meurer, Michael Starzinger,

Message:
PTAL.

This implements the new strategy as we discussed.

Description:
[turbofan]: Add a context relaxation Reducer

In many cases, the context that TurboFan's ASTGraphBuilder or subsequent
reduction operations attaches to nodes does not need to be that exact
context, but rather only needs to be one with the same native context,
because it is used internally only to fetch the native context, e.g. for
creating and throwing exceptions.

This reducer recognizes common cases where the context that is specified
for a node can be relaxed to a canonical, less specific one. This
relaxed context can either be the enclosing function's context or a specific
Module or Script context that is explicitly created within the function.

This optimization is especially important for TurboFan-generated code stubs
which use context specialization and inlining to generate optimal code.
Without context relaxation, many extraneous moves are generated to pass
exactly the right context to internal functions like ToNumber and
AllocateHeapNumber, which only need the native context. By turning context
relaxation on, these moves disappear because all these common internal
context uses are unified to the context passed into the stub function, which
is typically already in the correct context register and remains there for
short stubs. It also eliminates the explicit use of a specialized context
constant in the code stub in these cases, which could cause memory leaks.

Please review this at https://codereview.chromium.org/1244583003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+438, -11 lines):
  M BUILD.gn
  M src/code-stubs.cc
  M src/compiler/ast-graph-builder.cc
  M src/compiler/common-operator.h
  M src/compiler/common-operator.cc
  M src/compiler/frame-states.h
  A src/compiler/js-context-relaxation.h
  A src/compiler/js-context-relaxation.cc
  M src/compiler/js-inlining.cc
  M src/compiler/pipeline.cc
  M test/unittests/compiler/instruction-selector-unittest.cc
  A test/unittests/compiler/js-context-relaxation-unittest.cc
  M test/unittests/compiler/liveness-analyzer-unittest.cc
  M test/unittests/unittests.gyp
  M tools/gyp/v8.gyp


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to