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

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

Issue 446523002: Restore performance of accesses to JSGlobalProxy after r22802 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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.cc ('k') | src/mips64/stub-cache-mips64.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 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_MIPS 7 #if V8_TARGET_ARCH_MIPS
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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 while (!current_map.is_identical_to(holder_map)) { 732 while (!current_map.is_identical_to(holder_map)) {
733 ++depth; 733 ++depth;
734 734
735 // Only global objects and objects that do not require access 735 // Only global objects and objects that do not require access
736 // checks are allowed in stubs. 736 // checks are allowed in stubs.
737 DCHECK(current_map->IsJSGlobalProxyMap() || 737 DCHECK(current_map->IsJSGlobalProxyMap() ||
738 !current_map->is_access_check_needed()); 738 !current_map->is_access_check_needed());
739 739
740 prototype = handle(JSObject::cast(current_map->prototype())); 740 prototype = handle(JSObject::cast(current_map->prototype()));
741 if (current_map->is_dictionary_map() && 741 if (current_map->is_dictionary_map() &&
742 !current_map->IsJSGlobalObjectMap() && 742 !current_map->IsJSGlobalObjectMap()) {
743 !current_map->IsJSGlobalProxyMap()) { 743 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
744 if (!name->IsUniqueName()) { 744 if (!name->IsUniqueName()) {
745 DCHECK(name->IsString()); 745 DCHECK(name->IsString());
746 name = factory()->InternalizeString(Handle<String>::cast(name)); 746 name = factory()->InternalizeString(Handle<String>::cast(name));
747 } 747 }
748 DCHECK(current.is_null() || 748 DCHECK(current.is_null() ||
749 current->property_dictionary()->FindEntry(name) == 749 current->property_dictionary()->FindEntry(name) ==
750 NameDictionary::kNotFound); 750 NameDictionary::kNotFound);
751 751
752 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, 752 GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
753 scratch1, scratch2); 753 scratch1, scratch2);
754 754
755 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 755 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
756 reg = holder_reg; // From now on the object will be in holder_reg. 756 reg = holder_reg; // From now on the object will be in holder_reg.
757 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 757 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
758 } else { 758 } else {
759 Register map_reg = scratch1; 759 Register map_reg = scratch1;
760 if (depth != 1 || check == CHECK_ALL_MAPS) { 760 if (depth != 1 || check == CHECK_ALL_MAPS) {
761 // CheckMap implicitly loads the map of |reg| into |map_reg|. 761 // CheckMap implicitly loads the map of |reg| into |map_reg|.
762 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK); 762 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK);
763 } else { 763 } else {
764 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 764 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
765 } 765 }
766 766
767 // Check access rights to the global object. This has to happen after 767 // Check access rights to the global object. This has to happen after
768 // the map check so that we know that the object is actually a global 768 // the map check so that we know that the object is actually a global
769 // object. 769 // object.
770 // This allows us to install generated handlers for accesses to the
771 // global proxy (as opposed to using slow ICs). See corresponding code
772 // in LookupForRead().
770 if (current_map->IsJSGlobalProxyMap()) { 773 if (current_map->IsJSGlobalProxyMap()) {
771 __ CheckAccessGlobalProxy(reg, scratch2, miss); 774 __ CheckAccessGlobalProxy(reg, scratch2, miss);
772 } else if (current_map->IsJSGlobalObjectMap()) { 775 } else if (current_map->IsJSGlobalObjectMap()) {
773 GenerateCheckPropertyCell( 776 GenerateCheckPropertyCell(
774 masm(), Handle<JSGlobalObject>::cast(current), name, 777 masm(), Handle<JSGlobalObject>::cast(current), name,
775 scratch2, miss); 778 scratch2, miss);
776 } 779 }
777 780
778 reg = holder_reg; // From now on the object will be in holder_reg. 781 reg = holder_reg; // From now on the object will be in holder_reg.
779 782
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 1330
1328 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1331 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1329 } 1332 }
1330 1333
1331 1334
1332 #undef __ 1335 #undef __
1333 1336
1334 } } // namespace v8::internal 1337 } } // namespace v8::internal
1335 1338
1336 #endif // V8_TARGET_ARCH_MIPS 1339 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/mips64/stub-cache-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698