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 |
135 void PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers( | 158 void PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers( |
136 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, | 159 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, |
137 CodeHandleList* handlers, KeyedAccessStoreMode store_mode, | 160 CodeHandleList* handlers, KeyedAccessStoreMode store_mode, |
138 LanguageMode language_mode) { | 161 LanguageMode language_mode) { |
139 Isolate* isolate = receiver_maps->at(0)->GetIsolate(); | 162 Isolate* isolate = receiver_maps->at(0)->GetIsolate(); |
140 DCHECK(store_mode == STANDARD_STORE || | 163 DCHECK(store_mode == STANDARD_STORE || |
141 store_mode == STORE_AND_GROW_NO_TRANSITION || | 164 store_mode == STORE_AND_GROW_NO_TRANSITION || |
142 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || | 165 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || |
143 store_mode == STORE_NO_TRANSITION_HANDLE_COW); | 166 store_mode == STORE_NO_TRANSITION_HANDLE_COW); |
144 ExtraICState extra_state = | 167 ExtraICState extra_state = |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 307 |
285 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); | 308 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); |
286 | 309 |
287 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); | 310 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); |
288 } | 311 } |
289 | 312 |
290 | 313 |
291 #undef __ | 314 #undef __ |
292 } // namespace internal | 315 } // namespace internal |
293 } // namespace v8 | 316 } // namespace v8 |
OLD | NEW |