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

Side by Side Diff: runtime/vm/stub_code_x64.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
« runtime/vm/stub_code_ia32.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | 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) 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_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 __ popq(R10); // Restore arguments descriptor array. 1363 __ popq(R10); // Restore arguments descriptor array.
1364 __ LeaveStubFrame(); 1364 __ LeaveStubFrame();
1365 Label call_target_function; 1365 Label call_target_function;
1366 __ jmp(&call_target_function); 1366 __ jmp(&call_target_function);
1367 1367
1368 __ Bind(&found); 1368 __ Bind(&found);
1369 // R12: Pointer to an IC data check group. 1369 // R12: Pointer to an IC data check group.
1370 const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize; 1370 const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
1371 const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize; 1371 const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
1372 __ movq(RAX, Address(R12, target_offset)); 1372 __ movq(RAX, Address(R12, target_offset));
1373 __ addq(Address(R12, count_offset), Immediate(Smi::RawValue(1))); 1373
1374 __ j(NO_OVERFLOW, &call_target_function, Assembler::kNearJump); 1374 // Update counter.
1375 __ movq(Address(R12, count_offset), 1375 __ movq(R8, Address(R12, count_offset));
1376 Immediate(Smi::RawValue(Smi::kMaxValue))); 1376 __ addq(R8, Immediate(Smi::RawValue(1)));
1377 __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
1378 __ cmovnoq(R9, R8);
1379 __ movq(Address(R12, count_offset), R9);
srdjan 2014/07/10 17:07:36 ditto
zra 2014/07/10 17:15:40 See link.
1377 1380
1378 __ Bind(&call_target_function); 1381 __ Bind(&call_target_function);
1379 // RAX: Target function. 1382 // RAX: Target function.
1380 Label is_compiled; 1383 Label is_compiled;
1381 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); 1384 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset()));
1382 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 1385 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1383 __ jmp(RCX); 1386 __ jmp(RCX);
1384 } 1387 }
1385 1388
1386 1389
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 1863
1861 __ movq(left, Address(RSP, 2 * kWordSize)); 1864 __ movq(left, Address(RSP, 2 * kWordSize));
1862 __ movq(right, Address(RSP, 1 * kWordSize)); 1865 __ movq(right, Address(RSP, 1 * kWordSize));
1863 GenerateIdenticalWithNumberCheckStub(assembler, left, right); 1866 GenerateIdenticalWithNumberCheckStub(assembler, left, right);
1864 __ ret(); 1867 __ ret();
1865 } 1868 }
1866 1869
1867 } // namespace dart 1870 } // namespace dart
1868 1871
1869 #endif // defined TARGET_ARCH_X64 1872 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/stub_code_ia32.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698