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

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

Issue 812353002: Use weak cell to embed map in CompareNil IC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments 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/hydrogen-instructions.h ('k') | src/objects.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 #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/ic/ic-compiler.h" 9 #include "src/ic/ic-compiler.h"
10 10
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 CompareNilICStub* stub) { 237 CompareNilICStub* stub) {
238 Isolate* isolate = receiver_map->GetIsolate(); 238 Isolate* isolate = receiver_map->GetIsolate();
239 Handle<String> name(isolate->heap()->empty_string()); 239 Handle<String> name(isolate->heap()->empty_string());
240 if (!receiver_map->is_dictionary_map()) { 240 if (!receiver_map->is_dictionary_map()) {
241 Handle<Code> cached_ic = 241 Handle<Code> cached_ic =
242 Find(name, receiver_map, Code::COMPARE_NIL_IC, stub->GetExtraICState()); 242 Find(name, receiver_map, Code::COMPARE_NIL_IC, stub->GetExtraICState());
243 if (!cached_ic.is_null()) return cached_ic; 243 if (!cached_ic.is_null()) return cached_ic;
244 } 244 }
245 245
246 Code::FindAndReplacePattern pattern; 246 Code::FindAndReplacePattern pattern;
247 pattern.Add(isolate->factory()->meta_map(), receiver_map); 247 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
248 pattern.Add(isolate->factory()->meta_map(), cell);
248 Handle<Code> ic = stub->GetCodeCopy(pattern); 249 Handle<Code> ic = stub->GetCodeCopy(pattern);
249 250
250 if (!receiver_map->is_dictionary_map()) { 251 if (!receiver_map->is_dictionary_map()) {
251 Map::UpdateCodeCache(receiver_map, name, ic); 252 Map::UpdateCodeCache(receiver_map, name, ic);
252 } 253 }
253 254
254 return ic; 255 return ic;
255 } 256 }
256 257
257 258
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 455
455 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); 456 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss);
456 457
457 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); 458 return GetCode(kind(), Code::NORMAL, factory()->empty_string());
458 } 459 }
459 460
460 461
461 #undef __ 462 #undef __
462 } 463 }
463 } // namespace v8::internal 464 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698