Reviewers: jarin,
Message:
Hey Jaro,
This is the initial fix for TCO, making the optimization itself testable and
independent of instruction selection. The instruction selector still decides
whether to actually do a tail call or fall back to a normal call. I'd
prefer to
not have that in the instruction selector, but that's up to Sven to decide
whether it's necessary. Currently we don't have any use cases for that
anyway.
Once this is decided we can also cleanup the code duplication in VisitCall
and
VisitTailCall.
Please take a look.
Thanks,
Benedikt
Description:
[turbofan] Fix tail call optimization.
Tail calls are matched on the graph, with a dedicated tail call
optimization that is actually testable. The instruction selection can
still fall back to a regular if the platform constraints don't allow to
emit a tail call (i.e. the return locations of caller and callee differ
or the callee takes non-register parameters, which is a restriction that
will be removed in the future).
Also explicitly limit tail call optimization to stubs for now and drop
the global flag.
BUG=v8:4076
LOG=n
Please review this at https://codereview.chromium.org/1114163005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+1063, -191 lines):
M BUILD.gn
M src/compiler/arm/instruction-selector-arm.cc
M src/compiler/arm64/instruction-selector-arm64.cc
M src/compiler/common-operator.h
M src/compiler/common-operator.cc
M src/compiler/ia32/instruction-selector-ia32.cc
M src/compiler/instruction-selector.h
M src/compiler/instruction-selector.cc
M src/compiler/machine-type.h
M src/compiler/mips/instruction-selector-mips.cc
M src/compiler/mips64/instruction-selector-mips64.cc
M src/compiler/node.h
M src/compiler/node.cc
M src/compiler/opcodes.h
M src/compiler/pipeline.cc
M src/compiler/schedule.h
M src/compiler/schedule.cc
M src/compiler/scheduler.cc
A src/compiler/tail-call-optimization.h
A src/compiler/tail-call-optimization.cc
M src/compiler/typer.cc
M src/compiler/verifier.cc
M src/compiler/x64/instruction-selector-x64.cc
M src/flag-definitions.h
M src/globals.h
M src/hydrogen-instructions.h
M test/unittests/compiler/instruction-selector-unittest.cc
M test/unittests/compiler/node-test-utils.h
M test/unittests/compiler/node-test-utils.cc
M test/unittests/compiler/node-unittest.cc
M test/unittests/compiler/scheduler-unittest.cc
A test/unittests/compiler/tail-call-optimization-unittest.cc
M test/unittests/unittests.gyp
M tools/gyp/v8.gyp
--
--
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.