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

Side by Side Diff: src/ic.cc

Issue 6323002: Add custom typed ICs for pixel array loads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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/ic.h ('k') | src/x64/ic-x64.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 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 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 1197
1198 return object->GetProperty(*object, &lookup, *name, &attr); 1198 return object->GetProperty(*object, &lookup, *name, &attr);
1199 } 1199 }
1200 1200
1201 // Do not use ICs for objects that require access checks (including 1201 // Do not use ICs for objects that require access checks (including
1202 // the global object). 1202 // the global object).
1203 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); 1203 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded();
1204 1204
1205 if (use_ic) { 1205 if (use_ic) {
1206 Code* stub = generic_stub(); 1206 Code* stub = generic_stub();
1207 if (object->IsString() && key->IsNumber()) { 1207 if (state == UNINITIALIZED) {
1208 stub = string_stub(); 1208 if (object->IsString() && key->IsNumber()) {
1209 } else if (object->IsJSObject()) { 1209 stub = string_stub();
1210 Handle<JSObject> receiver = Handle<JSObject>::cast(object); 1210 } else if (object->IsJSObject()) {
1211 if (receiver->HasExternalArrayElements()) { 1211 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1212 MaybeObject* probe = 1212 if (receiver->HasExternalArrayElements()) {
1213 MaybeObject* probe =
1213 StubCache::ComputeKeyedLoadOrStoreExternalArray(*receiver, false); 1214 StubCache::ComputeKeyedLoadOrStoreExternalArray(*receiver, false);
1214 stub = 1215 stub =
1215 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked()); 1216 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked());
1216 } else if (receiver->HasIndexedInterceptor()) { 1217 } else if (receiver->HasPixelElements()) {
1217 stub = indexed_interceptor_stub(); 1218 stub = pixel_array_stub();
1218 } else if (state == UNINITIALIZED && 1219 } else if (receiver->HasIndexedInterceptor()) {
1219 key->IsSmi() && 1220 stub = indexed_interceptor_stub();
1220 receiver->map()->has_fast_elements()) { 1221 } else if (key->IsSmi() &&
1221 MaybeObject* probe = StubCache::ComputeKeyedLoadSpecialized(*receiver); 1222 receiver->map()->has_fast_elements()) {
1222 stub = 1223 MaybeObject* probe =
1224 StubCache::ComputeKeyedLoadSpecialized(*receiver);
1225 stub =
1223 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked()); 1226 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked());
1227 }
1224 } 1228 }
1225 } 1229 }
1226 if (stub != NULL) set_target(stub); 1230 if (stub != NULL) set_target(stub);
1227 1231
1228 #ifdef DEBUG 1232 #ifdef DEBUG
1229 TraceIC("KeyedLoadIC", key, state, target()); 1233 TraceIC("KeyedLoadIC", key, state, target());
1230 #endif // DEBUG 1234 #endif // DEBUG
1231 1235
1232 // For JSObjects with fast elements that are not value wrappers 1236 // For JSObjects with fast elements that are not value wrappers
1233 // and that do not have indexed interceptors, we initialize the 1237 // and that do not have indexed interceptors, we initialize the
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 #undef ADDR 2249 #undef ADDR
2246 }; 2250 };
2247 2251
2248 2252
2249 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2253 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2250 return IC_utilities[id]; 2254 return IC_utilities[id];
2251 } 2255 }
2252 2256
2253 2257
2254 } } // namespace v8::internal 2258 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.h ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698