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

Side by Side Diff: src/ic.cc

Issue 6287030: Create specialized code stubs for PixelArray loads. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: review feedback 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/ia32/stub-cache-ia32.cc ('k') | src/runtime.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 StubCache::ComputeKeyedLoadOrStoreExternalArray(*receiver, false); 1213 MaybeObject* probe =
1214 stub = 1214 StubCache::ComputeKeyedLoadOrStoreExternalArray(*receiver,
1215 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked()); 1215 false);
1216 } else if (receiver->HasIndexedInterceptor()) { 1216 stub = probe->IsFailure() ?
1217 stub = indexed_interceptor_stub(); 1217 NULL : Code::cast(probe->ToObjectUnchecked());
1218 } else if (state == UNINITIALIZED && 1218 } else if (receiver->HasIndexedInterceptor()) {
1219 key->IsSmi() && 1219 stub = indexed_interceptor_stub();
1220 receiver->map()->has_fast_elements()) { 1220 } else if (receiver->HasPixelElements()) {
1221 MaybeObject* probe = StubCache::ComputeKeyedLoadSpecialized(*receiver); 1221 MaybeObject* probe =
1222 stub = 1222 StubCache::ComputeKeyedLoadPixelArray(*receiver);
1223 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked()); 1223 stub = probe->IsFailure() ?
1224 NULL : Code::cast(probe->ToObjectUnchecked());
1225 } else if (key->IsSmi() &&
1226 receiver->map()->has_fast_elements()) {
1227 MaybeObject* probe =
1228 StubCache::ComputeKeyedLoadSpecialized(*receiver);
1229 stub = probe->IsFailure() ?
1230 NULL : Code::cast(probe->ToObjectUnchecked());
1231 }
1224 } 1232 }
1225 } 1233 }
1226 if (stub != NULL) set_target(stub); 1234 if (stub != NULL) set_target(stub);
1227 1235
1228 #ifdef DEBUG 1236 #ifdef DEBUG
1229 TraceIC("KeyedLoadIC", key, state, target()); 1237 TraceIC("KeyedLoadIC", key, state, target());
1230 #endif // DEBUG 1238 #endif // DEBUG
1231 1239
1232 // For JSObjects with fast elements that are not value wrappers 1240 // For JSObjects with fast elements that are not value wrappers
1233 // and that do not have indexed interceptors, we initialize the 1241 // 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 2253 #undef ADDR
2246 }; 2254 };
2247 2255
2248 2256
2249 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2257 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2250 return IC_utilities[id]; 2258 return IC_utilities[id];
2251 } 2259 }
2252 2260
2253 2261
2254 } } // namespace v8::internal 2262 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698