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

Issue 10933045: Add immediate operand support for indexed operations. (Closed)

Created:
8 years, 3 months ago by Florian Schneider
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add immediate operand support for indexed operations. The value and/or the index of indexed loads/stores can be emitted as immediate operands to reduce the number of registers needed when constants are used. Committed: https://code.google.com/p/dart/source/detail?r=12265

Patch Set 1 #

Total comments: 12

Patch Set 2 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -37 lines) Patch
M runtime/vm/assembler_x64.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 chunks +51 lines, -19 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 chunks +53 lines, -18 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
8 years, 3 months ago (2012-09-12 12:36:45 UTC) #1
Vyacheslav Egorov (Google)
lgtm https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediate_language_ia32.cc File runtime/vm/intermediate_language_ia32.cc (right): https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediate_language_ia32.cc#newcode867 runtime/vm/intermediate_language_ia32.cc:867: static bool CanBeIndexImmediate(Value* index) { CanBeImmediateIndex? https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediate_language_ia32.cc#newcode890 runtime/vm/intermediate_language_ia32.cc:890: ...
8 years, 3 months ago (2012-09-12 12:55:06 UTC) #2
srdjan
DBC https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediate_language_ia32.cc File runtime/vm/intermediate_language_ia32.cc (right): https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediate_language_ia32.cc#newcode890 runtime/vm/intermediate_language_ia32.cc:890: static int32_t RawSmi(const Object& constant) { RawSmi is ...
8 years, 3 months ago (2012-09-12 12:56:16 UTC) #3
Florian Schneider
8 years, 3 months ago (2012-09-12 13:28:35 UTC) #4
https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language_ia32.cc (right):

https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_ia32.cc:867: static bool
CanBeIndexImmediate(Value* index) {
On 2012/09/12 12:55:06, Vyacheslav Egorov (Google) wrote:
> CanBeImmediateIndex?

Done.

https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_ia32.cc:890: static int32_t RawSmi(const
Object& constant) {
On 2012/09/12 12:56:16, srdjan wrote:
> RawSmi is the name of the raw smi object. I would rename it. Why not use
> Smi::RawValue(Smi::Cast(constant) instead?

Removed and replaced with Smi::Cast(...) instead.

https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_ia32.cc:906: int32_t disp =
RawSmi(locs()->in(1).constant()) * 2 + sizeof(RawArray);
On 2012/09/12 12:55:06, Vyacheslav Egorov (Google) wrote:
> How about just Smi::Cast(locs()->in(1).constant()).Value() * kWordSize here?
> (just like in CanBeIndexImm...)
> 
> also const uint32_t disp
> 
> the same on x64

Done. Using Smi::Value() * kWordSize.

https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_ia32.cc:935: RawSmi(locs()->in(1).constant()) *
2 + sizeof(RawArray))
On 2012/09/12 12:55:06, Vyacheslav Egorov (Google) wrote:
> see above.

Done.

https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language_x64.cc (right):

https://chromiumcodereview.appspot.com/10933045/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_x64.cc:886: const Smi& smi_const =
Smi::Cast(constant);
On 2012/09/12 12:56:16, srdjan wrote:
> The reason why this works is because this code must have been run before
> successfully, therefore the constant must be Smi. Correct?

Yes, and when optimizing we generate a smi-check for the index (which is
eliminated if the constant is indeed a smi).

Powered by Google App Engine
This is Rietveld 408576698