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

Side by Side Diff: src/ic.cc

Issue 162983003: Internalize string keys in Keyed{Store,Load}IC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/factory.cc ('k') | src/objects.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 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
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
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
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698