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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 | 971 |
972 // Check if the given name is an array index. | 972 // Check if the given name is an array index. |
973 uint32_t index; | 973 uint32_t index; |
974 if (name->AsArrayIndex(&index)) { | 974 if (name->AsArrayIndex(&index)) { |
975 HandleScope scope; | 975 HandleScope scope; |
976 Handle<Object> result = SetElement(receiver, index, value); | 976 Handle<Object> result = SetElement(receiver, index, value); |
977 if (result.is_null()) return Failure::Exception(); | 977 if (result.is_null()) return Failure::Exception(); |
978 return *value; | 978 return *value; |
979 } | 979 } |
980 | 980 |
981 // TODO(X64): Enable inline cache for StoreIC. | |
982 #ifdef V8_TARGET_ARCH_X64 | |
983 USE(&LookupForWrite); // The compiler complains otherwise. | |
984 #else | |
985 // Lookup the property locally in the receiver. | 981 // Lookup the property locally in the receiver. |
986 if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) { | 982 if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) { |
987 LookupResult lookup; | 983 LookupResult lookup; |
988 if (LookupForWrite(*receiver, *name, &lookup)) { | 984 if (LookupForWrite(*receiver, *name, &lookup)) { |
989 UpdateCaches(&lookup, state, receiver, name, value); | 985 UpdateCaches(&lookup, state, receiver, name, value); |
990 } | 986 } |
991 } | 987 } |
992 #endif | |
993 | 988 |
994 // Set the property. | 989 // Set the property. |
995 return receiver->SetProperty(*name, *value, NONE); | 990 return receiver->SetProperty(*name, *value, NONE); |
996 } | 991 } |
997 | 992 |
998 | 993 |
999 void StoreIC::UpdateCaches(LookupResult* lookup, | 994 void StoreIC::UpdateCaches(LookupResult* lookup, |
1000 State state, | 995 State state, |
1001 Handle<JSObject> receiver, | 996 Handle<JSObject> receiver, |
1002 Handle<String> name, | 997 Handle<String> name, |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 #undef ADDR | 1369 #undef ADDR |
1375 }; | 1370 }; |
1376 | 1371 |
1377 | 1372 |
1378 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1373 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1379 return IC_utilities[id]; | 1374 return IC_utilities[id]; |
1380 } | 1375 } |
1381 | 1376 |
1382 | 1377 |
1383 } } // namespace v8::internal | 1378 } } // namespace v8::internal |
OLD | NEW |