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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 867 |
868 return object->GetProperty(*object, &lookup, *name, &attr); | 868 return object->GetProperty(*object, &lookup, *name, &attr); |
869 } | 869 } |
870 | 870 |
871 // Do not use ICs for objects that require access checks (including | 871 // Do not use ICs for objects that require access checks (including |
872 // the global object). | 872 // the global object). |
873 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); | 873 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); |
874 | 874 |
875 if (use_ic) { | 875 if (use_ic) { |
876 Code* stub = generic_stub(); | 876 Code* stub = generic_stub(); |
877 if (object->IsJSObject()) { | 877 if (object->IsString() && key->IsNumber()) { |
| 878 stub = string_stub(); |
| 879 } else if (object->IsJSObject()) { |
878 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 880 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
879 if (receiver->HasExternalArrayElements()) { | 881 if (receiver->HasExternalArrayElements()) { |
880 stub = external_array_stub(receiver->GetElementsKind()); | 882 stub = external_array_stub(receiver->GetElementsKind()); |
881 } | 883 } |
882 } | 884 } |
883 set_target(stub); | 885 set_target(stub); |
884 // For JSObjects that are not value wrappers and that do not have | 886 // For JSObjects that are not value wrappers and that do not have |
885 // indexed interceptors, we initialize the inlined fast case (if | 887 // indexed interceptors, we initialize the inlined fast case (if |
886 // present) by patching the inlined map check. | 888 // present) by patching the inlined map check. |
887 if (object->IsJSObject() && | 889 if (object->IsJSObject() && |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 #undef ADDR | 1417 #undef ADDR |
1416 }; | 1418 }; |
1417 | 1419 |
1418 | 1420 |
1419 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1421 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1420 return IC_utilities[id]; | 1422 return IC_utilities[id]; |
1421 } | 1423 } |
1422 | 1424 |
1423 | 1425 |
1424 } } // namespace v8::internal | 1426 } } // namespace v8::internal |
OLD | NEW |