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

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

Issue 562333004: Recognize Bigint setters and getters. This code will be removed when/if we change the fields to be … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | 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 // 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 __ xorl(EAX, ECX); 880 __ xorl(EAX, ECX);
881 // BSR does not write the destination register if source is zero. Put a 1 in 881 // BSR does not write the destination register if source is zero. Put a 1 in
882 // the Smi tag bit to ensure BSR writes to destination register. 882 // the Smi tag bit to ensure BSR writes to destination register.
883 __ orl(EAX, Immediate(kSmiTagMask)); 883 __ orl(EAX, Immediate(kSmiTagMask));
884 __ bsrl(EAX, EAX); 884 __ bsrl(EAX, EAX);
885 __ SmiTag(EAX); 885 __ SmiTag(EAX);
886 __ ret(); 886 __ ret();
887 } 887 }
888 888
889 889
890 void Intrinsifier::Bigint_getNeg(Assembler* assembler) {
891 __ movl(EAX, Address(ESP, + 1 * kWordSize));
892 __ movl(EAX, FieldAddress(EAX, Bigint::neg_offset()));
893 __ ret();
894 }
895
896
897 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { 890 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
898 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 891 __ movl(EAX, Address(ESP, + 1 * kWordSize));
899 __ movl(ECX, Address(ESP, + 2 * kWordSize)); 892 __ movl(ECX, Address(ESP, + 2 * kWordSize));
900 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::neg_offset()), EAX, false); 893 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::neg_offset()), EAX, false);
901 __ ret(); 894 __ ret();
902 } 895 }
903 896
904 897
905 void Intrinsifier::Bigint_getUsed(Assembler* assembler) {
906 __ movl(EAX, Address(ESP, + 1 * kWordSize));
907 __ movl(EAX, FieldAddress(EAX, Bigint::used_offset()));
908 __ ret();
909 }
910
911
912 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { 898 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
913 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 899 __ movl(EAX, Address(ESP, + 1 * kWordSize));
914 __ movl(ECX, Address(ESP, + 2 * kWordSize)); 900 __ movl(ECX, Address(ESP, + 2 * kWordSize));
915 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::used_offset()), EAX); 901 __ StoreIntoObject(ECX, FieldAddress(ECX, Bigint::used_offset()), EAX);
916 __ ret(); 902 __ ret();
917 } 903 }
918 904
919 905
920 void Intrinsifier::Bigint_getDigits(Assembler* assembler) {
921 __ movl(EAX, Address(ESP, + 1 * kWordSize));
922 __ movl(EAX, FieldAddress(EAX, Bigint::digits_offset()));
923 __ ret();
924 }
925
926
927 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { 906 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
928 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 907 __ movl(EAX, Address(ESP, + 1 * kWordSize));
929 __ movl(ECX, Address(ESP, + 2 * kWordSize)); 908 __ movl(ECX, Address(ESP, + 2 * kWordSize));
930 __ StoreIntoObject(ECX, 909 __ StoreIntoObject(ECX,
931 FieldAddress(ECX, Bigint::digits_offset()), EAX, false); 910 FieldAddress(ECX, Bigint::digits_offset()), EAX, false);
932 __ ret(); 911 __ ret();
933 } 912 }
934 913
935 914
936 // Check if the last argument is a double, jump to label 'is_smi' if smi 915 // Check if the last argument is a double, jump to label 'is_smi' if smi
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 Isolate::current_tag_offset()); 1642 Isolate::current_tag_offset());
1664 // Set return value to Isolate::current_tag_. 1643 // Set return value to Isolate::current_tag_.
1665 __ movl(EAX, current_tag_addr); 1644 __ movl(EAX, current_tag_addr);
1666 __ ret(); 1645 __ ret();
1667 } 1646 }
1668 1647
1669 #undef __ 1648 #undef __
1670 } // namespace dart 1649 } // namespace dart
1671 1650
1672 #endif // defined TARGET_ARCH_IA32 1651 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698