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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 2853003: Port KeyedCallIC implementation to x64 and ARM.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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/arm/ic-arm.cc ('k') | src/arm/virtual-frame-arm.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 // Tear down temporary frame. 1012 // Tear down temporary frame.
1013 __ LeaveInternalFrame(); 1013 __ LeaveInternalFrame();
1014 1014
1015 // Do a tail-call of the compiled function. 1015 // Do a tail-call of the compiled function.
1016 __ Jump(r2); 1016 __ Jump(r2);
1017 1017
1018 return GetCodeWithFlags(flags, "LazyCompileStub"); 1018 return GetCodeWithFlags(flags, "LazyCompileStub");
1019 } 1019 }
1020 1020
1021 1021
1022 void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
1023 if (kind_ == Code::KEYED_CALL_IC) {
1024 __ cmp(r2, Operand(Handle<String>(name)));
1025 __ b(ne, miss);
1026 }
1027 }
1028
1029
1022 void CallStubCompiler::GenerateMissBranch() { 1030 void CallStubCompiler::GenerateMissBranch() {
1023 Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_); 1031 Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_);
1024 __ Jump(ic, RelocInfo::CODE_TARGET); 1032 __ Jump(ic, RelocInfo::CODE_TARGET);
1025 } 1033 }
1026 1034
1027 1035
1028 Object* CallStubCompiler::CompileCallField(JSObject* object, 1036 Object* CallStubCompiler::CompileCallField(JSObject* object,
1029 JSObject* holder, 1037 JSObject* holder,
1030 int index, 1038 int index,
1031 String* name) { 1039 String* name) {
1032 // ----------- S t a t e ------------- 1040 // ----------- S t a t e -------------
1033 // -- r2 : name 1041 // -- r2 : name
1034 // -- lr : return address 1042 // -- lr : return address
1035 // ----------------------------------- 1043 // -----------------------------------
1036 Label miss; 1044 Label miss;
1037 1045
1046 GenerateNameCheck(name, &miss);
1047
1038 const int argc = arguments().immediate(); 1048 const int argc = arguments().immediate();
1039 1049
1040 // Get the receiver of the function from the stack into r0. 1050 // Get the receiver of the function from the stack into r0.
1041 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); 1051 __ ldr(r0, MemOperand(sp, argc * kPointerSize));
1042 // Check that the receiver isn't a smi. 1052 // Check that the receiver isn't a smi.
1043 __ tst(r0, Operand(kSmiTagMask)); 1053 __ tst(r0, Operand(kSmiTagMask));
1044 __ b(eq, &miss); 1054 __ b(eq, &miss);
1045 1055
1046 // Do the right check and compute the holder register. 1056 // Do the right check and compute the holder register.
1047 Register reg = CheckPrototypes(object, r0, holder, r1, r3, name, &miss); 1057 Register reg = CheckPrototypes(object, r0, holder, r1, r3, name, &miss);
(...skipping 23 matching lines...) Expand all
1071 // If object is not an array, bail out to regular call. 1081 // If object is not an array, bail out to regular call.
1072 if (!object->IsJSArray()) { 1082 if (!object->IsJSArray()) {
1073 return Heap::undefined_value(); 1083 return Heap::undefined_value();
1074 } 1084 }
1075 1085
1076 // TODO(639): faster implementation. 1086 // TODO(639): faster implementation.
1077 ASSERT(check == RECEIVER_MAP_CHECK); 1087 ASSERT(check == RECEIVER_MAP_CHECK);
1078 1088
1079 Label miss; 1089 Label miss;
1080 1090
1091 GenerateNameCheck(name, &miss);
1092
1081 // Get the receiver from the stack 1093 // Get the receiver from the stack
1082 const int argc = arguments().immediate(); 1094 const int argc = arguments().immediate();
1083 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); 1095 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1084 1096
1085 // Check that the receiver isn't a smi. 1097 // Check that the receiver isn't a smi.
1086 __ tst(r1, Operand(kSmiTagMask)); 1098 __ tst(r1, Operand(kSmiTagMask));
1087 __ b(eq, &miss); 1099 __ b(eq, &miss);
1088 1100
1089 // Check that the maps haven't changed. 1101 // Check that the maps haven't changed.
1090 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss); 1102 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);
(...skipping 29 matching lines...) Expand all
1120 // If object is not an array, bail out to regular call. 1132 // If object is not an array, bail out to regular call.
1121 if (!object->IsJSArray()) { 1133 if (!object->IsJSArray()) {
1122 return Heap::undefined_value(); 1134 return Heap::undefined_value();
1123 } 1135 }
1124 1136
1125 // TODO(642): faster implementation. 1137 // TODO(642): faster implementation.
1126 ASSERT(check == RECEIVER_MAP_CHECK); 1138 ASSERT(check == RECEIVER_MAP_CHECK);
1127 1139
1128 Label miss; 1140 Label miss;
1129 1141
1142 GenerateNameCheck(name, &miss);
1143
1130 // Get the receiver from the stack 1144 // Get the receiver from the stack
1131 const int argc = arguments().immediate(); 1145 const int argc = arguments().immediate();
1132 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); 1146 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1133 1147
1134 // Check that the receiver isn't a smi. 1148 // Check that the receiver isn't a smi.
1135 __ tst(r1, Operand(kSmiTagMask)); 1149 __ tst(r1, Operand(kSmiTagMask));
1136 __ b(eq, &miss); 1150 __ b(eq, &miss);
1137 1151
1138 // Check that the maps haven't changed. 1152 // Check that the maps haven't changed.
1139 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss); 1153 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 Object* result = 1205 Object* result =
1192 CompileCustomCall(id, object, holder, function, name, check); 1206 CompileCustomCall(id, object, holder, function, name, check);
1193 // undefined means bail out to regular compiler. 1207 // undefined means bail out to regular compiler.
1194 if (!result->IsUndefined()) { 1208 if (!result->IsUndefined()) {
1195 return result; 1209 return result;
1196 } 1210 }
1197 } 1211 }
1198 1212
1199 Label miss_in_smi_check; 1213 Label miss_in_smi_check;
1200 1214
1215 GenerateNameCheck(name, &miss_in_smi_check);
1216
1201 // Get the receiver from the stack 1217 // Get the receiver from the stack
1202 const int argc = arguments().immediate(); 1218 const int argc = arguments().immediate();
1203 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); 1219 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1204 1220
1205 // Check that the receiver isn't a smi. 1221 // Check that the receiver isn't a smi.
1206 if (check != NUMBER_CHECK) { 1222 if (check != NUMBER_CHECK) {
1207 __ tst(r1, Operand(kSmiTagMask)); 1223 __ tst(r1, Operand(kSmiTagMask));
1208 __ b(eq, &miss_in_smi_check); 1224 __ b(eq, &miss_in_smi_check);
1209 } 1225 }
1210 1226
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, 1346 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1331 JSObject* holder, 1347 JSObject* holder,
1332 String* name) { 1348 String* name) {
1333 // ----------- S t a t e ------------- 1349 // ----------- S t a t e -------------
1334 // -- r2 : name 1350 // -- r2 : name
1335 // -- lr : return address 1351 // -- lr : return address
1336 // ----------------------------------- 1352 // -----------------------------------
1337 1353
1338 Label miss; 1354 Label miss;
1339 1355
1356 GenerateNameCheck(name, &miss);
1357
1340 // Get the number of arguments. 1358 // Get the number of arguments.
1341 const int argc = arguments().immediate(); 1359 const int argc = arguments().immediate();
1342 1360
1343 LookupResult lookup; 1361 LookupResult lookup;
1344 LookupPostInterceptor(holder, name, &lookup); 1362 LookupPostInterceptor(holder, name, &lookup);
1345 1363
1346 // Get the receiver from the stack. 1364 // Get the receiver from the stack.
1347 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); 1365 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
1348 1366
1349 CallInterceptorCompiler compiler(this, arguments(), r2); 1367 CallInterceptorCompiler compiler(this, arguments(), r2);
(...skipping 27 matching lines...) Expand all
1377 GlobalObject* holder, 1395 GlobalObject* holder,
1378 JSGlobalPropertyCell* cell, 1396 JSGlobalPropertyCell* cell,
1379 JSFunction* function, 1397 JSFunction* function,
1380 String* name) { 1398 String* name) {
1381 // ----------- S t a t e ------------- 1399 // ----------- S t a t e -------------
1382 // -- r2 : name 1400 // -- r2 : name
1383 // -- lr : return address 1401 // -- lr : return address
1384 // ----------------------------------- 1402 // -----------------------------------
1385 Label miss; 1403 Label miss;
1386 1404
1405 GenerateNameCheck(name, &miss);
1406
1387 // Get the number of arguments. 1407 // Get the number of arguments.
1388 const int argc = arguments().immediate(); 1408 const int argc = arguments().immediate();
1389 1409
1390 // Get the receiver from the stack. 1410 // Get the receiver from the stack.
1391 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); 1411 __ ldr(r0, MemOperand(sp, argc * kPointerSize));
1392 1412
1393 // If the object is the holder then we know that it's a global 1413 // If the object is the holder then we know that it's a global
1394 // object which can only happen for contextual calls. In this case, 1414 // object which can only happen for contextual calls. In this case,
1395 // the receiver cannot be a smi. 1415 // the receiver cannot be a smi.
1396 if (object != holder) { 1416 if (object != holder) {
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 // Return the generated code. 2150 // Return the generated code.
2131 return GetCode(); 2151 return GetCode();
2132 } 2152 }
2133 2153
2134 2154
2135 #undef __ 2155 #undef __
2136 2156
2137 } } // namespace v8::internal 2157 } } // namespace v8::internal
2138 2158
2139 #endif // V8_TARGET_ARCH_ARM 2159 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/virtual-frame-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698