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

Side by Side Diff: src/ic/arm64/ic-compiler-arm64.cc

Issue 771033003: Revert of Use weak cells in map checks in polymorphic ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « src/ic/arm/ic-compiler-arm.cc ('k') | src/ic/ia32/ic-compiler-ia32.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/ic-compiler.h" 10 #include "src/ic/ic-compiler.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 DCHECK(kind() != Code::KEYED_STORE_IC || 64 DCHECK(kind() != Code::KEYED_STORE_IC ||
65 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); 65 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister()));
66 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 66 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
67 int receiver_count = types->length(); 67 int receiver_count = types->length();
68 int number_of_handled_maps = 0; 68 int number_of_handled_maps = 0;
69 for (int current = 0; current < receiver_count; ++current) { 69 for (int current = 0; current < receiver_count; ++current) {
70 Handle<HeapType> type = types->at(current); 70 Handle<HeapType> type = types->at(current);
71 Handle<Map> map = IC::TypeToMap(*type, isolate()); 71 Handle<Map> map = IC::TypeToMap(*type, isolate());
72 if (!map->is_deprecated()) { 72 if (!map->is_deprecated()) {
73 number_of_handled_maps++; 73 number_of_handled_maps++;
74 Handle<WeakCell> cell = Map::WeakCellForMap(map);
75 __ CmpWeakValue(map_reg, cell, scratch2());
76 Label try_next; 74 Label try_next;
75 __ Cmp(map_reg, Operand(map));
77 __ B(ne, &try_next); 76 __ B(ne, &try_next);
78 if (type->Is(HeapType::Number())) { 77 if (type->Is(HeapType::Number())) {
79 DCHECK(!number_case.is_unused()); 78 DCHECK(!number_case.is_unused());
80 __ Bind(&number_case); 79 __ Bind(&number_case);
81 } 80 }
82 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET); 81 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET);
83 __ Bind(&try_next); 82 __ Bind(&try_next);
84 } 83 }
85 } 84 }
86 DCHECK(number_of_handled_maps != 0); 85 DCHECK(number_of_handled_maps != 0);
(...skipping 11 matching lines...) Expand all
98 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( 97 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic(
99 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, 98 MapHandleList* receiver_maps, CodeHandleList* handler_stubs,
100 MapHandleList* transitioned_maps) { 99 MapHandleList* transitioned_maps) {
101 Label miss; 100 Label miss;
102 101
103 ASM_LOCATION("PropertyICCompiler::CompileStorePolymorphic"); 102 ASM_LOCATION("PropertyICCompiler::CompileStorePolymorphic");
104 103
105 __ JumpIfSmi(receiver(), &miss); 104 __ JumpIfSmi(receiver(), &miss);
106 105
107 int receiver_count = receiver_maps->length(); 106 int receiver_count = receiver_maps->length();
108 Register map_reg = scratch1(); 107 __ Ldr(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset));
109 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
110 for (int i = 0; i < receiver_count; i++) { 108 for (int i = 0; i < receiver_count; i++) {
111 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_maps->at(i)); 109 __ Cmp(scratch1(), Operand(receiver_maps->at(i)));
112 __ CmpWeakValue(map_reg, cell, scratch2()); 110
113 Label skip; 111 Label skip;
114 __ B(&skip, ne); 112 __ B(&skip, ne);
115 if (!transitioned_maps->at(i).is_null()) { 113 if (!transitioned_maps->at(i).is_null()) {
116 // This argument is used by the handler stub. For example, see 114 // This argument is used by the handler stub. For example, see
117 // ElementsTransitionGenerator::GenerateMapChangeElementsTransition. 115 // ElementsTransitionGenerator::GenerateMapChangeElementsTransition.
118 Handle<WeakCell> cell = Map::WeakCellForMap(transitioned_maps->at(i)); 116 __ Mov(transition_map(), Operand(transitioned_maps->at(i)));
119 __ LoadWeakValue(transition_map(), cell, &miss);
120 } 117 }
121 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET); 118 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET);
122 __ Bind(&skip); 119 __ Bind(&skip);
123 } 120 }
124 121
125 __ Bind(&miss); 122 __ Bind(&miss);
126 TailCallBuiltin(masm(), MissBuiltin(kind())); 123 TailCallBuiltin(masm(), MissBuiltin(kind()));
127 124
128 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 125 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
129 } 126 }
130 127
131 128
132 #undef __ 129 #undef __
133 } 130 }
134 } // namespace v8::internal 131 } // namespace v8::internal
135 132
136 #endif // V8_TARGET_ARCH_ARM64 133 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/ic/arm/ic-compiler-arm.cc ('k') | src/ic/ia32/ic-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698