Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Issue 1261923007: [turbofan] Unify referencing of stack slots (Closed)

Created:
5 years, 4 months ago by danno
Modified:
5 years, 3 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Unify referencing of stack slots Previously, it was not possible to specify StackSlotOperands for all slots in both the caller and callee stacks. Specifically, the region of the callee's stack including the saved return address, frame pointer, function pointer and context pointer could not be addressed by the register allocator/gap resolver. In preparation for better tail call support, which will use the gap resolver to reconcile outgoing parameters, this change makes it possible to address all slots on the stack, because slots in the previously inaccessible dead zone may become parameter slots for outgoing tail calls. All caller stack slots are accessible as they were before, with slot -1 corresponding to the last stack parameter. Stack slot indices >= 0 access the callee stack, with slot 0 corresponding to the callee's saved return address, 1 corresponding to the saved frame pointer, 2 corresponding to the current function context, 3 corresponding to the frame marker/JSFunction, and slots 4 and above corresponding to spill slots. The following changes were specifically needed: * Frame has been changed to explicitly manage three areas of the callee frame, the fixed header, the spill slot area, and the callee-saved register area. * Conversions from stack slot indices to fp offsets all now go through a common bottleneck: OptimizedFrame::StackSlotOffsetRelativeToFp * The generation of deoptimization translation tables has been changed to support the new stack slot indexing scheme. Crankshaft, which doesn't support the new slot numbering in its register allocator, must adapt the indexes when creating translation tables. * Callee-saved parameters are now kept below spill slots, not above, to support saving only the optimal set of used registers, which is only known after register allocation is finished and spill slots have been allocated. Committed: https://crrev.com/cbbaf9ea6abbc0417ee5765a4c58f1dda939ead0 Cr-Commit-Position: refs/heads/master@{#30224}

Patch Set 1 #

Patch Set 2 : Latest #

Patch Set 3 : Latest #

Patch Set 4 : Latest #

Patch Set 5 : Latest #

Patch Set 6 : Merge with ToT #

Patch Set 7 : Fix Crankshaft and deoptimizer #

Patch Set 8 : Latest #

Patch Set 9 : ia32 cleanup #

Patch Set 10 : ARM port #

Patch Set 11 : Ben's feedback #

Patch Set 12 : Latest #

Patch Set 13 : Add x64 support #

Patch Set 14 : Finish ports, prettify #

Patch Set 15 : Ready for review #

Patch Set 16 : Final tweaks #

Total comments: 14

Patch Set 17 : Review feedback #

Patch Set 18 : Review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+548 lines, -420 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -4 lines 0 comments Download
M src/arm64/lithium-codegen-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -4 lines 0 comments Download
M src/compiler/arm/code-generator-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +50 lines, -57 lines 0 comments Download
M src/compiler/arm64/code-generator-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +43 lines, -45 lines 0 comments Download
M src/compiler/code-generator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +8 lines, -2 lines 0 comments Download
M src/compiler/frame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +109 lines, -38 lines 0 comments Download
A src/compiler/frame.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +24 lines, -0 lines 0 comments Download
M src/compiler/ia32/code-generator-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +31 lines, -40 lines 0 comments Download
M src/compiler/linkage.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +14 lines, -18 lines 0 comments Download
M src/compiler/mips/code-generator-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +43 lines, -41 lines 0 comments Download
M src/compiler/mips64/code-generator-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +41 lines, -42 lines 0 comments Download
M src/compiler/osr.cc View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M src/compiler/pipeline.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/pipeline.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +13 lines, -4 lines 0 comments Download
M src/compiler/register-allocator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +72 lines, -70 lines 0 comments Download
M src/deoptimizer.h View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M src/deoptimizer.cc View 1 2 3 4 5 6 7 8 9 6 chunks +10 lines, -21 lines 0 comments Download
M src/frames.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +7 lines, -1 line 0 comments Download
M src/frames.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -11 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -4 lines 0 comments Download
M src/mips/lithium-codegen-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -4 lines 0 comments Download
M src/mips64/lithium-codegen-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -4 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -4 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 18 (5 generated)
titzer
Mostly looking good. ARM64 is going to be fun with the JSP/CSP distinction.
5 years, 4 months ago (2015-08-13 18:12:53 UTC) #2
danno
PTAL, I think it's ready to go
5 years, 4 months ago (2015-08-14 13:36:27 UTC) #4
Benedikt Meurer
LGTM with nits. Very nice, I love it. https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h File src/compiler/frame.h (right): https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h#newcode44 src/compiler/frame.h:44: // ...
5 years, 4 months ago (2015-08-16 07:04:36 UTC) #5
Jarin
almost lgtm. https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h File src/compiler/frame.h (right): https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h#newcode125 src/compiler/frame.h:125: ++spilled_callee_register_slot_count_ += count; How about 'frame_slot_count_ += ...
5 years, 4 months ago (2015-08-16 09:28:59 UTC) #6
Benedikt Meurer
https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h File src/compiler/frame.h (right): https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h#newcode125 src/compiler/frame.h:125: ++spilled_callee_register_slot_count_ += count; Oh indeed. Missed this one. Should ...
5 years, 4 months ago (2015-08-16 09:31:34 UTC) #7
titzer
https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h File src/compiler/frame.h (right): https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h#newcode84 src/compiler/frame.h:84: static const int kFixedSlotCount = I think this is ...
5 years, 4 months ago (2015-08-17 10:58:43 UTC) #8
danno
Feedback addressed. I'll land this when all of the try bots are green. https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h File ...
5 years, 4 months ago (2015-08-18 13:23:11 UTC) #9
titzer
https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h File src/compiler/frame.h (right): https://codereview.chromium.org/1261923007/diff/290027/src/compiler/frame.h#newcode84 src/compiler/frame.h:84: static const int kFixedSlotCount = On 2015/08/18 13:23:10, danno ...
5 years, 4 months ago (2015-08-18 13:30:04 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261923007/330001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261923007/330001
5 years, 4 months ago (2015-08-18 14:46:56 UTC) #13
commit-bot: I haz the power
Committed patchset #18 (id:330001)
5 years, 4 months ago (2015-08-18 14:48:02 UTC) #14
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/cbbaf9ea6abbc0417ee5765a4c58f1dda939ead0 Cr-Commit-Position: refs/heads/master@{#30224}
5 years, 4 months ago (2015-08-18 14:48:19 UTC) #15
MTBrandyberry
This new slot numbering scheme does not appear to support frames with embedded constant pool ...
5 years, 3 months ago (2015-08-26 17:35:14 UTC) #17
MTBrandyberry
5 years, 3 months ago (2015-08-28 15:39:38 UTC) #18
Message was sent while issue was closed.
On 2015/08/26 17:35:14, mtbrandyberry wrote:
> This new slot numbering scheme does not appear to support frames with embedded
> constant pool pointers?

Embedded constant pool issue fixed via
https://codereview.chromium.org/1317123003/

Powered by Google App Engine
This is Rietveld 408576698