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

Issue 1264543002: Simplify constant pool usage in arm64 code generator (by removing extra argument (Closed)

Created:
5 years, 4 months ago by regis
Modified:
5 years, 4 months ago
Reviewers:
zra, Florian Schneider
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Simplify constant pool usage in arm64 code generator (by removing extra argument to all code emitting routines that may access the pool). Improve code loading immediates on arm64 (do not read from the pool if 1 or 2 immediate instructions will do). R=zra@google.com Committed: https://github.com/dart-lang/sdk/commit/b5f4e95433d0c2904815c36860eae7dff709e305

Patch Set 1 #

Total comments: 3

Patch Set 2 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1230 lines, -1274 lines) Patch
M runtime/vm/assembler_arm64.h View 11 chunks +55 lines, -76 lines 0 comments Download
M runtime/vm/assembler_arm64.cc View 1 30 chunks +214 lines, -233 lines 0 comments Download
M runtime/vm/assembler_arm64_test.cc View 108 chunks +210 lines, -210 lines 0 comments Download
M runtime/vm/code_patcher_arm64_test.cc View 1 chunk +4 lines, -1 line 0 comments Download
M runtime/vm/constants_arm64.h View 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_arm64.cc View 48 chunks +166 lines, -157 lines 0 comments Download
M runtime/vm/instructions_arm64_test.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 101 chunks +212 lines, -224 lines 0 comments Download
M runtime/vm/intrinsifier_arm64.cc View 52 chunks +120 lines, -124 lines 0 comments Download
M runtime/vm/object_arm64_test.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M runtime/vm/runtime_entry_arm64.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 82 chunks +234 lines, -236 lines 0 comments Download
M runtime/vm/stub_code_arm64_test.cc View 2 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
regis
5 years, 4 months ago (2015-07-29 00:35:41 UTC) #2
Florian Schneider
https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc File runtime/vm/assembler_arm64.cc (right): https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc#newcode389 runtime/vm/assembler_arm64.cc:389: LoadImmediate(dst, target); This will have change again with precompiled ...
5 years, 4 months ago (2015-07-29 09:56:07 UTC) #4
Florian Schneider
https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc File runtime/vm/assembler_arm64.cc (right): https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc#newcode389 runtime/vm/assembler_arm64.cc:389: LoadImmediate(dst, target); On 2015/07/29 09:56:07, Florian Schneider wrote: > ...
5 years, 4 months ago (2015-07-29 10:22:44 UTC) #5
regis
https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc File runtime/vm/assembler_arm64.cc (right): https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc#newcode389 runtime/vm/assembler_arm64.cc:389: LoadImmediate(dst, target); On 2015/07/29 10:22:44, Florian Schneider wrote: > ...
5 years, 4 months ago (2015-07-29 15:35:02 UTC) #6
regis
On 2015/07/29 15:35:02, regis wrote: > https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc > File runtime/vm/assembler_arm64.cc (right): > > https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc#newcode389 > ...
5 years, 4 months ago (2015-07-29 17:52:17 UTC) #7
zra
lgtm It would be interesting as a sanity check to see how many instructions are ...
5 years, 4 months ago (2015-07-29 21:13:04 UTC) #8
regis
The new version executes 0.86% more arm64 instructions when running hello world in the simulator. ...
5 years, 4 months ago (2015-07-29 22:20:52 UTC) #9
regis
Committed patchset #2 (id:20001) manually as b5f4e95433d0c2904815c36860eae7dff709e305 (presubmit successful).
5 years, 4 months ago (2015-07-29 22:21:24 UTC) #10
Florian Schneider
On 2015/07/29 17:52:17, regis wrote: > On 2015/07/29 15:35:02, regis wrote: > > > https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc ...
5 years, 4 months ago (2015-08-03 08:23:13 UTC) #11
regis
5 years, 4 months ago (2015-08-03 21:00:43 UTC) #12
Message was sent while issue was closed.
On 2015/08/03 08:23:13, Florian Schneider wrote:
> On 2015/07/29 17:52:17, regis wrote:
> > On 2015/07/29 15:35:02, regis wrote:
> > >
> >
>
https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64.cc
> > > File runtime/vm/assembler_arm64.cc (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/1264543002/diff/1/runtime/vm/assembler_arm64....
> > > runtime/vm/assembler_arm64.cc:389: LoadImmediate(dst, target);
> > > On 2015/07/29 10:22:44, Florian Schneider wrote:
> > > > On 2015/07/29 09:56:07, Florian Schneider wrote:
> > > > > This will have change again with precompiled code where ExternalLabel
> has
> > to
> > > > be
> > > > > loaded from the pool. I'd rather put this change on hold until then.
> > > > 
> > > > Alternatively, I would suggest to leave loading of ExternalLabels as is
-
> > i.e.
> > > > load then via the constant pool.
> > > 
> > > Do you mean that the external label will be patchable? So far, the
patchable
> > > argument was always kNotPatchable, which is the reason why I simplified
this
> > > code by removing the patchable formal parameter. What will be the
signature
> of
> > > the function? What about LoadExternalLabelFixed below? Will it change?
> > 
> > Ryan answered my questions offline and Srdjan pointed out that you probably
> > meant "load *them* via the constant pool".
> > So I updated the cl to load the external label from the pool if using the
> > constant pool is allowed. It is not always allowed, e.g. when calling the
> > runtime from stubs. The resulting code should be identical as before, since
it
> > is rare that the bit pattern of a label can be generated by 2 or fewer
> > instructions.
> 
> ExternalLabels always need to be loaded from the constant pool, *also* in
stubs.
> 
> The only place where the constant pool register is not set up is in intrinsic
> code.
> 
> This means we can't to any runtime- or stub-calls from intrinsic code. But
> intrinsics
> usually fall back to the original function's code if the fast-path fails.

Our current code is not following that guideline. Maybe we should fix it.
An example is the UpdateStoreBuffer stub (e.g. stub_code_arm64.cc:1075), which
calls into the runtime without a pool pointer setup.
Should that stub set it up? Or should EnterCallRuntimeFrame set one up?

If you'd like, I can go ahead and fix all occurrences I find. Let me know.

Thanks

Powered by Google App Engine
This is Rietveld 408576698