OLD | NEW |
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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 if (key->IsHeapNumber()) { | 976 if (key->IsHeapNumber()) { |
977 double value = Handle<HeapNumber>::cast(key)->value(); | 977 double value = Handle<HeapNumber>::cast(key)->value(); |
978 if (std::isnan(value)) { | 978 if (std::isnan(value)) { |
979 key = isolate->factory()->nan_string(); | 979 key = isolate->factory()->nan_string(); |
980 } else { | 980 } else { |
981 int int_value = FastD2I(value); | 981 int int_value = FastD2I(value); |
982 if (value == int_value && Smi::IsValid(int_value)) { | 982 if (value == int_value && Smi::IsValid(int_value)) { |
983 key = Handle<Smi>(Smi::FromInt(int_value), isolate); | 983 key = Handle<Smi>(Smi::FromInt(int_value), isolate); |
984 } | 984 } |
985 } | 985 } |
| 986 } else if (key->IsString()) { |
| 987 key = isolate->factory()->InternalizeString(Handle<String>::cast(key)); |
986 } else if (key->IsUndefined()) { | 988 } else if (key->IsUndefined()) { |
987 key = isolate->factory()->undefined_string(); | 989 key = isolate->factory()->undefined_string(); |
988 } | 990 } |
989 return key; | 991 return key; |
990 } | 992 } |
991 | 993 |
992 | 994 |
993 Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) { | 995 Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) { |
994 // Don't handle megamorphic property accesses for INTERCEPTORS or CALLBACKS | 996 // Don't handle megamorphic property accesses for INTERCEPTORS or CALLBACKS |
995 // via megamorphic stubs, since they don't have a map in their relocation info | 997 // via megamorphic stubs, since they don't have a map in their relocation info |
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2815 #undef ADDR | 2817 #undef ADDR |
2816 }; | 2818 }; |
2817 | 2819 |
2818 | 2820 |
2819 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2821 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2820 return IC_utilities[id]; | 2822 return IC_utilities[id]; |
2821 } | 2823 } |
2822 | 2824 |
2823 | 2825 |
2824 } } // namespace v8::internal | 2826 } } // namespace v8::internal |
OLD | NEW |