| OLD | NEW |
| 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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 // -- eax : value | 1003 // -- eax : value |
| 1004 // -- ecx : name | 1004 // -- ecx : name |
| 1005 // -- esp[0] : return address | 1005 // -- esp[0] : return address |
| 1006 // -- esp[4] : receiver | 1006 // -- esp[4] : receiver |
| 1007 // ----------------------------------- | 1007 // ----------------------------------- |
| 1008 Label miss; | 1008 Label miss; |
| 1009 | 1009 |
| 1010 __ IncrementCounter(&Counters::named_store_global_inline, 1); | 1010 __ IncrementCounter(&Counters::named_store_global_inline, 1); |
| 1011 | 1011 |
| 1012 // Check that the map of the global has not changed. | 1012 // Check that the map of the global has not changed. |
| 1013 __ mov(ebx, (Operand(esp, kPointerSize))); | 1013 __ mov(ebx, Operand(esp, kPointerSize)); |
| 1014 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), | 1014 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), |
| 1015 Immediate(Handle<Map>(object->map()))); | 1015 Immediate(Handle<Map>(object->map()))); |
| 1016 __ j(not_equal, &miss, not_taken); | 1016 __ j(not_equal, &miss, not_taken); |
| 1017 | 1017 |
| 1018 // Store the value in the cell. | 1018 // Store the value in the cell. |
| 1019 __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell))); | 1019 __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell))); |
| 1020 __ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax); | 1020 __ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax); |
| 1021 | 1021 |
| 1022 // Return the value (register eax). | 1022 // Return the value (register eax). |
| 1023 __ ret(0); | 1023 __ ret(0); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 JSObject* holder, | 1082 JSObject* holder, |
| 1083 int index, | 1083 int index, |
| 1084 String* name) { | 1084 String* name) { |
| 1085 // ----------- S t a t e ------------- | 1085 // ----------- S t a t e ------------- |
| 1086 // -- ecx : name | 1086 // -- ecx : name |
| 1087 // -- esp[0] : return address | 1087 // -- esp[0] : return address |
| 1088 // -- esp[4] : receiver | 1088 // -- esp[4] : receiver |
| 1089 // ----------------------------------- | 1089 // ----------------------------------- |
| 1090 Label miss; | 1090 Label miss; |
| 1091 | 1091 |
| 1092 __ mov(eax, (Operand(esp, kPointerSize))); | 1092 __ mov(eax, Operand(esp, kPointerSize)); |
| 1093 GenerateLoadField(object, holder, eax, ebx, edx, index, name, &miss); | 1093 GenerateLoadField(object, holder, eax, ebx, edx, index, name, &miss); |
| 1094 __ bind(&miss); | 1094 __ bind(&miss); |
| 1095 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1095 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 1096 | 1096 |
| 1097 // Return the generated code. | 1097 // Return the generated code. |
| 1098 return GetCode(FIELD, name); | 1098 return GetCode(FIELD, name); |
| 1099 } | 1099 } |
| 1100 | 1100 |
| 1101 | 1101 |
| 1102 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, | 1102 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, |
| 1103 JSObject* holder, | 1103 JSObject* holder, |
| 1104 AccessorInfo* callback, | 1104 AccessorInfo* callback, |
| 1105 String* name) { | 1105 String* name) { |
| 1106 // ----------- S t a t e ------------- | 1106 // ----------- S t a t e ------------- |
| 1107 // -- ecx : name | 1107 // -- ecx : name |
| 1108 // -- esp[0] : return address | 1108 // -- esp[0] : return address |
| 1109 // -- esp[4] : receiver | 1109 // -- esp[4] : receiver |
| 1110 // ----------------------------------- | 1110 // ----------------------------------- |
| 1111 Label miss; | 1111 Label miss; |
| 1112 | 1112 |
| 1113 __ mov(eax, (Operand(esp, kPointerSize))); | 1113 __ mov(eax, Operand(esp, kPointerSize)); |
| 1114 GenerateLoadCallback(object, holder, eax, ecx, ebx, edx, | 1114 GenerateLoadCallback(object, holder, eax, ecx, ebx, edx, |
| 1115 callback, name, &miss); | 1115 callback, name, &miss); |
| 1116 __ bind(&miss); | 1116 __ bind(&miss); |
| 1117 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1117 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 1118 | 1118 |
| 1119 // Return the generated code. | 1119 // Return the generated code. |
| 1120 return GetCode(CALLBACKS, name); | 1120 return GetCode(CALLBACKS, name); |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 | 1123 |
| 1124 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 1124 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
| 1125 JSObject* holder, | 1125 JSObject* holder, |
| 1126 Object* value, | 1126 Object* value, |
| 1127 String* name) { | 1127 String* name) { |
| 1128 // ----------- S t a t e ------------- | 1128 // ----------- S t a t e ------------- |
| 1129 // -- ecx : name | 1129 // -- ecx : name |
| 1130 // -- esp[0] : return address | 1130 // -- esp[0] : return address |
| 1131 // -- esp[4] : receiver | 1131 // -- esp[4] : receiver |
| 1132 // ----------------------------------- | 1132 // ----------------------------------- |
| 1133 Label miss; | 1133 Label miss; |
| 1134 | 1134 |
| 1135 __ mov(eax, (Operand(esp, kPointerSize))); | 1135 __ mov(eax, Operand(esp, kPointerSize)); |
| 1136 GenerateLoadConstant(object, holder, eax, ebx, edx, value, name, &miss); | 1136 GenerateLoadConstant(object, holder, eax, ebx, edx, value, name, &miss); |
| 1137 __ bind(&miss); | 1137 __ bind(&miss); |
| 1138 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1138 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 1139 | 1139 |
| 1140 // Return the generated code. | 1140 // Return the generated code. |
| 1141 return GetCode(CONSTANT_FUNCTION, name); | 1141 return GetCode(CONSTANT_FUNCTION, name); |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 | 1144 |
| 1145 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, | 1145 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, |
| 1146 JSObject* holder, | 1146 JSObject* holder, |
| 1147 String* name) { | 1147 String* name) { |
| 1148 // ----------- S t a t e ------------- | 1148 // ----------- S t a t e ------------- |
| 1149 // -- ecx : name | 1149 // -- ecx : name |
| 1150 // -- esp[0] : return address | 1150 // -- esp[0] : return address |
| 1151 // -- esp[4] : receiver | 1151 // -- esp[4] : receiver |
| 1152 // ----------------------------------- | 1152 // ----------------------------------- |
| 1153 Label miss; | 1153 Label miss; |
| 1154 | 1154 |
| 1155 __ mov(eax, (Operand(esp, kPointerSize))); | 1155 __ mov(eax, Operand(esp, kPointerSize)); |
| 1156 // TODO(368): Compile in the whole chain: all the interceptors in | 1156 // TODO(368): Compile in the whole chain: all the interceptors in |
| 1157 // prototypes and ultimate answer. | 1157 // prototypes and ultimate answer. |
| 1158 GenerateLoadInterceptor(receiver, | 1158 GenerateLoadInterceptor(receiver, |
| 1159 holder, | 1159 holder, |
| 1160 holder->InterceptorPropertyLookupHint(name), | 1160 holder->InterceptorPropertyLookupHint(name), |
| 1161 eax, | 1161 eax, |
| 1162 ecx, | 1162 ecx, |
| 1163 edx, | 1163 edx, |
| 1164 ebx, | 1164 ebx, |
| 1165 name, | 1165 name, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1181 // ----------- S t a t e ------------- | 1181 // ----------- S t a t e ------------- |
| 1182 // -- ecx : name | 1182 // -- ecx : name |
| 1183 // -- esp[0] : return address | 1183 // -- esp[0] : return address |
| 1184 // -- esp[4] : receiver | 1184 // -- esp[4] : receiver |
| 1185 // ----------------------------------- | 1185 // ----------------------------------- |
| 1186 Label miss; | 1186 Label miss; |
| 1187 | 1187 |
| 1188 __ IncrementCounter(&Counters::named_load_global_inline, 1); | 1188 __ IncrementCounter(&Counters::named_load_global_inline, 1); |
| 1189 | 1189 |
| 1190 // Get the receiver from the stack. | 1190 // Get the receiver from the stack. |
| 1191 __ mov(eax, (Operand(esp, kPointerSize))); | 1191 __ mov(eax, Operand(esp, kPointerSize)); |
| 1192 | 1192 |
| 1193 // If the object is the holder then we know that it's a global | 1193 // If the object is the holder then we know that it's a global |
| 1194 // object which can only happen for contextual loads. In this case, | 1194 // object which can only happen for contextual loads. In this case, |
| 1195 // the receiver cannot be a smi. | 1195 // the receiver cannot be a smi. |
| 1196 if (object != holder) { | 1196 if (object != holder) { |
| 1197 __ test(eax, Immediate(kSmiTagMask)); | 1197 __ test(eax, Immediate(kSmiTagMask)); |
| 1198 __ j(zero, &miss, not_taken); | 1198 __ j(zero, &miss, not_taken); |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 // Check that the maps haven't changed. | 1201 // Check that the maps haven't changed. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1230 JSObject* receiver, | 1230 JSObject* receiver, |
| 1231 JSObject* holder, | 1231 JSObject* holder, |
| 1232 int index) { | 1232 int index) { |
| 1233 // ----------- S t a t e ------------- | 1233 // ----------- S t a t e ------------- |
| 1234 // -- esp[0] : return address | 1234 // -- esp[0] : return address |
| 1235 // -- esp[4] : name | 1235 // -- esp[4] : name |
| 1236 // -- esp[8] : receiver | 1236 // -- esp[8] : receiver |
| 1237 // ----------------------------------- | 1237 // ----------------------------------- |
| 1238 Label miss; | 1238 Label miss; |
| 1239 | 1239 |
| 1240 __ mov(eax, (Operand(esp, kPointerSize))); | 1240 __ mov(eax, Operand(esp, kPointerSize)); |
| 1241 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1241 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1242 __ IncrementCounter(&Counters::keyed_load_field, 1); | 1242 __ IncrementCounter(&Counters::keyed_load_field, 1); |
| 1243 | 1243 |
| 1244 // Check that the name has not changed. | 1244 // Check that the name has not changed. |
| 1245 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1245 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1246 __ j(not_equal, &miss, not_taken); | 1246 __ j(not_equal, &miss, not_taken); |
| 1247 | 1247 |
| 1248 GenerateLoadField(receiver, holder, ecx, ebx, edx, index, name, &miss); | 1248 GenerateLoadField(receiver, holder, ecx, ebx, edx, index, name, &miss); |
| 1249 | 1249 |
| 1250 __ bind(&miss); | 1250 __ bind(&miss); |
| 1251 __ DecrementCounter(&Counters::keyed_load_field, 1); | 1251 __ DecrementCounter(&Counters::keyed_load_field, 1); |
| 1252 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1252 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1253 | 1253 |
| 1254 // Return the generated code. | 1254 // Return the generated code. |
| 1255 return GetCode(FIELD, name); | 1255 return GetCode(FIELD, name); |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 | 1258 |
| 1259 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, | 1259 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, |
| 1260 JSObject* receiver, | 1260 JSObject* receiver, |
| 1261 JSObject* holder, | 1261 JSObject* holder, |
| 1262 AccessorInfo* callback) { | 1262 AccessorInfo* callback) { |
| 1263 // ----------- S t a t e ------------- | 1263 // ----------- S t a t e ------------- |
| 1264 // -- esp[0] : return address | 1264 // -- esp[0] : return address |
| 1265 // -- esp[4] : name | 1265 // -- esp[4] : name |
| 1266 // -- esp[8] : receiver | 1266 // -- esp[8] : receiver |
| 1267 // ----------------------------------- | 1267 // ----------------------------------- |
| 1268 Label miss; | 1268 Label miss; |
| 1269 | 1269 |
| 1270 __ mov(eax, (Operand(esp, kPointerSize))); | 1270 __ mov(eax, Operand(esp, kPointerSize)); |
| 1271 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1271 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1272 __ IncrementCounter(&Counters::keyed_load_callback, 1); | 1272 __ IncrementCounter(&Counters::keyed_load_callback, 1); |
| 1273 | 1273 |
| 1274 // Check that the name has not changed. | 1274 // Check that the name has not changed. |
| 1275 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1275 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1276 __ j(not_equal, &miss, not_taken); | 1276 __ j(not_equal, &miss, not_taken); |
| 1277 | 1277 |
| 1278 GenerateLoadCallback(receiver, holder, ecx, eax, ebx, edx, | 1278 GenerateLoadCallback(receiver, holder, ecx, eax, ebx, edx, |
| 1279 callback, name, &miss); | 1279 callback, name, &miss); |
| 1280 __ bind(&miss); | 1280 __ bind(&miss); |
| 1281 __ DecrementCounter(&Counters::keyed_load_callback, 1); | 1281 __ DecrementCounter(&Counters::keyed_load_callback, 1); |
| 1282 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1282 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1283 | 1283 |
| 1284 // Return the generated code. | 1284 // Return the generated code. |
| 1285 return GetCode(CALLBACKS, name); | 1285 return GetCode(CALLBACKS, name); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 | 1288 |
| 1289 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | 1289 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
| 1290 JSObject* receiver, | 1290 JSObject* receiver, |
| 1291 JSObject* holder, | 1291 JSObject* holder, |
| 1292 Object* value) { | 1292 Object* value) { |
| 1293 // ----------- S t a t e ------------- | 1293 // ----------- S t a t e ------------- |
| 1294 // -- esp[0] : return address | 1294 // -- esp[0] : return address |
| 1295 // -- esp[4] : name | 1295 // -- esp[4] : name |
| 1296 // -- esp[8] : receiver | 1296 // -- esp[8] : receiver |
| 1297 // ----------------------------------- | 1297 // ----------------------------------- |
| 1298 Label miss; | 1298 Label miss; |
| 1299 | 1299 |
| 1300 __ mov(eax, (Operand(esp, kPointerSize))); | 1300 __ mov(eax, Operand(esp, kPointerSize)); |
| 1301 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1301 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1302 __ IncrementCounter(&Counters::keyed_load_constant_function, 1); | 1302 __ IncrementCounter(&Counters::keyed_load_constant_function, 1); |
| 1303 | 1303 |
| 1304 // Check that the name has not changed. | 1304 // Check that the name has not changed. |
| 1305 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1305 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1306 __ j(not_equal, &miss, not_taken); | 1306 __ j(not_equal, &miss, not_taken); |
| 1307 | 1307 |
| 1308 GenerateLoadConstant(receiver, holder, ecx, ebx, edx, | 1308 GenerateLoadConstant(receiver, holder, ecx, ebx, edx, |
| 1309 value, name, &miss); | 1309 value, name, &miss); |
| 1310 __ bind(&miss); | 1310 __ bind(&miss); |
| 1311 __ DecrementCounter(&Counters::keyed_load_constant_function, 1); | 1311 __ DecrementCounter(&Counters::keyed_load_constant_function, 1); |
| 1312 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1312 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1313 | 1313 |
| 1314 // Return the generated code. | 1314 // Return the generated code. |
| 1315 return GetCode(CONSTANT_FUNCTION, name); | 1315 return GetCode(CONSTANT_FUNCTION, name); |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 | 1318 |
| 1319 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, | 1319 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, |
| 1320 JSObject* holder, | 1320 JSObject* holder, |
| 1321 String* name) { | 1321 String* name) { |
| 1322 // ----------- S t a t e ------------- | 1322 // ----------- S t a t e ------------- |
| 1323 // -- esp[0] : return address | 1323 // -- esp[0] : return address |
| 1324 // -- esp[4] : name | 1324 // -- esp[4] : name |
| 1325 // -- esp[8] : receiver | 1325 // -- esp[8] : receiver |
| 1326 // ----------------------------------- | 1326 // ----------------------------------- |
| 1327 Label miss; | 1327 Label miss; |
| 1328 | 1328 |
| 1329 __ mov(eax, (Operand(esp, kPointerSize))); | 1329 __ mov(eax, Operand(esp, kPointerSize)); |
| 1330 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1330 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1331 __ IncrementCounter(&Counters::keyed_load_interceptor, 1); | 1331 __ IncrementCounter(&Counters::keyed_load_interceptor, 1); |
| 1332 | 1332 |
| 1333 // Check that the name has not changed. | 1333 // Check that the name has not changed. |
| 1334 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1334 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1335 __ j(not_equal, &miss, not_taken); | 1335 __ j(not_equal, &miss, not_taken); |
| 1336 | 1336 |
| 1337 GenerateLoadInterceptor(receiver, | 1337 GenerateLoadInterceptor(receiver, |
| 1338 holder, | 1338 holder, |
| 1339 Smi::FromInt(JSObject::kLookupInHolder), | 1339 Smi::FromInt(JSObject::kLookupInHolder), |
| 1340 ecx, | 1340 ecx, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1355 | 1355 |
| 1356 | 1356 |
| 1357 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { | 1357 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { |
| 1358 // ----------- S t a t e ------------- | 1358 // ----------- S t a t e ------------- |
| 1359 // -- esp[0] : return address | 1359 // -- esp[0] : return address |
| 1360 // -- esp[4] : name | 1360 // -- esp[4] : name |
| 1361 // -- esp[8] : receiver | 1361 // -- esp[8] : receiver |
| 1362 // ----------------------------------- | 1362 // ----------------------------------- |
| 1363 Label miss; | 1363 Label miss; |
| 1364 | 1364 |
| 1365 __ mov(eax, (Operand(esp, kPointerSize))); | 1365 __ mov(eax, Operand(esp, kPointerSize)); |
| 1366 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1366 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1367 __ IncrementCounter(&Counters::keyed_load_array_length, 1); | 1367 __ IncrementCounter(&Counters::keyed_load_array_length, 1); |
| 1368 | 1368 |
| 1369 // Check that the name has not changed. | 1369 // Check that the name has not changed. |
| 1370 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1370 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1371 __ j(not_equal, &miss, not_taken); | 1371 __ j(not_equal, &miss, not_taken); |
| 1372 | 1372 |
| 1373 GenerateLoadArrayLength(masm(), ecx, edx, &miss); | 1373 GenerateLoadArrayLength(masm(), ecx, edx, &miss); |
| 1374 __ bind(&miss); | 1374 __ bind(&miss); |
| 1375 __ DecrementCounter(&Counters::keyed_load_array_length, 1); | 1375 __ DecrementCounter(&Counters::keyed_load_array_length, 1); |
| 1376 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1376 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1377 | 1377 |
| 1378 // Return the generated code. | 1378 // Return the generated code. |
| 1379 return GetCode(CALLBACKS, name); | 1379 return GetCode(CALLBACKS, name); |
| 1380 } | 1380 } |
| 1381 | 1381 |
| 1382 | 1382 |
| 1383 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { | 1383 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { |
| 1384 // ----------- S t a t e ------------- | 1384 // ----------- S t a t e ------------- |
| 1385 // -- esp[0] : return address | 1385 // -- esp[0] : return address |
| 1386 // -- esp[4] : name | 1386 // -- esp[4] : name |
| 1387 // -- esp[8] : receiver | 1387 // -- esp[8] : receiver |
| 1388 // ----------------------------------- | 1388 // ----------------------------------- |
| 1389 Label miss; | 1389 Label miss; |
| 1390 | 1390 |
| 1391 __ mov(eax, (Operand(esp, kPointerSize))); | 1391 __ mov(eax, Operand(esp, kPointerSize)); |
| 1392 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1392 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1393 __ IncrementCounter(&Counters::keyed_load_string_length, 1); | 1393 __ IncrementCounter(&Counters::keyed_load_string_length, 1); |
| 1394 | 1394 |
| 1395 // Check that the name has not changed. | 1395 // Check that the name has not changed. |
| 1396 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1396 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1397 __ j(not_equal, &miss, not_taken); | 1397 __ j(not_equal, &miss, not_taken); |
| 1398 | 1398 |
| 1399 GenerateLoadStringLength(masm(), ecx, edx, &miss); | 1399 GenerateLoadStringLength(masm(), ecx, edx, &miss); |
| 1400 __ bind(&miss); | 1400 __ bind(&miss); |
| 1401 __ DecrementCounter(&Counters::keyed_load_string_length, 1); | 1401 __ DecrementCounter(&Counters::keyed_load_string_length, 1); |
| 1402 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1402 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1403 | 1403 |
| 1404 // Return the generated code. | 1404 // Return the generated code. |
| 1405 return GetCode(CALLBACKS, name); | 1405 return GetCode(CALLBACKS, name); |
| 1406 } | 1406 } |
| 1407 | 1407 |
| 1408 | 1408 |
| 1409 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { | 1409 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { |
| 1410 // ----------- S t a t e ------------- | 1410 // ----------- S t a t e ------------- |
| 1411 // -- esp[0] : return address | 1411 // -- esp[0] : return address |
| 1412 // -- esp[4] : name | 1412 // -- esp[4] : name |
| 1413 // -- esp[8] : receiver | 1413 // -- esp[8] : receiver |
| 1414 // ----------------------------------- | 1414 // ----------------------------------- |
| 1415 Label miss; | 1415 Label miss; |
| 1416 | 1416 |
| 1417 __ mov(eax, (Operand(esp, kPointerSize))); | 1417 __ mov(eax, Operand(esp, kPointerSize)); |
| 1418 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1418 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 1419 __ IncrementCounter(&Counters::keyed_load_function_prototype, 1); | 1419 __ IncrementCounter(&Counters::keyed_load_function_prototype, 1); |
| 1420 | 1420 |
| 1421 // Check that the name has not changed. | 1421 // Check that the name has not changed. |
| 1422 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1422 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 1423 __ j(not_equal, &miss, not_taken); | 1423 __ j(not_equal, &miss, not_taken); |
| 1424 | 1424 |
| 1425 GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss); | 1425 GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss); |
| 1426 __ bind(&miss); | 1426 __ bind(&miss); |
| 1427 __ DecrementCounter(&Counters::keyed_load_function_prototype, 1); | 1427 __ DecrementCounter(&Counters::keyed_load_function_prototype, 1); |
| 1428 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1428 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1429 | 1429 |
| 1430 // Return the generated code. | 1430 // Return the generated code. |
| 1431 return GetCode(CALLBACKS, name); | 1431 return GetCode(CALLBACKS, name); |
| 1432 } | 1432 } |
| 1433 | 1433 |
| 1434 | 1434 |
| 1435 #undef __ | 1435 #undef __ |
| 1436 | 1436 |
| 1437 } } // namespace v8::internal | 1437 } } // namespace v8::internal |
| OLD | NEW |