Chromium Code Reviews

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

Issue 1722193002: [compiler] Drop the CompareNilIC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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/ic/ic-compiler.h" 5 #include "src/ic/ic-compiler.h"
6 6
7 #include "src/ic/handler-compiler.h" 7 #include "src/ic/handler-compiler.h"
8 #include "src/ic/ic-inl.h" 8 #include "src/ic/ic-inl.h"
9 #include "src/profiler/cpu-profiler.h" 9 #include "src/profiler/cpu-profiler.h"
10 10
(...skipping 114 matching lines...)
125 code = compiler.CompileStoreMegamorphic(flags); 125 code = compiler.CompileStoreMegamorphic(flags);
126 } else { 126 } else {
127 UNREACHABLE(); 127 UNREACHABLE();
128 } 128 }
129 129
130 FillCache(isolate, code); 130 FillCache(isolate, code);
131 return code; 131 return code;
132 } 132 }
133 133
134 134
135 Handle<Code> PropertyICCompiler::ComputeCompareNil(Handle<Map> receiver_map,
136 CompareNilICStub* stub) {
137 Isolate* isolate = receiver_map->GetIsolate();
138 Handle<String> name(isolate->heap()->empty_string());
139 if (!receiver_map->is_dictionary_map()) {
140 Handle<Code> cached_ic =
141 Find(name, receiver_map, Code::COMPARE_NIL_IC, stub->GetExtraICState());
142 if (!cached_ic.is_null()) return cached_ic;
143 }
144
145 Code::FindAndReplacePattern pattern;
146 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
147 pattern.Add(isolate->factory()->meta_map(), cell);
148 Handle<Code> ic = stub->GetCodeCopy(pattern);
149
150 if (!receiver_map->is_dictionary_map()) {
151 Map::UpdateCodeCache(receiver_map, name, ic);
152 }
153
154 return ic;
155 }
156
157
158 void PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers( 135 void PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers(
159 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, 136 MapHandleList* receiver_maps, MapHandleList* transitioned_maps,
160 CodeHandleList* handlers, KeyedAccessStoreMode store_mode, 137 CodeHandleList* handlers, KeyedAccessStoreMode store_mode,
161 LanguageMode language_mode) { 138 LanguageMode language_mode) {
162 Isolate* isolate = receiver_maps->at(0)->GetIsolate(); 139 Isolate* isolate = receiver_maps->at(0)->GetIsolate();
163 DCHECK(store_mode == STANDARD_STORE || 140 DCHECK(store_mode == STANDARD_STORE ||
164 store_mode == STORE_AND_GROW_NO_TRANSITION || 141 store_mode == STORE_AND_GROW_NO_TRANSITION ||
165 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || 142 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS ||
166 store_mode == STORE_NO_TRANSITION_HANDLE_COW); 143 store_mode == STORE_NO_TRANSITION_HANDLE_COW);
167 ExtraICState extra_state = 144 ExtraICState extra_state =
(...skipping 139 matching lines...)
307 284
308 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); 285 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss);
309 286
310 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); 287 return GetCode(kind(), Code::NORMAL, factory()->empty_string());
311 } 288 }
312 289
313 290
314 #undef __ 291 #undef __
315 } // namespace internal 292 } // namespace internal
316 } // namespace v8 293 } // namespace v8
OLDNEW

Powered by Google App Engine