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

Side by Side Diff: src/mips64/stub-cache-mips64.cc

Issue 404813002: MIPS: Cache IC handlers on the prototype's map if possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/mips64/ic-mips64.cc ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic-inl.h" 10 #include "src/ic-inl.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 current->property_dictionary()->FindEntry(name) == 858 current->property_dictionary()->FindEntry(name) ==
859 NameDictionary::kNotFound); 859 NameDictionary::kNotFound);
860 860
861 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, 861 GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
862 scratch1, scratch2); 862 scratch1, scratch2);
863 863
864 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 864 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
865 reg = holder_reg; // From now on the object will be in holder_reg. 865 reg = holder_reg; // From now on the object will be in holder_reg.
866 __ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 866 __ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
867 } else { 867 } else {
868 // Two possible reasons for loading the prototype from the map:
869 // (1) Can't store references to new space in code.
870 // (2) Handler is shared for all receivers with the same prototype
871 // map (but not necessarily the same prototype instance).
872 bool load_prototype_from_map =
873 heap()->InNewSpace(*prototype) || depth == 1;
868 Register map_reg = scratch1; 874 Register map_reg = scratch1;
869 if (depth != 1 || check == CHECK_ALL_MAPS) { 875 if (depth != 1 || check == CHECK_ALL_MAPS) {
870 // CheckMap implicitly loads the map of |reg| into |map_reg|. 876 // CheckMap implicitly loads the map of |reg| into |map_reg|.
871 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK); 877 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK);
872 } else { 878 } else {
873 __ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 879 __ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
874 } 880 }
875 881
876 // Check access rights to the global object. This has to happen after 882 // Check access rights to the global object. This has to happen after
877 // the map check so that we know that the object is actually a global 883 // the map check so that we know that the object is actually a global
878 // object. 884 // object.
879 if (current_map->IsJSGlobalProxyMap()) { 885 if (current_map->IsJSGlobalProxyMap()) {
880 __ CheckAccessGlobalProxy(reg, scratch2, miss); 886 __ CheckAccessGlobalProxy(reg, scratch2, miss);
881 } else if (current_map->IsJSGlobalObjectMap()) { 887 } else if (current_map->IsJSGlobalObjectMap()) {
882 GenerateCheckPropertyCell( 888 GenerateCheckPropertyCell(
883 masm(), Handle<JSGlobalObject>::cast(current), name, 889 masm(), Handle<JSGlobalObject>::cast(current), name,
884 scratch2, miss); 890 scratch2, miss);
885 } 891 }
886 892
887 reg = holder_reg; // From now on the object will be in holder_reg. 893 reg = holder_reg; // From now on the object will be in holder_reg.
888 894
889 if (heap()->InNewSpace(*prototype)) { 895 if (load_prototype_from_map) {
890 // The prototype is in new space; we cannot store a reference to it
891 // in the code. Load it from the map.
892 __ ld(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); 896 __ ld(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
893 } else { 897 } else {
894 // The prototype is in old space; load it directly.
895 __ li(reg, Operand(prototype)); 898 __ li(reg, Operand(prototype));
896 } 899 }
897 } 900 }
898 901
899 // Go to the next object in the prototype chain. 902 // Go to the next object in the prototype chain.
900 current = prototype; 903 current = prototype;
901 current_map = handle(current->map()); 904 current_map = handle(current->map());
902 } 905 }
903 906
904 // Log the check depth. 907 // Log the check depth.
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 1503
1501 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1504 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1502 } 1505 }
1503 1506
1504 1507
1505 #undef __ 1508 #undef __
1506 1509
1507 } } // namespace v8::internal 1510 } } // namespace v8::internal
1508 1511
1509 #endif // V8_TARGET_ARCH_MIPS64 1512 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/ic-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698