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

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

Issue 1994993002: VM background optimization: Fix another use of the original IC data. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 LocationSummary* locs, 1181 LocationSummary* locs,
1182 const ICData& ic_data_in) { 1182 const ICData& ic_data_in) {
1183 ICData& ic_data = ICData::ZoneHandle(ic_data_in.Original()); 1183 ICData& ic_data = ICData::ZoneHandle(ic_data_in.Original());
1184 if (FLAG_precompiled_mode) { 1184 if (FLAG_precompiled_mode) {
1185 ic_data = ic_data.AsUnaryClassChecks(); 1185 ic_data = ic_data.AsUnaryClassChecks();
1186 EmitSwitchableInstanceCall(ic_data, argument_count, 1186 EmitSwitchableInstanceCall(ic_data, argument_count,
1187 deopt_id, token_pos, locs); 1187 deopt_id, token_pos, locs);
1188 return; 1188 return;
1189 } 1189 }
1190 if (FLAG_always_megamorphic_calls) { 1190 if (FLAG_always_megamorphic_calls) {
1191 EmitMegamorphicInstanceCall(ic_data, argument_count, 1191 EmitMegamorphicInstanceCall(ic_data_in, argument_count,
1192 deopt_id, token_pos, locs, 1192 deopt_id, token_pos, locs,
1193 CatchClauseNode::kInvalidTryIndex); 1193 CatchClauseNode::kInvalidTryIndex);
1194 return; 1194 return;
1195 } 1195 }
1196 ASSERT(!ic_data.IsNull()); 1196 ASSERT(!ic_data.IsNull());
1197 if (is_optimizing() && (ic_data_in.NumberOfUsedChecks() == 0)) { 1197 if (is_optimizing() && (ic_data_in.NumberOfUsedChecks() == 0)) {
1198 // Emit IC call that will count and thus may need reoptimization at 1198 // Emit IC call that will count and thus may need reoptimization at
1199 // function entry. 1199 // function entry.
1200 ASSERT(may_reoptimize() || flow_graph().IsCompiledForOsr()); 1200 ASSERT(may_reoptimize() || flow_graph().IsCompiledForOsr());
1201 switch (ic_data.NumArgsTested()) { 1201 switch (ic_data.NumArgsTested()) {
1202 case 1: 1202 case 1:
1203 EmitOptimizedInstanceCall( 1203 EmitOptimizedInstanceCall(
1204 *StubCode::OneArgOptimizedCheckInlineCache_entry(), ic_data, 1204 *StubCode::OneArgOptimizedCheckInlineCache_entry(), ic_data,
1205 argument_count, deopt_id, token_pos, locs); 1205 argument_count, deopt_id, token_pos, locs);
1206 return; 1206 return;
1207 case 2: 1207 case 2:
1208 EmitOptimizedInstanceCall( 1208 EmitOptimizedInstanceCall(
1209 *StubCode::TwoArgsOptimizedCheckInlineCache_entry(), ic_data, 1209 *StubCode::TwoArgsOptimizedCheckInlineCache_entry(), ic_data,
1210 argument_count, deopt_id, token_pos, locs); 1210 argument_count, deopt_id, token_pos, locs);
1211 return; 1211 return;
1212 default: 1212 default:
1213 UNIMPLEMENTED(); 1213 UNIMPLEMENTED();
1214 } 1214 }
1215 return; 1215 return;
1216 } 1216 }
1217 1217
1218 if (is_optimizing()) { 1218 if (is_optimizing()) {
1219 EmitMegamorphicInstanceCall(ic_data, argument_count, 1219 EmitMegamorphicInstanceCall(ic_data_in, argument_count,
1220 deopt_id, token_pos, locs, 1220 deopt_id, token_pos, locs,
1221 CatchClauseNode::kInvalidTryIndex); 1221 CatchClauseNode::kInvalidTryIndex);
1222 return; 1222 return;
1223 } 1223 }
1224 1224
1225 switch (ic_data.NumArgsTested()) { 1225 switch (ic_data.NumArgsTested()) {
1226 case 1: 1226 case 1:
1227 EmitInstanceCall( 1227 EmitInstanceCall(
1228 *StubCode::OneArgCheckInlineCache_entry(), ic_data, argument_count, 1228 *StubCode::OneArgCheckInlineCache_entry(), ic_data, argument_count,
1229 deopt_id, token_pos, locs); 1229 deopt_id, token_pos, locs);
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 1990
1991 1991
1992 void FlowGraphCompiler::FrameStateClear() { 1992 void FlowGraphCompiler::FrameStateClear() {
1993 ASSERT(!is_optimizing()); 1993 ASSERT(!is_optimizing());
1994 frame_state_.TruncateTo(0); 1994 frame_state_.TruncateTo(0);
1995 } 1995 }
1996 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) 1996 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
1997 1997
1998 1998
1999 } // namespace dart 1999 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698