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

Issue 1377423002: [turbofan] Fix calls to computed code objects. (Closed)

Created:
5 years, 2 months ago by titzer
Modified:
5 years, 2 months ago
Reviewers:
Michael Starzinger
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Fix calls to computed code objects. R=mstarzinger@chromium.org BUG= Committed: https://crrev.com/924b0ecf8556ef75d3dff960b04c2a6318345c56 Cr-Commit-Position: refs/heads/master@{#31057}

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -3 lines) Patch
M src/compiler/ia32/code-generator-ia32.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/compiler/codegen-tester.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M test/cctest/compiler/test-run-machops.cc View 1 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
titzer
5 years, 2 months ago (2015-10-01 14:58:18 UTC) #1
Michael Starzinger
LGTM with a nit. https://codereview.chromium.org/1377423002/diff/1/test/cctest/compiler/codegen-tester.h File test/cctest/compiler/codegen-tester.h (right): https://codereview.chromium.org/1377423002/diff/1/test/cctest/compiler/codegen-tester.h#newcode55 test/cctest/compiler/codegen-tester.h:55: Handle<Code> code() { nit: s/code/GetCode/ ...
5 years, 2 months ago (2015-10-01 15:48:54 UTC) #2
titzer
On 2015/10/01 15:48:54, Michael Starzinger wrote: > LGTM with a nit. > > https://codereview.chromium.org/1377423002/diff/1/test/cctest/compiler/codegen-tester.h > ...
5 years, 2 months ago (2015-10-01 16:47:57 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1377423002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1377423002/20001
5 years, 2 months ago (2015-10-01 16:48:14 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 2 months ago (2015-10-01 17:11:42 UTC) #7
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/924b0ecf8556ef75d3dff960b04c2a6318345c56 Cr-Commit-Position: refs/heads/master@{#31057}
5 years, 2 months ago (2015-10-01 17:12:03 UTC) #8
MTBrandyberry
On 2015/10/01 14:58:18, titzer wrote: I have a question whether this new test is valid. ...
5 years, 2 months ago (2015-10-05 22:17:25 UTC) #9
titzer
5 years, 2 months ago (2015-10-05 22:36:16 UTC) #10
Message was sent while issue was closed.
On 2015/10/05 22:17:25, mtbrandyberry wrote:
> On 2015/10/01 14:58:18, titzer wrote:
> 
> I have a question whether this new test is valid.  It appears that functions a
> and b are generated with C linkage conventions, but that the calling code is
> 'tricked' into generating a call to a code object target (kCallAddress vs
> kCallCodeObject).  I guess this works fine on most platforms (for functions
such
> as these without parameters).

Right. The only difference here is that the incoming code object is no longer a
constant, it's a computed value.


> I don't think this quite works for all platforms.  On AIX, for example, calls
to
> function pointers are done via descriptors -- which encode a level of
> indirection such that the calling code must first load the instruction address
> from the descriptor prior to branching.  Thus, as in this example, forcing the
> caller to generate code not suitable for the target will result in a crash.

So I think you are saying that you basically need the full functionality of the
macro assembler __ CallCFunction() for any calls to C, computed or not?

In that case, we should change the test to generate code objects that are
callable through a different convention. Here we're just interested in
checking the call, so I reused the testing functionality to get some functions
callable as C.

> I see there is a TODO noted prior to the CallDescriptor logic in the test
code. 
> Is there an intention to implement this test in a different way in the future?

> Or perhaps I'm missing some other solution to this problem that can be
> implemented in the platform code?

The TODO is mostly just to note that this was kind of a nasty dance and should
be fixed.

Powered by Google App Engine
This is Rietveld 408576698