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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 783683002: Better constant folding of length-loads in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 42103)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1826,7 +1826,8 @@
// For fixed length arrays if the array is the result of a known constructor
// call we can replace the length load with the length argument passed to
// the constructor.
- StaticCallInstr* call = instance()->definition()->AsStaticCall();
+ StaticCallInstr* call =
+ instance()->definition()->OriginalDefinition()->AsStaticCall();
if (call != NULL) {
if (call->is_known_list_constructor() &&
IsFixedLengthArrayCid(call->Type()->ToCid())) {
@@ -1837,7 +1838,8 @@
}
}
- CreateArrayInstr* create_array = instance()->definition()->AsCreateArray();
+ CreateArrayInstr* create_array =
+ instance()->definition()->OriginalDefinition()->AsCreateArray();
if ((create_array != NULL) &&
(recognized_kind() == MethodRecognizer::kObjectArrayLength)) {
return create_array->num_elements()->definition();
@@ -1845,7 +1847,8 @@
// For arrays with guarded lengths, replace the length load
// with a constant.
- LoadFieldInstr* load_array = instance()->definition()->AsLoadField();
+ LoadFieldInstr* load_array =
+ instance()->definition()->OriginalDefinition()->AsLoadField();
if (load_array != NULL) {
const Field* field = load_array->field();
if ((field != NULL) && (field->guarded_list_length() >= 0)) {
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698