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

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

Issue 261693002: Fix TryICData to create ICData with a valid arguments decriptor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_arm64.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) 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 } 1180 }
1181 1181
1182 1182
1183 void FlowGraphCompiler::EmitOptimizedInstanceCall( 1183 void FlowGraphCompiler::EmitOptimizedInstanceCall(
1184 ExternalLabel* target_label, 1184 ExternalLabel* target_label,
1185 const ICData& ic_data, 1185 const ICData& ic_data,
1186 intptr_t argument_count, 1186 intptr_t argument_count,
1187 intptr_t deopt_id, 1187 intptr_t deopt_id,
1188 intptr_t token_pos, 1188 intptr_t token_pos,
1189 LocationSummary* locs) { 1189 LocationSummary* locs) {
1190 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0);
1190 // Each ICData propagated from unoptimized to optimized code contains the 1191 // Each ICData propagated from unoptimized to optimized code contains the
1191 // function that corresponds to the Dart function of that IC call. Due 1192 // function that corresponds to the Dart function of that IC call. Due
1192 // to inlining in optimized code, that function may not correspond to the 1193 // to inlining in optimized code, that function may not correspond to the
1193 // top-level function (parsed_function().function()) which could be 1194 // top-level function (parsed_function().function()) which could be
1194 // reoptimized and which counter needs to be incremented. 1195 // reoptimized and which counter needs to be incremented.
1195 // Pass the function explicitly, it is used in IC stub. 1196 // Pass the function explicitly, it is used in IC stub.
1196 1197
1197 __ LoadObject(R6, parsed_function().function()); 1198 __ LoadObject(R6, parsed_function().function());
1198 __ LoadObject(R5, ic_data); 1199 __ LoadObject(R5, ic_data);
1199 GenerateDartCall(deopt_id, 1200 GenerateDartCall(deopt_id,
1200 token_pos, 1201 token_pos,
1201 target_label, 1202 target_label,
1202 PcDescriptors::kIcCall, 1203 PcDescriptors::kIcCall,
1203 locs); 1204 locs);
1204 __ Drop(argument_count); 1205 __ Drop(argument_count);
1205 } 1206 }
1206 1207
1207 1208
1208 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, 1209 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
1209 const ICData& ic_data, 1210 const ICData& ic_data,
1210 intptr_t argument_count, 1211 intptr_t argument_count,
1211 intptr_t deopt_id, 1212 intptr_t deopt_id,
1212 intptr_t token_pos, 1213 intptr_t token_pos,
1213 LocationSummary* locs) { 1214 LocationSummary* locs) {
1215 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0);
1214 __ LoadObject(R5, ic_data); 1216 __ LoadObject(R5, ic_data);
1215 GenerateDartCall(deopt_id, 1217 GenerateDartCall(deopt_id,
1216 token_pos, 1218 token_pos,
1217 target_label, 1219 target_label,
1218 PcDescriptors::kIcCall, 1220 PcDescriptors::kIcCall,
1219 locs); 1221 locs);
1220 __ Drop(argument_count); 1222 __ Drop(argument_count);
1221 } 1223 }
1222 1224
1223 1225
1224 void FlowGraphCompiler::EmitMegamorphicInstanceCall( 1226 void FlowGraphCompiler::EmitMegamorphicInstanceCall(
1225 const ICData& ic_data, 1227 const ICData& ic_data,
1226 intptr_t argument_count, 1228 intptr_t argument_count,
1227 intptr_t deopt_id, 1229 intptr_t deopt_id,
1228 intptr_t token_pos, 1230 intptr_t token_pos,
1229 LocationSummary* locs) { 1231 LocationSummary* locs) {
1230 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); 1232 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
1231 const String& name = String::Handle(ic_data.target_name()); 1233 const String& name = String::Handle(ic_data.target_name());
1232 const Array& arguments_descriptor = 1234 const Array& arguments_descriptor =
1233 Array::ZoneHandle(ic_data.arguments_descriptor()); 1235 Array::ZoneHandle(ic_data.arguments_descriptor());
1234 ASSERT(!arguments_descriptor.IsNull()); 1236 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1235 const MegamorphicCache& cache = 1237 const MegamorphicCache& cache =
1236 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor)); 1238 MegamorphicCache::ZoneHandle(table->Lookup(name, arguments_descriptor));
1237 Label not_smi, load_cache; 1239 Label not_smi, load_cache;
1238 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); 1240 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize);
1239 __ tst(R0, ShifterOperand(kSmiTagMask)); 1241 __ tst(R0, ShifterOperand(kSmiTagMask));
1240 __ b(&not_smi, NE); 1242 __ b(&not_smi, NE);
1241 __ mov(R0, ShifterOperand(Smi::RawValue(kSmiCid))); 1243 __ mov(R0, ShifterOperand(Smi::RawValue(kSmiCid)));
1242 __ b(&load_cache); 1244 __ b(&load_cache);
1243 1245
1244 __ Bind(&not_smi); 1246 __ Bind(&not_smi);
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 DRegister dreg = EvenDRegisterOf(reg); 1789 DRegister dreg = EvenDRegisterOf(reg);
1788 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1790 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1789 } 1791 }
1790 1792
1791 1793
1792 #undef __ 1794 #undef __
1793 1795
1794 } // namespace dart 1796 } // namespace dart
1795 1797
1796 #endif // defined TARGET_ARCH_ARM 1798 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698