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

Issue 9373025: Optimizing code generator expects that every AST node is traversed once, i.e., the nodes are not ... (Closed)

Created:
8 years, 10 months ago by srdjan
Modified:
8 years, 10 months ago
Reviewers:
hausner
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Optimizing code generator expects that every AST node is traversed once, i.e., the nodes are not reused. Unfortunately this is not the case in assignment operations with arrays (e.g. a[i] += 3). The proper solution would be to clone array and index nodes but that would require too many changes. Long term we can't / won't use AST nodes for optimization purposes. Short term fix is here: load array and index and release their CodeGenInfo before value is traversed so that the value computation can set its own CodeGenInfo on the same node. Committed: https://code.google.com/p/dart/source/detail?r=4121

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -17 lines) Patch
M runtime/vm/opt_code_generator_ia32.cc View 5 chunks +33 lines, -10 lines 2 comments Download
M runtime/vm/parser.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/language-leg.status View 1 chunk +0 lines, -4 lines 0 comments Download
M tests/language/src/AssignOpTest.dart View 1 chunk +8 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
srdjan
8 years, 10 months ago (2012-02-09 13:31:11 UTC) #1
hausner
LGTM. https://chromiumcodereview.appspot.com/9373025/diff/1/runtime/vm/opt_code_generator_ia32.cc File runtime/vm/opt_code_generator_ia32.cc (right): https://chromiumcodereview.appspot.com/9373025/diff/1/runtime/vm/opt_code_generator_ia32.cc#newcode2492 runtime/vm/opt_code_generator_ia32.cc:2492: known_array_class = array_info.is_class()->raw(); Not sure why you call ...
8 years, 10 months ago (2012-02-09 21:51:48 UTC) #2
srdjan
8 years, 10 months ago (2012-02-10 07:13:11 UTC) #3
https://chromiumcodereview.appspot.com/9373025/diff/1/runtime/vm/opt_code_gen...
File runtime/vm/opt_code_generator_ia32.cc (right):

https://chromiumcodereview.appspot.com/9373025/diff/1/runtime/vm/opt_code_gen...
runtime/vm/opt_code_generator_ia32.cc:2492: known_array_class =
array_info.is_class()->raw();
On 2012/02/09 21:51:48, hausner wrote:
> Not sure why you call this the "known" array class. Isn't the known class the
> one that the VM knows about, i.e. object_array_class?

Changing it to class_of_this_array to avoid confusion. That class is computed
using type analysis and can be any of the classes including ObjectArray,
GrowableObjectArray, ImmutableArray or any user class.

Powered by Google App Engine
This is Rietveld 408576698