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

Side by Side Diff: src/ic.cc

Issue 521041: Improve keyed loads on strings by using a new stub (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 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/runtime.h » ('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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 867
868 return object->GetProperty(*object, &lookup, *name, &attr); 868 return object->GetProperty(*object, &lookup, *name, &attr);
869 } 869 }
870 870
871 // Do not use ICs for objects that require access checks (including 871 // Do not use ICs for objects that require access checks (including
872 // the global object). 872 // the global object).
873 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); 873 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded();
874 874
875 if (use_ic) { 875 if (use_ic) {
876 Code* stub = generic_stub(); 876 Code* stub = generic_stub();
877 if (object->IsJSObject()) { 877 if (object->IsString() && key->IsNumber()) {
878 stub = string_stub();
879 } else if (object->IsJSObject()) {
878 Handle<JSObject> receiver = Handle<JSObject>::cast(object); 880 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
879 if (receiver->HasExternalArrayElements()) { 881 if (receiver->HasExternalArrayElements()) {
880 stub = external_array_stub(receiver->GetElementsKind()); 882 stub = external_array_stub(receiver->GetElementsKind());
881 } 883 }
882 } 884 }
883 set_target(stub); 885 set_target(stub);
884 // For JSObjects that are not value wrappers and that do not have 886 // For JSObjects that are not value wrappers and that do not have
885 // indexed interceptors, we initialize the inlined fast case (if 887 // indexed interceptors, we initialize the inlined fast case (if
886 // present) by patching the inlined map check. 888 // present) by patching the inlined map check.
887 if (object->IsJSObject() && 889 if (object->IsJSObject() &&
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 #undef ADDR 1417 #undef ADDR
1416 }; 1418 };
1417 1419
1418 1420
1419 Address IC::AddressFromUtilityId(IC::UtilityId id) { 1421 Address IC::AddressFromUtilityId(IC::UtilityId id) {
1420 return IC_utilities[id]; 1422 return IC_utilities[id];
1421 } 1423 }
1422 1424
1423 1425
1424 } } // namespace v8::internal 1426 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698