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

Issue 11037023: Use movw/movt instead of constant pool on ARMv7 (Closed)

Created:
8 years, 2 months ago by danno
Modified:
8 years, 2 months ago
CC:
v8-dev
Visibility:
Public.

Description

Use movw/movt instead of constant pool on ARMv7. Some ARM architectures load 32-bit immediate constants more efficiently using movw/movt pairs rather than constant pool loads. This patch allows the assembler to generate one or the other load form at runtime depending on what is faster. R=ulan@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=12755

Patch Set 1 #

Patch Set 2 : More bug fixes #

Patch Set 3 : Fix IC target patching #

Patch Set 4 : Fix stuff #

Patch Set 5 : latest changes #

Patch Set 6 : Fix test cases #

Patch Set 7 : Fix latest crashers #

Patch Set 8 : Fix tests #

Patch Set 9 : x64 support #

Patch Set 10 : x64 support #

Patch Set 11 : More fixes and nit fixes #

Total comments: 40

Patch Set 12 : Don't use movw/movt for patchable target addresses #

Total comments: 1

Patch Set 13 : Latest #

Patch Set 14 : Merge with latest #

Patch Set 15 : More bug fixing #

Patch Set 16 : Add command-line flag #

Patch Set 17 : bits #

Patch Set 18 : Fix implementer detection #

Patch Set 19 : Set flag properly #

Total comments: 6

Patch Set 20 : Review feedback #

Patch Set 21 : Fix nits #

Patch Set 22 : Fix nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+431 lines, -138 lines) Patch
M src/arm/assembler-arm.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 9 chunks +62 lines, -20 lines 0 comments Download
M src/arm/assembler-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 13 chunks +100 lines, -45 lines 0 comments Download
M src/arm/assembler-arm-inl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +118 lines, -18 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -1 line 0 comments Download
M src/arm/debug-arm.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +6 lines, -1 line 0 comments Download
M src/arm/ic-arm.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/arm/lithium-codegen-arm.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -8 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 12 chunks +19 lines, -12 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -2 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 7 chunks +29 lines, -17 lines 0 comments Download
M src/assembler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -5 lines 0 comments Download
M src/debug.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32-inl.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M src/ic.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/ic-inl.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/mark-compact.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -1 line 0 comments Download
M src/platform.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -0 lines 0 comments Download
M src/platform-linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +18 lines, -0 lines 0 comments Download
M src/platform-nullos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -1 line 0 comments Download
M src/v8globals.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +8 lines, -0 lines 0 comments Download
M src/x64/assembler-x64.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -0 lines 0 comments Download
M src/x64/assembler-x64-inl.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
danno
PTAL
8 years, 2 months ago (2012-10-10 12:25:25 UTC) #1
Please use jfb - chromium.org
http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm-inl.h File src/arm/assembler-arm-inl.h (right): http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm-inl.h#newcode367 src/arm/assembler-arm-inl.h:367: ASSERT(IsMovT(Memory::int32_at(pc + 4))); + kInstrSize http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm-inl.h#newcode369 src/arm/assembler-arm-inl.h:369: Instruction* next_instr ...
8 years, 2 months ago (2012-10-10 13:56:52 UTC) #2
Michael Starzinger
http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm.cc File src/arm/assembler-arm.cc (right): http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm.cc#newcode819 src/arm/assembler-arm.cc:819: return true; Indentation is off. http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm.h File src/arm/assembler-arm.h (right): ...
8 years, 2 months ago (2012-10-10 14:19:29 UTC) #3
Michael Starzinger
http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm.cc File src/arm/assembler-arm.cc (right): http://codereview.chromium.org/11037023/diff/25001/src/arm/assembler-arm.cc#newcode844 src/arm/assembler-arm.cc:844: RecordRelocInfo(x.rmode_, x.imm32_, DONT_USE_CONSTANT_POOL); On 2012/10/10 13:56:52, jfb wrote: > ...
8 years, 2 months ago (2012-10-10 14:34:28 UTC) #4
JF
> I am not sure about this. We also have RelocInfos for embedded object pointers. ...
8 years, 2 months ago (2012-10-10 14:47:26 UTC) #5
Michael Starzinger
On 2012/10/10 14:47:26, JF wrote: > > I am not sure about this. We also ...
8 years, 2 months ago (2012-10-10 15:15:50 UTC) #6
bulach
hey daniel, just to register some of our chats.. :) https://chromiumcodereview.appspot.com/11037023/diff/20017/src/arm/macro-assembler-arm.cc File src/arm/macro-assembler-arm.cc (right): https://chromiumcodereview.appspot.com/11037023/diff/20017/src/arm/macro-assembler-arm.cc#newcode177 ...
8 years, 2 months ago (2012-10-11 17:23:08 UTC) #7
danno
Addressed comments and added runtime support for recognizing target platforms where movw/movt is a win. ...
8 years, 2 months ago (2012-10-17 10:04:44 UTC) #8
JF
Looks good from my limited knowledge of V8.
8 years, 2 months ago (2012-10-17 16:37:58 UTC) #9
ulan
LGTM with comments. https://chromiumcodereview.appspot.com/11037023/diff/39023/src/arm/assembler-arm.cc File src/arm/assembler-arm.cc (right): https://chromiumcodereview.appspot.com/11037023/diff/39023/src/arm/assembler-arm.cc#newcode843 src/arm/assembler-arm.cc:843: return true; Why don't we check ...
8 years, 2 months ago (2012-10-18 09:07:53 UTC) #10
danno
8 years, 2 months ago (2012-10-18 12:22:10 UTC) #11
Addressed comments, landing.

https://codereview.chromium.org/11037023/diff/39023/src/arm/assembler-arm.cc
File src/arm/assembler-arm.cc (right):

https://codereview.chromium.org/11037023/diff/39023/src/arm/assembler-arm.cc#...
src/arm/assembler-arm.cc:843: return true;
It's not possible to use immediate loads to the pc to do a call, so loading the
destination address without USE_BLX is always a single instruction of the form
ldr pc, [pc + #xxx].On 2012/10/18 09:07:53, ulan wrote:
> Why don't we check for !CpuFeatures::IsSupported(ARMv7) in this case?

https://codereview.chromium.org/11037023/diff/39023/src/arm/assembler-arm.h
File src/arm/assembler-arm.h (right):

https://codereview.chromium.org/11037023/diff/39023/src/arm/assembler-arm.h#n...
src/arm/assembler-arm.h:757: static const int kPatchDebugBreakSlotReturnOffset =
2 * kInstrSize;
On 2012/10/18 09:07:53, ulan wrote:
> Is the offset correct when we don't use BLX?

Done.

https://codereview.chromium.org/11037023/diff/39023/src/v8globals.h
File src/v8globals.h (right):

https://codereview.chromium.org/11037023/diff/39023/src/v8globals.h#newcode429
src/v8globals.h:429: UnknownImplementer,
On 2012/10/18 09:07:53, ulan wrote:
> Nit: names of constants are usually all upper case or prefixed with 'k'.

Done.

Powered by Google App Engine
This is Rietveld 408576698