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

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

Issue 1920103004: Added flag --inline_smi_string_hashcode and --inline_smi_string_hashcode_ratio to decide when/if sh… (Closed) Base URL: https://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
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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 const Array& arguments_descriptor = 1323 const Array& arguments_descriptor =
1324 Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); 1324 Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
1325 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0)); 1325 ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
1326 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(), 1326 const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
1327 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); 1327 MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
1328 1328
1329 __ Comment("MegamorphicCall"); 1329 __ Comment("MegamorphicCall");
1330 // Load receiver into T0, 1330 // Load receiver into T0,
1331 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize)); 1331 __ lw(T0, Address(SP, (argument_count - 1) * kWordSize));
1332 Label done; 1332 Label done;
1333 if (name.raw() == Symbols::hashCode().raw()) { 1333 if (ShouldInlineSmiStringHashCode(ic_data)) {
1334 Label try_onebytestring, megamorphic_call; 1334 Label megamorphic_call;
1335 __ Comment("Inlined get:hashCode for Smi and OneByteString"); 1335 __ Comment("Inlined get:hashCode for Smi and OneByteString");
1336 __ mov(V0, T0); // Move Smi hashcode to V0.
1336 __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); 1337 __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
1337 __ bne(CMPRES1, ZR, &try_onebytestring); // Not Smi. 1338 __ beq(CMPRES1, ZR, &done); // Is Smi.
zra 2016/04/27 16:28:17 The mov can go in the branch delay slot: __ beq(C
srdjan 2016/04/27 18:10:22 Done.
1338 __ mov(V0, T0);
1339 __ b(&done);
1340 1339
1341 __ Bind(&try_onebytestring);
1342 __ LoadClassId(CMPRES1, T0); // Class ID check. 1340 __ LoadClassId(CMPRES1, T0); // Class ID check.
1343 __ BranchNotEqual( 1341 __ BranchNotEqual(
1344 CMPRES1, Immediate(kOneByteStringCid), &megamorphic_call); 1342 CMPRES1, Immediate(kOneByteStringCid), &megamorphic_call);
1345 1343
1346 __ lw(V0, FieldAddress(T0, String::hash_offset())); 1344 __ lw(V0, FieldAddress(T0, String::hash_offset()));
1347 __ bne(V0, ZR, &done); 1345 __ bne(V0, ZR, &done);
1348 1346
1349 __ Bind(&megamorphic_call); 1347 __ Bind(&megamorphic_call);
1350 __ Comment("Slow case: megamorphic call"); 1348 __ Comment("Slow case: megamorphic call");
1351 } 1349 }
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 __ AddImmediate(SP, kDoubleSize); 1960 __ AddImmediate(SP, kDoubleSize);
1963 } 1961 }
1964 1962
1965 1963
1966 #undef __ 1964 #undef __
1967 1965
1968 1966
1969 } // namespace dart 1967 } // namespace dart
1970 1968
1971 #endif // defined TARGET_ARCH_MIPS 1969 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698