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

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: cleanup before review 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
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);
Mads Ager (chromium) 2011/02/01 12:02:12 Four-space indent. Which will probably lead to a l
danno 2011/02/03 12:53:26 Done.
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->HasIndexedInterceptor()) {
1217 stub = indexed_interceptor_stub(); 1218 stub = indexed_interceptor_stub();
1218 } else if (state == UNINITIALIZED && 1219 } else if (receiver->HasPixelElements()) {
1219 key->IsSmi() && 1220 MaybeObject* probe =
1220 receiver->map()->has_fast_elements()) { 1221 StubCache::ComputeKeyedLoadPixelArray(*receiver);
Mads Ager (chromium) 2011/02/01 12:02:12 Four-space indent.
danno 2011/02/03 12:53:26 Done.
1221 MaybeObject* probe = StubCache::ComputeKeyedLoadSpecialized(*receiver); 1222 stub =
1222 stub =
1223 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked()); 1223 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked());
Mads Ager (chromium) 2011/02/01 12:02:12 Four-space indent.
danno 2011/02/03 12:53:26 Done.
1224 } else if (key->IsSmi() &&
1225 receiver->map()->has_fast_elements()) {
1226 MaybeObject* probe =
1227 StubCache::ComputeKeyedLoadSpecialized(*receiver);
Mads Ager (chromium) 2011/02/01 12:02:12 Ditto.
danno 2011/02/03 12:53:26 Done.
1228 stub =
1229 probe->IsFailure() ? NULL : Code::cast(probe->ToObjectUnchecked());
Mads Ager (chromium) 2011/02/01 12:02:12 Reindent. We need four-space indent so in this cas
danno 2011/02/03 12:53:26 Done.
1230 }
1224 } 1231 }
1225 } 1232 }
1226 if (stub != NULL) set_target(stub); 1233 if (stub != NULL) set_target(stub);
1227 1234
1228 #ifdef DEBUG 1235 #ifdef DEBUG
1229 TraceIC("KeyedLoadIC", key, state, target()); 1236 TraceIC("KeyedLoadIC", key, state, target());
1230 #endif // DEBUG 1237 #endif // DEBUG
1231 1238
1232 // For JSObjects with fast elements that are not value wrappers 1239 // For JSObjects with fast elements that are not value wrappers
1233 // and that do not have indexed interceptors, we initialize the 1240 // 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 2252 #undef ADDR
2246 }; 2253 };
2247 2254
2248 2255
2249 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2256 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2250 return IC_utilities[id]; 2257 return IC_utilities[id];
2251 } 2258 }
2252 2259
2253 2260
2254 } } // namespace v8::internal 2261 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698