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

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

Issue 1429303005: Add fast Smi op version of switchable instance calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 intptr_t token_pos, 1250 intptr_t token_pos,
1251 LocationSummary* locs) { 1251 LocationSummary* locs) {
1252 const String& name = String::Handle(zone(), ic_data.target_name()); 1252 const String& name = String::Handle(zone(), ic_data.target_name());
1253 const Array& arguments_descriptor = 1253 const Array& arguments_descriptor =
1254 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); 1254 Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
1255 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); 1255 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1256 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), 1256 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
1257 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); 1257 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
1258 1258
1259 __ Comment("MegamorphicCall"); 1259 __ Comment("MegamorphicCall");
1260 __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize); 1260 __ LoadFromOffset(R1, SP, (argument_count - 1) * kWordSize);
1261 __ LoadObject(R5, cache); 1261 __ LoadObject(R5, cache);
1262 if (FLAG_use_megamorphic_stub) { 1262 if (FLAG_use_megamorphic_stub) {
1263 __ BranchLink(*StubCode::MegamorphicLookup_entry()); 1263 __ BranchLink(*StubCode::MegamorphicLookup_entry());
1264 } else { 1264 } else {
1265 StubCode::EmitMegamorphicLookup(assembler()); 1265 StubCode::EmitMegamorphicLookup(assembler());
1266 } 1266 }
1267 __ blr(R1); 1267 __ blr(R1);
1268 1268
1269 AddCurrentDescriptor(RawPcDescriptors::kOther, 1269 AddCurrentDescriptor(RawPcDescriptors::kOther,
1270 Thread::kNoDeoptId, token_pos); 1270 Thread::kNoDeoptId, token_pos);
(...skipping 10 matching lines...) Expand all
1281 } 1281 }
1282 1282
1283 1283
1284 void FlowGraphCompiler::EmitSwitchableInstanceCall( 1284 void FlowGraphCompiler::EmitSwitchableInstanceCall(
1285 const ICData& ic_data, 1285 const ICData& ic_data,
1286 intptr_t argument_count, 1286 intptr_t argument_count,
1287 intptr_t deopt_id, 1287 intptr_t deopt_id,
1288 intptr_t token_pos, 1288 intptr_t token_pos,
1289 LocationSummary* locs) { 1289 LocationSummary* locs) {
1290 __ Comment("SwitchableCall"); 1290 __ Comment("SwitchableCall");
1291 __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize); 1291 __ LoadFromOffset(R1, SP, (argument_count - 1) * kWordSize);
1292 if (ic_data.NumArgsTested() == 1) { 1292 if (ic_data.NumArgsTested() == 1) {
1293 __ LoadUniqueObject(R5, ic_data); 1293 __ LoadUniqueObject(R5, ic_data);
1294 __ BranchLinkPatchable(*StubCode::ICLookup_entry()); 1294 __ BranchLinkPatchable(*StubCode::ICLookup_entry());
1295 } else { 1295 } else {
1296 const String& name = String::Handle(zone(), ic_data.target_name()); 1296 const String& name = String::Handle(zone(), ic_data.target_name());
1297 const Array& arguments_descriptor =
1298 Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
1299 ASSERT(!arguments_descriptor.IsNull() &&
1300 (arguments_descriptor.Length() > 0));
1301 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
1302 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
1303 1297
1304 __ LoadUniqueObject(R5, cache); 1298 if (name.raw() == Symbols::Plus().raw()) {
1305 __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry()); 1299 __ LoadUniqueObject(R5, ic_data);
1300 __ BranchLinkPatchable(*StubCode::ICSmiAddLookup_entry());
1301 } else if (name.raw() == Symbols::Minus().raw()) {
1302 __ LoadUniqueObject(R5, ic_data);
1303 __ BranchLinkPatchable(*StubCode::ICSmiSubLookup_entry());
1304 } else if (name.raw() == Symbols::Equals().raw()) {
1305 __ LoadUniqueObject(R5, ic_data);
1306 __ BranchLinkPatchable(*StubCode::ICSmiEqualLookup_entry());
1307 } else {
1308 const Array& arguments_descriptor =
1309 Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
1310 ASSERT(!arguments_descriptor.IsNull() &&
1311 (arguments_descriptor.Length() > 0));
1312 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
1313 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
1314
1315 __ LoadUniqueObject(R5, cache);
1316 __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry());
1317 }
1306 } 1318 }
1307 __ blr(R1); 1319 __ blr(R1); // A fast Smi operation may return past this call.
1308 1320
1309 AddCurrentDescriptor(RawPcDescriptors::kOther, 1321 AddCurrentDescriptor(RawPcDescriptors::kOther,
1310 Thread::kNoDeoptId, token_pos); 1322 Thread::kNoDeoptId, token_pos);
1311 RecordSafepoint(locs); 1323 RecordSafepoint(locs);
1312 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); 1324 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
1313 if (is_optimizing()) { 1325 if (is_optimizing()) {
1314 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1326 AddDeoptIndexAtCall(deopt_id_after, token_pos);
1315 } else { 1327 } else {
1316 // Add deoptimization continuation point after the call and before the 1328 // Add deoptimization continuation point after the call and before the
1317 // arguments are removed. 1329 // arguments are removed.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1869 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1858 __ PopDouble(reg); 1870 __ PopDouble(reg);
1859 } 1871 }
1860 1872
1861 1873
1862 #undef __ 1874 #undef __
1863 1875
1864 } // namespace dart 1876 } // namespace dart
1865 1877
1866 #endif // defined TARGET_ARCH_ARM64 1878 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698