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

Side by Side Diff: src/ic.cc

Issue 6670115: Improve property access with keys that can always be converted into a symbol string. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 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/heap.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 1136
1137 #ifdef DEBUG 1137 #ifdef DEBUG
1138 TraceIC("LoadIC", name, state, target()); 1138 TraceIC("LoadIC", name, state, target());
1139 #endif 1139 #endif
1140 } 1140 }
1141 1141
1142 1142
1143 MaybeObject* KeyedLoadIC::Load(State state, 1143 MaybeObject* KeyedLoadIC::Load(State state,
1144 Handle<Object> object, 1144 Handle<Object> object,
1145 Handle<Object> key) { 1145 Handle<Object> key) {
1146 // Check for values that can be converted into a symbol.
Mads Ager (chromium) 2011/03/31 09:41:49 Could you file a bug report stating that this is p
1147 HandleScope scope(isolate());
1148 if (key->IsHeapNumber() &&
1149 isnan(HeapNumber::cast(*key)->value())) {
1150 key = isolate()->factory()->nan_symbol();
1151 } else if (key->IsUndefined()) {
1152 key = isolate()->factory()->undefined_symbol();
1153 }
1154
1146 if (key->IsSymbol()) { 1155 if (key->IsSymbol()) {
1147 Handle<String> name = Handle<String>::cast(key); 1156 Handle<String> name = Handle<String>::cast(key);
1148 1157
1149 // If the object is undefined or null it's illegal to try to get any 1158 // If the object is undefined or null it's illegal to try to get any
1150 // of its properties; throw a TypeError in that case. 1159 // of its properties; throw a TypeError in that case.
1151 if (object->IsUndefined() || object->IsNull()) { 1160 if (object->IsUndefined() || object->IsNull()) {
1152 return TypeError("non_object_property_load", object, name); 1161 return TypeError("non_object_property_load", object, name);
1153 } 1162 }
1154 1163
1155 if (FLAG_use_ic) { 1164 if (FLAG_use_ic) {
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 #undef ADDR 2379 #undef ADDR
2371 }; 2380 };
2372 2381
2373 2382
2374 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2383 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2375 return IC_utilities[id]; 2384 return IC_utilities[id];
2376 } 2385 }
2377 2386
2378 2387
2379 } } // namespace v8::internal 2388 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698