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

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

Issue 905653004: Clarify result returned by remainder intrinsics. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 372
373 // Optimizations: 373 // Optimizations:
374 // - result is 0 if: 374 // - result is 0 if:
375 // - left is 0 375 // - left is 0
376 // - left equals right 376 // - left equals right
377 // - result is left if 377 // - result is left if
378 // - left > 0 && left < right 378 // - left > 0 && left < right
379 // EAX: Tagged left (dividend). 379 // EAX: Tagged left (dividend).
380 // EBX: Tagged right (divisor). 380 // EBX: Tagged right (divisor).
381 // EDX: Untagged result (remainder). 381 // Returns:
382 // EDX: Untagged fallthrough result (remainder to be adjusted), or
383 // EAX: Tagged return result (remainder).
382 static void EmitRemainderOperation(Assembler* assembler) { 384 static void EmitRemainderOperation(Assembler* assembler) {
383 Label return_zero, modulo; 385 Label return_zero, modulo;
384 // Check for quick zero results. 386 // Check for quick zero results.
385 __ cmpl(EAX, Immediate(0)); 387 __ cmpl(EAX, Immediate(0));
386 __ j(EQUAL, &return_zero, Assembler::kNearJump); 388 __ j(EQUAL, &return_zero, Assembler::kNearJump);
387 __ cmpl(EAX, EBX); 389 __ cmpl(EAX, EBX);
388 __ j(EQUAL, &return_zero, Assembler::kNearJump); 390 __ j(EQUAL, &return_zero, Assembler::kNearJump);
389 391
390 // Check if result equals left. 392 // Check if result equals left.
391 __ cmpl(EAX, Immediate(0)); 393 __ cmpl(EAX, Immediate(0));
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 Isolate::current_tag_offset()); 2030 Isolate::current_tag_offset());
2029 // Set return value to Isolate::current_tag_. 2031 // Set return value to Isolate::current_tag_.
2030 __ movl(EAX, current_tag_addr); 2032 __ movl(EAX, current_tag_addr);
2031 __ ret(); 2033 __ ret();
2032 } 2034 }
2033 2035
2034 #undef __ 2036 #undef __
2035 } // namespace dart 2037 } // namespace dart
2036 2038
2037 #endif // defined TARGET_ARCH_IA32 2039 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698