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

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

Issue 1346473002: Move megamorphic cache table into the Dart heap. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: non-x64 Created 5 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
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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 __ Drop(argument_count, RCX); 1304 __ Drop(argument_count, RCX);
1305 } 1305 }
1306 1306
1307 1307
1308 void FlowGraphCompiler::EmitMegamorphicInstanceCall( 1308 void FlowGraphCompiler::EmitMegamorphicInstanceCall(
1309 const ICData& ic_data, 1309 const ICData& ic_data,
1310 intptr_t argument_count, 1310 intptr_t argument_count,
1311 intptr_t deopt_id, 1311 intptr_t deopt_id,
1312 intptr_t token_pos, 1312 intptr_t token_pos,
1313 LocationSummary* locs) { 1313 LocationSummary* locs) {
1314 MegamorphicCacheTable* table = isolate()->megamorphic_cache_table();
1315 const String& name = String::Handle(zone(), ic_data.target_name()); 1314 const String& name = String::Handle(zone(), ic_data.target_name());
1316 const Array& arguments_descriptor = 1315 const Array& arguments_descriptor =
1317 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); 1316 Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
1318 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); 1317 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1319 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle( 1318 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
1320 zone(), table->Lookup(name, arguments_descriptor)); 1319 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
1321 const Register receiverR = RDI; 1320 const Register receiverR = RDI;
1322 const Register cacheR = RBX; 1321 const Register cacheR = RBX;
1323 const Register targetR = RCX; 1322 const Register targetR = RCX;
1324 __ movq(receiverR, Address(RSP, (argument_count - 1) * kWordSize)); 1323 __ movq(receiverR, Address(RSP, (argument_count - 1) * kWordSize));
1325 __ LoadObject(cacheR, cache); 1324 __ LoadObject(cacheR, cache);
1326 1325
1327 if (FLAG_use_megamorphic_stub) { 1326 if (FLAG_use_megamorphic_stub) {
1328 __ Call(*StubCode::MegamorphicLookup_entry()); 1327 __ Call(*StubCode::MegamorphicLookup_entry());
1329 } else { 1328 } else {
1330 StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR); 1329 StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR);
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 __ movups(reg, Address(RSP, 0)); 1789 __ movups(reg, Address(RSP, 0));
1791 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); 1790 __ AddImmediate(RSP, Immediate(kFpuRegisterSize));
1792 } 1791 }
1793 1792
1794 1793
1795 #undef __ 1794 #undef __
1796 1795
1797 } // namespace dart 1796 } // namespace dart
1798 1797
1799 #endif // defined TARGET_ARCH_X64 1798 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698