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

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

Issue 23757016: Simplify compilation of relational operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { 121 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
122 Instruction* current = it.Current(); 122 Instruction* current = it.Current();
123 if (current->IsBranch()) { 123 if (current->IsBranch()) {
124 current = current->AsBranch()->comparison(); 124 current = current->AsBranch()->comparison();
125 } 125 }
126 // In optimized code, ICData is always set in the instructions. 126 // In optimized code, ICData is always set in the instructions.
127 const ICData* ic_data = NULL; 127 const ICData* ic_data = NULL;
128 if (current->IsInstanceCall()) { 128 if (current->IsInstanceCall()) {
129 ic_data = current->AsInstanceCall()->ic_data(); 129 ic_data = current->AsInstanceCall()->ic_data();
130 ASSERT(ic_data != NULL); 130 ASSERT(ic_data != NULL);
131 } else if (current->IsRelationalOp()) {
132 ic_data = current->AsRelationalOp()->ic_data();
133 ASSERT(ic_data != NULL);
134 } else if (current->IsEqualityCompare()) { 131 } else if (current->IsEqualityCompare()) {
135 ic_data = current->AsEqualityCompare()->ic_data(); 132 ic_data = current->AsEqualityCompare()->ic_data();
136 ASSERT(ic_data != NULL); 133 ASSERT(ic_data != NULL);
137 } 134 }
138 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) { 135 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) {
139 may_reoptimize_ = true; 136 may_reoptimize_ = true;
140 } 137 }
141 if (is_leaf && !current->IsCheckStackOverflow()) { 138 if (is_leaf && !current->IsCheckStackOverflow()) {
142 // Note that we do not care if the code contains instructions that 139 // Note that we do not care if the code contains instructions that
143 // can deoptimize. 140 // can deoptimize.
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1142
1146 for (int i = 0; i < len; i++) { 1143 for (int i = 0; i < len; i++) {
1147 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1144 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1148 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1145 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1149 ic_data.GetCountAt(i))); 1146 ic_data.GetCountAt(i)));
1150 } 1147 }
1151 sorted->Sort(HighestCountFirst); 1148 sorted->Sort(HighestCountFirst);
1152 } 1149 }
1153 1150
1154 } // namespace dart 1151 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698