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

Issue 10831179: Allocate the environment's location backing store during register allocation. (Closed)

Created:
8 years, 4 months ago by Kevin Millikin (Google)
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Allocate the environment's location backing store during register allocation. The code relies on the addresses of elements in this backing store. It was correct but difficult to guarantee when it was a growable array's backing store. R=vegorov@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=10290

Patch Set 1 #

Total comments: 1

Patch Set 2 : Store location count to enable bounds checking assertions. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -13 lines) Patch
M runtime/vm/flow_graph_allocator.cc View 1 chunk +5 lines, -4 lines 1 comment Download
M runtime/vm/il_printer.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language.h View 1 3 chunks +13 lines, -8 lines 4 comments Download

Messages

Total messages: 3 (0 generated)
Kevin Millikin (Google)
http://codereview.chromium.org/10831179/diff/1/runtime/vm/intermediate_language.h File runtime/vm/intermediate_language.h (right): http://codereview.chromium.org/10831179/diff/1/runtime/vm/intermediate_language.h#newcode2699 runtime/vm/intermediate_language.h:2699: return locations_[ix]; It's not bulletproof, but I think I'll ...
8 years, 4 months ago (2012-08-06 14:59:18 UTC) #1
Vyacheslav Egorov (Google)
lgtm
8 years, 4 months ago (2012-08-06 15:06:49 UTC) #2
srdjan
8 years, 4 months ago (2012-08-06 22:49:25 UTC) #3
DBC

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/flow_graph_alloc...
File runtime/vm/flow_graph_allocator.cc (right):

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:665: env->InitializeLocations();
I would move the loop below into InitializeLocation. Since InitializeLocations
only allocates locations, initialization is occurring below.

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/intermediate_lan...
File runtime/vm/intermediate_language.h (right):

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/intermediate_lan...
runtime/vm/intermediate_language.h:2695: location_count_ = values_.length();
ASSERT(locations_ == NULL), guaranteeing that we do not reallocate locations_ as
we use pointers into it (add that as comment as well).

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/intermediate_lan...
runtime/vm/intermediate_language.h:2698:
Isolate::Current()->current_zone()->Alloc<Location>(location_count_);
Please initialize locations_ with default Location values.

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/intermediate_lan...
runtime/vm/intermediate_language.h:2703: ASSERT((ix >= 0) && (ix <
location_count_));
ASSERT(locations_ != NULL) .

http://codereview.chromium.org/10831179/diff/4001/runtime/vm/intermediate_lan...
runtime/vm/intermediate_language.h:2708: ASSERT((ix >= 0) && (ix <
location_count_));
ditto

Powered by Google App Engine
This is Rietveld 408576698