| OLD | NEW |
| 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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 const String& name = String::Handle(zone(), ic_data.target_name()); | 1325 const String& name = String::Handle(zone(), ic_data.target_name()); |
| 1326 const Array& arguments_descriptor = | 1326 const Array& arguments_descriptor = |
| 1327 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); | 1327 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
| 1328 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); | 1328 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); |
| 1329 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), | 1329 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), |
| 1330 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); | 1330 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
| 1331 __ Comment("MegamorphicCall"); | 1331 __ Comment("MegamorphicCall"); |
| 1332 // Load receiver into RDI. | 1332 // Load receiver into RDI. |
| 1333 __ movq(RDI, Address(RSP, (argument_count - 1) * kWordSize)); | 1333 __ movq(RDI, Address(RSP, (argument_count - 1) * kWordSize)); |
| 1334 Label done; | 1334 Label done; |
| 1335 if (name.raw() == Symbols::hashCode().raw()) { | 1335 if (ShouldInlineSmiStringHashCode(ic_data)) { |
| 1336 Label try_onebytestring, megamorphic_call; | 1336 Label megamorphic_call; |
| 1337 __ Comment("Inlined get:hashCode for Smi and OneByteString"); | 1337 __ Comment("Inlined get:hashCode for Smi and OneByteString"); |
| 1338 __ movq(RAX, RDI); // Move Smi hashcode to RAX. |
| 1338 __ testq(RDI, Immediate(kSmiTagMask)); | 1339 __ testq(RDI, Immediate(kSmiTagMask)); |
| 1339 __ j(NOT_ZERO, &try_onebytestring, Assembler::kNearJump); // Non-smi value. | 1340 __ j(ZERO, &done, Assembler::kNearJump); // It is Smi, we are done. |
| 1340 __ movq(RAX, RDI); | |
| 1341 __ jmp(&done, Assembler::kNearJump); | |
| 1342 | 1341 |
| 1343 __ Bind(&try_onebytestring); | |
| 1344 __ CompareClassId(RDI, kOneByteStringCid); | 1342 __ CompareClassId(RDI, kOneByteStringCid); |
| 1345 __ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump); | 1343 __ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump); |
| 1346 __ movq(RAX, FieldAddress(RDI, String::hash_offset())); | 1344 __ movq(RAX, FieldAddress(RDI, String::hash_offset())); |
| 1347 __ cmpq(RAX, Immediate(0)); | 1345 __ cmpq(RAX, Immediate(0)); |
| 1348 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 1346 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
| 1349 | 1347 |
| 1350 __ Bind(&megamorphic_call); | 1348 __ Bind(&megamorphic_call); |
| 1351 __ Comment("Slow case: megamorphic call"); | 1349 __ Comment("Slow case: megamorphic call"); |
| 1352 } | 1350 } |
| 1353 __ LoadObject(RBX, cache); | 1351 __ LoadObject(RBX, cache); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 __ movups(reg, Address(RSP, 0)); | 1868 __ movups(reg, Address(RSP, 0)); |
| 1871 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); | 1869 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); |
| 1872 } | 1870 } |
| 1873 | 1871 |
| 1874 | 1872 |
| 1875 #undef __ | 1873 #undef __ |
| 1876 | 1874 |
| 1877 } // namespace dart | 1875 } // namespace dart |
| 1878 | 1876 |
| 1879 #endif // defined TARGET_ARCH_X64 | 1877 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |