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

Issue 10382234: Introduce locations based code generation. (Closed)

Created:
8 years, 7 months ago by Vyacheslav Egorov (Google)
Modified:
8 years, 7 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Introduce locations based code generation. Instructions and computations switched to the new code generation scheme should implement two virtual functions: - locs() should return pointer to a LocationSummary object, that specifies location constraints for the instruction/computation. - EmitNativeCode() should emit instructions/computations native code using locations provided through LocationSummary object attached to the instruction. For converted functions instruction pattern should be removed from the FlowGraphCompiler visitor. It will not be used as long as instruction/computation returns non-NULL from locs(). Committed: https://code.google.com/p/dart/source/detail?r=7818

Patch Set 1 #

Total comments: 39

Patch Set 2 : addressed Srdjan comments #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+402 lines, -17 lines) Patch
M runtime/vm/flow_graph_compiler_x64.h View 1 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 5 chunks +30 lines, -17 lines 4 comments Download
M runtime/vm/intermediate_language.h View 1 10 chunks +66 lines, -0 lines 1 comment Download
A runtime/vm/intermediate_language_x64.cc View 1 1 chunk +66 lines, -0 lines 0 comments Download
A runtime/vm/locations.h View 1 1 chunk +162 lines, -0 lines 10 comments Download
A runtime/vm/locations.cc View 1 1 chunk +70 lines, -0 lines 7 comments Download
M runtime/vm/vm_sources.gypi View 1 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Vyacheslav Egorov (Google)
Srdjan & Florian, I have been experimenting with various ways we can use to gradually ...
8 years, 7 months ago (2012-05-18 03:34:27 UTC) #1
Florian Schneider
I like the overall approach. The LocationSummary is fine as a temporary vehicle. Maybe add ...
8 years, 7 months ago (2012-05-18 17:40:43 UTC) #2
srdjan
I think this is the right direction. Here are a bunch of comments and ideas, ...
8 years, 7 months ago (2012-05-18 18:00:14 UTC) #3
Vyacheslav Egorov (Google)
Hi Srdjan, I tried to address your comments. Please take another look [I also left ...
8 years, 7 months ago (2012-05-20 12:07:46 UTC) #4
srdjan
LGTM with comments http://codereview.chromium.org/10382234/diff/1/runtime/vm/flow_graph_compiler_x64.cc File runtime/vm/flow_graph_compiler_x64.cc (right): http://codereview.chromium.org/10382234/diff/1/runtime/vm/flow_graph_compiler_x64.cc#newcode554 runtime/vm/flow_graph_compiler_x64.cc:554: LocationSummary* StrictCompareComp::MakeLocationSummary() { On 2012/05/20 12:07:46, ...
8 years, 7 months ago (2012-05-21 16:05:22 UTC) #5
Florian Schneider
LGTM. https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/locations.cc File runtime/vm/locations.cc (right): https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/locations.cc#newcode15 runtime/vm/locations.cc:15: if (!blocked_registers->At(regno)) { (*blocked_registers)[regno] should also work here. ...
8 years, 7 months ago (2012-05-21 18:33:38 UTC) #6
srdjan
https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/locations.cc File runtime/vm/locations.cc (right): https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/locations.cc#newcode15 runtime/vm/locations.cc:15: if (!blocked_registers->At(regno)) { On 2012/05/21 18:33:38, Florian Schneider wrote: ...
8 years, 7 months ago (2012-05-21 19:49:43 UTC) #7
Vyacheslav Egorov (Google)
8 years, 7 months ago (2012-05-21 19:53:46 UTC) #8
Resolved comments. Landed. 

Now we can proceed with instruction convertion.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/flow_gra...
File runtime/vm/flow_graph_compiler_x64.cc (right):

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/flow_gra...
runtime/vm/flow_graph_compiler_x64.cc:551: UNREACHABLE();
On 2012/05/21 16:05:22, srdjan wrote:
> Why is that (add comment)? Wait, this is part of the new code emission
> structure?

Yes, native template were moved. I added a comment.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/flow_gra...
runtime/vm/flow_graph_compiler_x64.cc:1123: }
On 2012/05/21 16:05:22, srdjan wrote:
> else? UNIMPLEMENTED? check location is stack OK?

Added assert.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
File runtime/vm/locations.cc (right):

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.cc:14: for (int regno = 0; regno < kNumberOfCpuRegisters;
regno++) {
On 2012/05/21 16:05:22, srdjan wrote:
> intptr_t

Done.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.cc:15: if (!blocked_registers->At(regno)) {
On 2012/05/21 18:33:38, Florian Schneider wrote:
> (*blocked_registers)[regno] should also work here.

I'll go with a method, it looks nicer.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.cc:16: blocked_registers->SetAt(regno, true);
On 2012/05/21 18:33:38, Florian Schneider wrote:
> (*blocked_registers)[regno] = true;
> 
> should also work here.

I'll go with a method, it looks nicer.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/locations.h
File runtime/vm/locations.h (right):

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.h:23: // register number).
On 2012/05/21 16:05:22, srdjan wrote:
> What is register number? CPU register-number, for now, I guess.

changed to register code and added reference to Register enum

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.h:52: uword value_;
On 2012/05/21 18:33:38, Florian Schneider wrote:
> I think Location should be the same size on all platforms. Maybe use uint64_t
> instead?

Added a TODO, we will select size once we know the encoding (and how big
bitfields are better be).

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.h:52: uword value_;
On 2012/05/21 19:49:43, srdjan wrote:
> On 2012/05/21 18:33:38, Florian Schneider wrote:
> > I think Location should be the same size on all platforms. Maybe use
uint64_t
> > instead?
> 
> What is the advantage of having them the same size on all platforms? 
> The advantage of using uword is that it makes it much more efficient to pass
> around on 32-bit architectures.

Fixed size is less error prone (it is easier to reason individual size of
bit-fields that constitute uword). For now I left it uword and added
TODO-comment that we can resolve later.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.h:70: Policy policy() { return
PolicyField::decode(payload()); }
On 2012/05/21 16:05:22, srdjan wrote:
> const?

Done.

https://chromiumcodereview.appspot.com/10382234/diff/2002/runtime/vm/location...
runtime/vm/locations.h:150: ZoneGrowableArray<Location> input_locations_;
On 2012/05/21 16:05:22, srdjan wrote:
> This is a value object -> GrowableArray  instead of ZoneGrowableArray.

Done.

Powered by Google App Engine
This is Rietveld 408576698