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

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 10867086: Implement array bounds checks explicitly in the optimized IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed CanDeoptimize() Created 8 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. 66 // TODO(fschneider): Make sure ic_data are sorted to hit more cases.
67 if (ic_data()->GetReceiverClassIdAt(i) != 67 if (ic_data()->GetReceiverClassIdAt(i) !=
68 other->ic_data()->GetReceiverClassIdAt(i)) { 68 other->ic_data()->GetReceiverClassIdAt(i)) {
69 return false; 69 return false;
70 } 70 }
71 } 71 }
72 return true; 72 return true;
73 } 73 }
74 74
75 75
76 bool CheckArrayBoundComp::AttributesEqual(Computation* other) const {
77 CheckArrayBoundComp* other_check = other->AsCheckArrayBound();
78 if (other_check == NULL) return false;
79 return array_type() == other_check->array_type();
80 }
81
82
76 // Returns true if the value represents a constant. 83 // Returns true if the value represents a constant.
77 bool UseVal::BindsToConstant() const { 84 bool UseVal::BindsToConstant() const {
78 BindInstr* bind = definition()->AsBind(); 85 BindInstr* bind = definition()->AsBind();
79 if (bind == NULL) { 86 if (bind == NULL) {
80 return false; 87 return false;
81 } 88 }
82 return bind->computation()->AsMaterialize() != NULL; 89 return bind->computation()->AsMaterialize() != NULL;
83 } 90 }
84 91
85 92
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 RawAbstractType* CheckClassComp::CompileType() const { 1096 RawAbstractType* CheckClassComp::CompileType() const {
1090 return AbstractType::null(); 1097 return AbstractType::null();
1091 } 1098 }
1092 1099
1093 1100
1094 RawAbstractType* CheckSmiComp::CompileType() const { 1101 RawAbstractType* CheckSmiComp::CompileType() const {
1095 return AbstractType::null(); 1102 return AbstractType::null();
1096 } 1103 }
1097 1104
1098 1105
1106 RawAbstractType* CheckArrayBoundComp::CompileType() const {
1107 return AbstractType::null();
1108 }
1109
1110
1099 RawAbstractType* CheckEitherNonSmiComp::CompileType() const { 1111 RawAbstractType* CheckEitherNonSmiComp::CompileType() const {
1100 return AbstractType::null(); 1112 return AbstractType::null();
1101 } 1113 }
1102 1114
1103 1115
1104 // Optimizations that eliminate or simplify individual computations. 1116 // Optimizations that eliminate or simplify individual computations.
1105 Definition* Computation::TryReplace(BindInstr* instr) const { 1117 Definition* Computation::TryReplace(BindInstr* instr) const {
1106 return instr; 1118 return instr;
1107 } 1119 }
1108 1120
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 use->AddToEnvUseList(); 1569 use->AddToEnvUseList();
1558 } 1570 }
1559 } 1571 }
1560 instr->set_env(copy); 1572 instr->set_env(copy);
1561 } 1573 }
1562 1574
1563 1575
1564 #undef __ 1576 #undef __
1565 1577
1566 } // namespace dart 1578 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698