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

Issue 1128009: Replace the constant pool access ldr instructions with movw/movt, and remove ... (Closed)

Created:
10 years, 9 months ago by zhangk
Modified:
7 years, 5 months ago
CC:
v8-dev, subratokde, Dineel
Visibility:
Public.

Description

Replace the constant pool access ldr instructions with movw/movt, and remove the corresponding constant pool entries. BUG=none TEST=none

Patch Set 1 #

Total comments: 58

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 17
Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -56 lines) Patch
M AUTHORS View 1 2 2 chunks +1 line, -1 line 0 comments Download
M src/arm/assembler-arm.h View 1 2 5 chunks +16 lines, -4 lines 2 comments Download
M src/arm/assembler-arm.cc View 1 2 3 8 chunks +74 lines, -21 lines 6 comments Download
M src/arm/assembler-arm-inl.h View 1 2 5 chunks +68 lines, -16 lines 7 comments Download
M src/arm/constants-arm.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/arm/cpu-arm.cc View 3 chunks +8 lines, -2 lines 0 comments Download
M src/arm/disasm-arm.cc View 1 5 chunks +25 lines, -2 lines 1 comment Download
M src/arm/macro-assembler-arm.cc View 1 chunk +1 line, -1 line 1 comment Download
M src/arm/simulator-arm.h View 4 chunks +12 lines, -1 line 0 comments Download
M src/arm/simulator-arm.cc View 1 2 7 chunks +128 lines, -4 lines 0 comments Download
M src/assembler.h View 1 chunk +4 lines, -2 lines 0 comments Download
M src/objects.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/serialize.cc View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
zhangk
In this upload, the constant pool related load instructions are replaced with movw/movt, and the ...
10 years, 9 months ago (2010-03-19 22:12:52 UTC) #1
Erik Corry
As mentioned in email our measurements indicate that inline cache calls are updated very frequently ...
10 years, 9 months ago (2010-03-22 11:50:09 UTC) #2
zhangk
Hi Erik, Thank you for the reviews. We merged the changes with the newer bleeding ...
10 years, 8 months ago (2010-04-05 23:42:15 UTC) #3
zhangk
Hi Erik, Thank you for clarifying the facts. I merged your simulator I-cache flush code. ...
10 years, 8 months ago (2010-04-20 23:42:44 UTC) #4
Erik Corry
On 2010/04/20 23:42:44, zhangk wrote: > Hi Erik, > > Thank you for clarifying the ...
10 years, 8 months ago (2010-04-26 11:03:49 UTC) #5
zhangk
All tests pass except the serialization/deserialization tests. Thanks, -Kun
10 years, 8 months ago (2010-04-26 21:27:55 UTC) #6
zhangk
Hi Erik, The serialization/de-serialization handshake protocol has to be changed with constant pool optimization. I'm ...
10 years, 8 months ago (2010-04-26 23:56:27 UTC) #7
Erik Corry
10 years, 7 months ago (2010-05-03 10:06:27 UTC) #8
The change needs to be brought up to date so that it is relative to the bleeding
edge.  Due to limitations in the codereview tool this probably means creating a
new issue on codereview.chromium.org.

http://codereview.chromium.org/1128009/diff/46001/47003
File src/arm/assembler-arm-inl.h (right):

http://codereview.chromium.org/1128009/diff/46001/47003#newcode97
src/arm/assembler-arm-inl.h:97: uint32_t offset = ((instr & 0xf0000) >> 4) |
(instr & 0xfff);
The name 'offset' seems wrong here.  It's the immediate from the movw-movt
instruction.  The word 'offset' makes it sound like it is relative to something.

http://codereview.chromium.org/1128009/diff/46001/47003#newcode110
src/arm/assembler-arm-inl.h:110: return
reinterpret_cast<Object**>(get_movw_movt_address(pc_));
This seems wrong.  This function is expected to return a Handle, which is
implemented internally as a pointer to a pointer to an object.  This line takes
a pointer to and object and casts it to add the extra indirection.  Incidentally
this line makes use of the implicit Handle constructor that takes an Object**. 
I have made that constructor explicit since it violated our style guide.

I think the correct change is to have this function return an Object* instead of
a Handle<Object>.  It seems like the only place we use this (objects.cc) we
immediately get the Object* out of the Handle anyway.

http://codereview.chromium.org/1128009/diff/46001/47003#newcode123
src/arm/assembler-arm-inl.h:123: Assembler::set_target_address_at(pc_,
reinterpret_cast<Address>(target),
If all arguments don't fit on one line it is neater to give them one line each
so that it visually looks like 3 arguments and not two.

http://codereview.chromium.org/1128009/diff/46001/47003#newcode298
src/arm/assembler-arm-inl.h:298: void Assembler::set_target_address_at(Address
pc, Address target,
Please put arguments either on one line or on a line each.

http://codereview.chromium.org/1128009/diff/46001/47003#newcode307
src/arm/assembler-arm-inl.h:307: *new_pc = (*new_pc & 0xfff0f000) | ((new_addr &
0xf000) << 4) |
Please give this constant, 0xfff0ff000, a name and use it throughout.

Also, there is a function that returns ((x & 0xf000) << 4) | (x & 0xfff). 
Please use it throughout.

http://codereview.chromium.org/1128009/diff/46001/47003#newcode319
src/arm/assembler-arm-inl.h:319: if (need_icache_flush)
Please use braces on multiline if statements.  This isn't a Google style guide
requirement, but we try to stick to it on V8.

http://codereview.chromium.org/1128009/diff/46001/47003#newcode320
src/arm/assembler-arm-inl.h:320: CPU::FlushICache(pc, sizeof(target));
sizeof(target) looks wrong here.  With the loop above, the size to be flushed is
not a constant.

http://codereview.chromium.org/1128009/diff/46001/47004
File src/arm/assembler-arm.cc (right):

http://codereview.chromium.org/1128009/diff/46001/47004#newcode590
src/arm/assembler-arm.cc:590: movt(rd, x, cond);
In the case of the relocinfo being "None" we don't need to emit the movt unless
it is non-zero.  The RelocInfo class in assembler.h seems to be missing an
IsNone() method, but it is easy to add.

http://codereview.chromium.org/1128009/diff/46001/47004#newcode602
src/arm/assembler-arm.cc:602: ldr(ip, MemOperand(pc, 0), cond);
This code, that handles instructions other than mov, is missing in the movw_movt
branch of this instruction.  If you add it back then perhaps you don't need the
use_movw_movt argument any more?

http://codereview.chromium.org/1128009/diff/46001/47004#newcode1954
src/arm/assembler-arm.cc:1954: int block_for_prinfo =  num_prinfo_*kInstrSize;
There should be spaces around '*'.

http://codereview.chromium.org/1128009/diff/46001/47004#newcode1961
src/arm/assembler-arm.cc:1961: if (((instr & (7*B25 | P | U | B | W | 15*B16 |
Off12Mask)) !=
It must be possible to rewrite this with a named mask and a named value.

http://codereview.chromium.org/1128009/diff/46001/47004#newcode1991
src/arm/assembler-arm.cc:1991: if (((instr & (7*B25 | P | U | B | W | 15*B16 |
Off12Mask)) !=
And this.

http://codereview.chromium.org/1128009/diff/46001/47004#newcode1993
src/arm/assembler-arm.cc:1993: continue;
Use braces on multi-line ifs.

http://codereview.chromium.org/1128009/diff/46001/47002
File src/arm/assembler-arm.h (right):

http://codereview.chromium.org/1128009/diff/46001/47002#newcode715
src/arm/assembler-arm.h:715: SBit s = LeaveCC, Condition cond = al, bool
use_movw_movt = true);
Having bool arguments makes the code unreadable at the call site.  We prefer
enums like SBit.

http://codereview.chromium.org/1128009/diff/46001/47002#newcode1085
src/arm/assembler-arm.h:1085: bool with_const_pool = true);
Also here the bool argument makes code unreadble and should be replaced with an
enum.

http://codereview.chromium.org/1128009/diff/46001/47007
File src/arm/disasm-arm.cc (right):

http://codereview.chromium.org/1128009/diff/46001/47007#newcode386
src/arm/disasm-arm.cc:386: ", #%d0000", imm);
This line has wrong alignment.

http://codereview.chromium.org/1128009/diff/46001/47008
File src/arm/macro-assembler-arm.cc (right):

http://codereview.chromium.org/1128009/diff/46001/47008#newcode130
src/arm/macro-assembler-arm.cc:130: mov(ip, Operand(target, rmode), LeaveCC,
cond, false);
There should be a comment here to explain why we don't want to use movw and
movt.

Powered by Google App Engine
This is Rietveld 408576698