OLD | NEW |
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...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 289 |
313 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); | 290 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); |
314 | 291 |
315 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); | 292 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); |
316 } | 293 } |
317 | 294 |
318 | 295 |
319 #undef __ | 296 #undef __ |
320 } // namespace internal | 297 } // namespace internal |
321 } // namespace v8 | 298 } // namespace v8 |
OLD | NEW |