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

Side by Side Diff: src/x64/ic-x64.cc

Issue 199903002: Introduce Push and Pop macro instructions for x64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased with bleeding_edge Created 6 years, 9 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 | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 564
565 // Check that it has indexed interceptor and access checks 565 // Check that it has indexed interceptor and access checks
566 // are not enabled for this object. 566 // are not enabled for this object.
567 __ movb(rcx, FieldOperand(rcx, Map::kBitFieldOffset)); 567 __ movb(rcx, FieldOperand(rcx, Map::kBitFieldOffset));
568 __ andb(rcx, Immediate(kSlowCaseBitFieldMask)); 568 __ andb(rcx, Immediate(kSlowCaseBitFieldMask));
569 __ cmpb(rcx, Immediate(1 << Map::kHasIndexedInterceptor)); 569 __ cmpb(rcx, Immediate(1 << Map::kHasIndexedInterceptor));
570 __ j(not_zero, &slow); 570 __ j(not_zero, &slow);
571 571
572 // Everything is fine, call runtime. 572 // Everything is fine, call runtime.
573 __ PopReturnAddressTo(rcx); 573 __ PopReturnAddressTo(rcx);
574 __ push(rdx); // receiver 574 __ Push(rdx); // receiver
575 __ push(rax); // key 575 __ Push(rax); // key
576 __ PushReturnAddressFrom(rcx); 576 __ PushReturnAddressFrom(rcx);
577 577
578 // Perform tail call to the entry. 578 // Perform tail call to the entry.
579 __ TailCallExternalReference( 579 __ TailCallExternalReference(
580 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), 580 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor),
581 masm->isolate()), 581 masm->isolate()),
582 2, 582 2,
583 1); 583 1);
584 584
585 __ bind(&slow); 585 __ bind(&slow);
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 // ----------- S t a t e ------------- 1014 // ----------- S t a t e -------------
1015 // -- rax : receiver 1015 // -- rax : receiver
1016 // -- rcx : name 1016 // -- rcx : name
1017 // -- rsp[0] : return address 1017 // -- rsp[0] : return address
1018 // ----------------------------------- 1018 // -----------------------------------
1019 1019
1020 Counters* counters = masm->isolate()->counters(); 1020 Counters* counters = masm->isolate()->counters();
1021 __ IncrementCounter(counters->load_miss(), 1); 1021 __ IncrementCounter(counters->load_miss(), 1);
1022 1022
1023 __ PopReturnAddressTo(rbx); 1023 __ PopReturnAddressTo(rbx);
1024 __ push(rax); // receiver 1024 __ Push(rax); // receiver
1025 __ push(rcx); // name 1025 __ Push(rcx); // name
1026 __ PushReturnAddressFrom(rbx); 1026 __ PushReturnAddressFrom(rbx);
1027 1027
1028 // Perform tail call to the entry. 1028 // Perform tail call to the entry.
1029 ExternalReference ref = 1029 ExternalReference ref =
1030 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); 1030 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
1031 __ TailCallExternalReference(ref, 2, 1); 1031 __ TailCallExternalReference(ref, 2, 1);
1032 } 1032 }
1033 1033
1034 1034
1035 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 1035 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
1036 // ----------- S t a t e ------------- 1036 // ----------- S t a t e -------------
1037 // -- rax : receiver 1037 // -- rax : receiver
1038 // -- rcx : name 1038 // -- rcx : name
1039 // -- rsp[0] : return address 1039 // -- rsp[0] : return address
1040 // ----------------------------------- 1040 // -----------------------------------
1041 1041
1042 __ PopReturnAddressTo(rbx); 1042 __ PopReturnAddressTo(rbx);
1043 __ push(rax); // receiver 1043 __ Push(rax); // receiver
1044 __ push(rcx); // name 1044 __ Push(rcx); // name
1045 __ PushReturnAddressFrom(rbx); 1045 __ PushReturnAddressFrom(rbx);
1046 1046
1047 // Perform tail call to the entry. 1047 // Perform tail call to the entry.
1048 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); 1048 __ TailCallRuntime(Runtime::kGetProperty, 2, 1);
1049 } 1049 }
1050 1050
1051 1051
1052 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 1052 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
1053 // ----------- S t a t e ------------- 1053 // ----------- S t a t e -------------
1054 // -- rax : key 1054 // -- rax : key
1055 // -- rdx : receiver 1055 // -- rdx : receiver
1056 // -- rsp[0] : return address 1056 // -- rsp[0] : return address
1057 // ----------------------------------- 1057 // -----------------------------------
1058 1058
1059 Counters* counters = masm->isolate()->counters(); 1059 Counters* counters = masm->isolate()->counters();
1060 __ IncrementCounter(counters->keyed_load_miss(), 1); 1060 __ IncrementCounter(counters->keyed_load_miss(), 1);
1061 1061
1062 __ PopReturnAddressTo(rbx); 1062 __ PopReturnAddressTo(rbx);
1063 __ push(rdx); // receiver 1063 __ Push(rdx); // receiver
1064 __ push(rax); // name 1064 __ Push(rax); // name
1065 __ PushReturnAddressFrom(rbx); 1065 __ PushReturnAddressFrom(rbx);
1066 1066
1067 // Perform tail call to the entry. 1067 // Perform tail call to the entry.
1068 ExternalReference ref = 1068 ExternalReference ref =
1069 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); 1069 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
1070 __ TailCallExternalReference(ref, 2, 1); 1070 __ TailCallExternalReference(ref, 2, 1);
1071 } 1071 }
1072 1072
1073 1073
1074 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 1074 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
1075 // ----------- S t a t e ------------- 1075 // ----------- S t a t e -------------
1076 // -- rax : key 1076 // -- rax : key
1077 // -- rdx : receiver 1077 // -- rdx : receiver
1078 // -- rsp[0] : return address 1078 // -- rsp[0] : return address
1079 // ----------------------------------- 1079 // -----------------------------------
1080 1080
1081 __ PopReturnAddressTo(rbx); 1081 __ PopReturnAddressTo(rbx);
1082 __ push(rdx); // receiver 1082 __ Push(rdx); // receiver
1083 __ push(rax); // name 1083 __ Push(rax); // name
1084 __ PushReturnAddressFrom(rbx); 1084 __ PushReturnAddressFrom(rbx);
1085 1085
1086 // Perform tail call to the entry. 1086 // Perform tail call to the entry.
1087 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); 1087 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
1088 } 1088 }
1089 1089
1090 1090
1091 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 1091 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
1092 // ----------- S t a t e ------------- 1092 // ----------- S t a t e -------------
1093 // -- rax : value 1093 // -- rax : value
(...skipping 14 matching lines...) Expand all
1108 1108
1109 void StoreIC::GenerateMiss(MacroAssembler* masm) { 1109 void StoreIC::GenerateMiss(MacroAssembler* masm) {
1110 // ----------- S t a t e ------------- 1110 // ----------- S t a t e -------------
1111 // -- rax : value 1111 // -- rax : value
1112 // -- rcx : name 1112 // -- rcx : name
1113 // -- rdx : receiver 1113 // -- rdx : receiver
1114 // -- rsp[0] : return address 1114 // -- rsp[0] : return address
1115 // ----------------------------------- 1115 // -----------------------------------
1116 1116
1117 __ PopReturnAddressTo(rbx); 1117 __ PopReturnAddressTo(rbx);
1118 __ push(rdx); // receiver 1118 __ Push(rdx); // receiver
1119 __ push(rcx); // name 1119 __ Push(rcx); // name
1120 __ push(rax); // value 1120 __ Push(rax); // value
1121 __ PushReturnAddressFrom(rbx); 1121 __ PushReturnAddressFrom(rbx);
1122 1122
1123 // Perform tail call to the entry. 1123 // Perform tail call to the entry.
1124 ExternalReference ref = 1124 ExternalReference ref =
1125 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); 1125 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
1126 __ TailCallExternalReference(ref, 3, 1); 1126 __ TailCallExternalReference(ref, 3, 1);
1127 } 1127 }
1128 1128
1129 1129
1130 void StoreIC::GenerateNormal(MacroAssembler* masm) { 1130 void StoreIC::GenerateNormal(MacroAssembler* masm) {
(...skipping 21 matching lines...) Expand all
1152 1152
1153 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, 1153 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
1154 StrictMode strict_mode) { 1154 StrictMode strict_mode) {
1155 // ----------- S t a t e ------------- 1155 // ----------- S t a t e -------------
1156 // -- rax : value 1156 // -- rax : value
1157 // -- rcx : name 1157 // -- rcx : name
1158 // -- rdx : receiver 1158 // -- rdx : receiver
1159 // -- rsp[0] : return address 1159 // -- rsp[0] : return address
1160 // ----------------------------------- 1160 // -----------------------------------
1161 __ PopReturnAddressTo(rbx); 1161 __ PopReturnAddressTo(rbx);
1162 __ push(rdx); 1162 __ Push(rdx);
1163 __ push(rcx); 1163 __ Push(rcx);
1164 __ push(rax); 1164 __ Push(rax);
1165 __ Push(Smi::FromInt(NONE)); // PropertyAttributes 1165 __ Push(Smi::FromInt(NONE)); // PropertyAttributes
1166 __ Push(Smi::FromInt(strict_mode)); 1166 __ Push(Smi::FromInt(strict_mode));
1167 __ PushReturnAddressFrom(rbx); 1167 __ PushReturnAddressFrom(rbx);
1168 1168
1169 // Do tail-call to runtime routine. 1169 // Do tail-call to runtime routine.
1170 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); 1170 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
1171 } 1171 }
1172 1172
1173 1173
1174 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, 1174 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
1175 StrictMode strict_mode) { 1175 StrictMode strict_mode) {
1176 // ----------- S t a t e ------------- 1176 // ----------- S t a t e -------------
1177 // -- rax : value 1177 // -- rax : value
1178 // -- rcx : key 1178 // -- rcx : key
1179 // -- rdx : receiver 1179 // -- rdx : receiver
1180 // -- rsp[0] : return address 1180 // -- rsp[0] : return address
1181 // ----------------------------------- 1181 // -----------------------------------
1182 1182
1183 __ PopReturnAddressTo(rbx); 1183 __ PopReturnAddressTo(rbx);
1184 __ push(rdx); // receiver 1184 __ Push(rdx); // receiver
1185 __ push(rcx); // key 1185 __ Push(rcx); // key
1186 __ push(rax); // value 1186 __ Push(rax); // value
1187 __ Push(Smi::FromInt(NONE)); // PropertyAttributes 1187 __ Push(Smi::FromInt(NONE)); // PropertyAttributes
1188 __ Push(Smi::FromInt(strict_mode)); // Strict mode. 1188 __ Push(Smi::FromInt(strict_mode)); // Strict mode.
1189 __ PushReturnAddressFrom(rbx); 1189 __ PushReturnAddressFrom(rbx);
1190 1190
1191 // Do tail-call to runtime routine. 1191 // Do tail-call to runtime routine.
1192 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); 1192 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
1193 } 1193 }
1194 1194
1195 1195
1196 void StoreIC::GenerateSlow(MacroAssembler* masm) { 1196 void StoreIC::GenerateSlow(MacroAssembler* masm) {
1197 // ----------- S t a t e ------------- 1197 // ----------- S t a t e -------------
1198 // -- rax : value 1198 // -- rax : value
1199 // -- rcx : key 1199 // -- rcx : key
1200 // -- rdx : receiver 1200 // -- rdx : receiver
1201 // -- rsp[0] : return address 1201 // -- rsp[0] : return address
1202 // ----------------------------------- 1202 // -----------------------------------
1203 1203
1204 __ PopReturnAddressTo(rbx); 1204 __ PopReturnAddressTo(rbx);
1205 __ push(rdx); // receiver 1205 __ Push(rdx); // receiver
1206 __ push(rcx); // key 1206 __ Push(rcx); // key
1207 __ push(rax); // value 1207 __ Push(rax); // value
1208 __ PushReturnAddressFrom(rbx); 1208 __ PushReturnAddressFrom(rbx);
1209 1209
1210 // Do tail-call to runtime routine. 1210 // Do tail-call to runtime routine.
1211 ExternalReference ref(IC_Utility(kStoreIC_Slow), masm->isolate()); 1211 ExternalReference ref(IC_Utility(kStoreIC_Slow), masm->isolate());
1212 __ TailCallExternalReference(ref, 3, 1); 1212 __ TailCallExternalReference(ref, 3, 1);
1213 } 1213 }
1214 1214
1215 1215
1216 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { 1216 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
1217 // ----------- S t a t e ------------- 1217 // ----------- S t a t e -------------
1218 // -- rax : value 1218 // -- rax : value
1219 // -- rcx : key 1219 // -- rcx : key
1220 // -- rdx : receiver 1220 // -- rdx : receiver
1221 // -- rsp[0] : return address 1221 // -- rsp[0] : return address
1222 // ----------------------------------- 1222 // -----------------------------------
1223 1223
1224 __ PopReturnAddressTo(rbx); 1224 __ PopReturnAddressTo(rbx);
1225 __ push(rdx); // receiver 1225 __ Push(rdx); // receiver
1226 __ push(rcx); // key 1226 __ Push(rcx); // key
1227 __ push(rax); // value 1227 __ Push(rax); // value
1228 __ PushReturnAddressFrom(rbx); 1228 __ PushReturnAddressFrom(rbx);
1229 1229
1230 // Do tail-call to runtime routine. 1230 // Do tail-call to runtime routine.
1231 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); 1231 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
1232 __ TailCallExternalReference(ref, 3, 1); 1232 __ TailCallExternalReference(ref, 3, 1);
1233 } 1233 }
1234 1234
1235 1235
1236 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1236 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
1237 // ----------- S t a t e ------------- 1237 // ----------- S t a t e -------------
1238 // -- rax : value 1238 // -- rax : value
1239 // -- rcx : key 1239 // -- rcx : key
1240 // -- rdx : receiver 1240 // -- rdx : receiver
1241 // -- rsp[0] : return address 1241 // -- rsp[0] : return address
1242 // ----------------------------------- 1242 // -----------------------------------
1243 1243
1244 __ PopReturnAddressTo(rbx); 1244 __ PopReturnAddressTo(rbx);
1245 __ push(rdx); // receiver 1245 __ Push(rdx); // receiver
1246 __ push(rcx); // key 1246 __ Push(rcx); // key
1247 __ push(rax); // value 1247 __ Push(rax); // value
1248 __ PushReturnAddressFrom(rbx); 1248 __ PushReturnAddressFrom(rbx);
1249 1249
1250 // Do tail-call to runtime routine. 1250 // Do tail-call to runtime routine.
1251 ExternalReference ref = 1251 ExternalReference ref =
1252 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); 1252 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
1253 __ TailCallExternalReference(ref, 3, 1); 1253 __ TailCallExternalReference(ref, 3, 1);
1254 } 1254 }
1255 1255
1256 1256
1257 #undef __ 1257 #undef __
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1321 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1322 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1322 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1323 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1323 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1324 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1324 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1325 } 1325 }
1326 1326
1327 1327
1328 } } // namespace v8::internal 1328 } } // namespace v8::internal
1329 1329
1330 #endif // V8_TARGET_ARCH_X64 1330 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698