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

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

Issue 27307005: Change == into an instance call to allow polymorphic inlining of ==. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
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->IsEqualityCompare()) {
132 ic_data = current->AsEqualityCompare()->ic_data();
133 ASSERT(ic_data != NULL);
134 } 131 }
135 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) { 132 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) {
136 may_reoptimize_ = true; 133 may_reoptimize_ = true;
137 } 134 }
138 if (is_leaf && !current->IsCheckStackOverflow()) { 135 if (is_leaf && !current->IsCheckStackOverflow()) {
139 // Note that we do not care if the code contains instructions that 136 // Note that we do not care if the code contains instructions that
140 // can deoptimize. 137 // can deoptimize.
141 LocationSummary* locs = current->locs(); 138 LocationSummary* locs = current->locs();
142 if ((locs != NULL) && locs->can_call()) { 139 if ((locs != NULL) && locs->can_call()) {
143 is_leaf = false; 140 is_leaf = false;
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 1202
1206 for (int i = 0; i < len; i++) { 1203 for (int i = 0; i < len; i++) {
1207 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1204 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1208 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1205 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1209 ic_data.GetCountAt(i))); 1206 ic_data.GetCountAt(i)));
1210 } 1207 }
1211 sorted->Sort(HighestCountFirst); 1208 sorted->Sort(HighestCountFirst);
1212 } 1209 }
1213 1210
1214 } // namespace dart 1211 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698