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

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

Issue 385563004: Uses a conditional move for usage counter increment instead of a branch (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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
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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 __ LeaveStubFrame(); 1533 __ LeaveStubFrame();
1534 1534
1535 Label call_target_function; 1535 Label call_target_function;
1536 __ b(&call_target_function); 1536 __ b(&call_target_function);
1537 1537
1538 __ Bind(&found); 1538 __ Bind(&found);
1539 // T0: Pointer to an IC data check group. 1539 // T0: Pointer to an IC data check group.
1540 const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize; 1540 const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
1541 const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize; 1541 const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
1542 __ lw(T3, Address(T0, target_offset)); 1542 __ lw(T3, Address(T0, target_offset));
1543
1544 // Update counter.
1543 __ lw(T4, Address(T0, count_offset)); 1545 __ lw(T4, Address(T0, count_offset));
1544 1546 __ AddImmediateDetectOverflow(T7, T4, Smi::RawValue(1), T5, T6);
1545 __ AddImmediateDetectOverflow(T4, T4, Smi::RawValue(1), T5, T6); 1547 __ slt(CMPRES1, T5, ZR); // T5 is < 0 if there was overflow.
1546 1548 __ LoadImmediate(T4, Smi::RawValue(Smi::kMaxValue));
1547 __ bgez(T5, &call_target_function); // No overflow. 1549 __ movz(T4, T7, CMPRES1);
1548 __ delay_slot()->sw(T4, Address(T0, count_offset)); 1550 __ sw(T4, Address(T0, count_offset));
1549
1550 __ LoadImmediate(T1, Smi::RawValue(Smi::kMaxValue));
1551 __ sw(T1, Address(T0, count_offset));
1552 1551
1553 __ Bind(&call_target_function); 1552 __ Bind(&call_target_function);
1554 // T0 <- T3: Target function. 1553 // T0 <- T3: Target function.
1555 __ mov(T0, T3); 1554 __ mov(T0, T3);
1556 Label is_compiled; 1555 Label is_compiled;
1557 __ lw(T4, FieldAddress(T0, Function::instructions_offset())); 1556 __ lw(T4, FieldAddress(T0, Function::instructions_offset()));
1558 __ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag); 1557 __ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag);
1559 __ jr(T4); 1558 __ jr(T4);
1560 } 1559 }
1561 1560
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 const Register right = T0; 2062 const Register right = T0;
2064 __ lw(left, Address(SP, 1 * kWordSize)); 2063 __ lw(left, Address(SP, 1 * kWordSize));
2065 __ lw(right, Address(SP, 0 * kWordSize)); 2064 __ lw(right, Address(SP, 0 * kWordSize));
2066 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2065 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2067 __ Ret(); 2066 __ Ret();
2068 } 2067 }
2069 2068
2070 } // namespace dart 2069 } // namespace dart
2071 2070
2072 #endif // defined TARGET_ARCH_MIPS 2071 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698