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

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

Issue 616873003: Use UnboxedInt32 and UnboxedUint32 representation for LoadIndexedInstr (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/simulator_arm64.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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 __ j(true_condition, &is_true, Assembler::kNearJump); 884 __ j(true_condition, &is_true, Assembler::kNearJump);
885 // Fall through false. 885 // Fall through false.
886 __ Bind(&is_false); 886 __ Bind(&is_false);
887 __ LoadObject(RAX, Bool::False(), PP); 887 __ LoadObject(RAX, Bool::False(), PP);
888 __ ret(); 888 __ ret();
889 __ Bind(&is_true); 889 __ Bind(&is_true);
890 __ LoadObject(RAX, Bool::True(), PP); 890 __ LoadObject(RAX, Bool::True(), PP);
891 __ ret(); 891 __ ret();
892 __ Bind(&is_smi); 892 __ Bind(&is_smi);
893 __ SmiUntag(RAX); 893 __ SmiUntag(RAX);
894 __ cvtsi2sd(XMM1, RAX); 894 __ cvtsi2sdq(XMM1, RAX);
895 __ jmp(&double_op); 895 __ jmp(&double_op);
896 __ Bind(&fall_through); 896 __ Bind(&fall_through);
897 } 897 }
898 898
899 899
900 void Intrinsifier::Double_greaterThan(Assembler* assembler) { 900 void Intrinsifier::Double_greaterThan(Assembler* assembler) {
901 CompareDoubles(assembler, ABOVE); 901 CompareDoubles(assembler, ABOVE);
902 } 902 }
903 903
904 904
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 972
973 973
974 void Intrinsifier::Double_mulFromInteger(Assembler* assembler) { 974 void Intrinsifier::Double_mulFromInteger(Assembler* assembler) {
975 Label fall_through; 975 Label fall_through;
976 // Only smis allowed. 976 // Only smis allowed.
977 __ movq(RAX, Address(RSP, + 1 * kWordSize)); 977 __ movq(RAX, Address(RSP, + 1 * kWordSize));
978 __ testq(RAX, Immediate(kSmiTagMask)); 978 __ testq(RAX, Immediate(kSmiTagMask));
979 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); 979 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
980 // Is Smi. 980 // Is Smi.
981 __ SmiUntag(RAX); 981 __ SmiUntag(RAX);
982 __ cvtsi2sd(XMM1, RAX); 982 __ cvtsi2sdq(XMM1, RAX);
983 __ movq(RAX, Address(RSP, + 2 * kWordSize)); 983 __ movq(RAX, Address(RSP, + 2 * kWordSize));
984 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); 984 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
985 __ mulsd(XMM0, XMM1); 985 __ mulsd(XMM0, XMM1);
986 const Class& double_class = Class::Handle( 986 const Class& double_class = Class::Handle(
987 Isolate::Current()->object_store()->double_class()); 987 Isolate::Current()->object_store()->double_class());
988 __ TryAllocate(double_class, 988 __ TryAllocate(double_class,
989 &fall_through, 989 &fall_through,
990 Assembler::kNearJump, 990 Assembler::kNearJump,
991 RAX, // Result register. 991 RAX, // Result register.
992 kNoRegister); // Pool pointer might not be loaded. 992 kNoRegister); // Pool pointer might not be loaded.
993 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0); 993 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
994 __ ret(); 994 __ ret();
995 __ Bind(&fall_through); 995 __ Bind(&fall_through);
996 } 996 }
997 997
998 998
999 // Left is double right is integer (Bigint, Mint or Smi) 999 // Left is double right is integer (Bigint, Mint or Smi)
1000 void Intrinsifier::DoubleFromInteger(Assembler* assembler) { 1000 void Intrinsifier::DoubleFromInteger(Assembler* assembler) {
1001 Label fall_through; 1001 Label fall_through;
1002 __ movq(RAX, Address(RSP, +1 * kWordSize)); 1002 __ movq(RAX, Address(RSP, +1 * kWordSize));
1003 __ testq(RAX, Immediate(kSmiTagMask)); 1003 __ testq(RAX, Immediate(kSmiTagMask));
1004 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); 1004 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
1005 // Is Smi. 1005 // Is Smi.
1006 __ SmiUntag(RAX); 1006 __ SmiUntag(RAX);
1007 __ cvtsi2sd(XMM0, RAX); 1007 __ cvtsi2sdq(XMM0, RAX);
1008 const Class& double_class = Class::Handle( 1008 const Class& double_class = Class::Handle(
1009 Isolate::Current()->object_store()->double_class()); 1009 Isolate::Current()->object_store()->double_class());
1010 __ TryAllocate(double_class, 1010 __ TryAllocate(double_class,
1011 &fall_through, 1011 &fall_through,
1012 Assembler::kNearJump, 1012 Assembler::kNearJump,
1013 RAX, // Result register. 1013 RAX, // Result register.
1014 kNoRegister); // Pool pointer might not be loaded. 1014 kNoRegister); // Pool pointer might not be loaded.
1015 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0); 1015 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
1016 __ ret(); 1016 __ ret();
1017 __ Bind(&fall_through); 1017 __ Bind(&fall_through);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 Isolate::Current()->object_store()->double_class()); 1083 Isolate::Current()->object_store()->double_class());
1084 __ TryAllocate(double_class, 1084 __ TryAllocate(double_class,
1085 &fall_through, 1085 &fall_through,
1086 Assembler::kNearJump, 1086 Assembler::kNearJump,
1087 RAX, // Result register. 1087 RAX, // Result register.
1088 kNoRegister); // Pool pointer might not be loaded. 1088 kNoRegister); // Pool pointer might not be loaded.
1089 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0); 1089 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
1090 __ ret(); 1090 __ ret();
1091 __ Bind(&is_smi); 1091 __ Bind(&is_smi);
1092 __ SmiUntag(RAX); 1092 __ SmiUntag(RAX);
1093 __ cvtsi2sd(XMM1, RAX); 1093 __ cvtsi2sdq(XMM1, RAX);
1094 __ jmp(&double_op); 1094 __ jmp(&double_op);
1095 __ Bind(&fall_through); 1095 __ Bind(&fall_through);
1096 } 1096 }
1097 1097
1098 1098
1099 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; 1099 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64;
1100 // _state[kSTATE_LO] = state & _MASK_32; 1100 // _state[kSTATE_LO] = state & _MASK_32;
1101 // _state[kSTATE_HI] = state >> 32; 1101 // _state[kSTATE_HI] = state >> 32;
1102 void Intrinsifier::Random_nextState(Assembler* assembler) { 1102 void Intrinsifier::Random_nextState(Assembler* assembler) {
1103 const Library& math_lib = Library::Handle(Library::MathLibrary()); 1103 const Library& math_lib = Library::Handle(Library::MathLibrary());
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 // Set return value to Isolate::current_tag_. 1578 // Set return value to Isolate::current_tag_.
1579 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); 1579 __ movq(RAX, Address(RBX, Isolate::current_tag_offset()));
1580 __ ret(); 1580 __ ret();
1581 } 1581 }
1582 1582
1583 #undef __ 1583 #undef __
1584 1584
1585 } // namespace dart 1585 } // namespace dart
1586 1586
1587 #endif // defined TARGET_ARCH_X64 1587 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698