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

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

Issue 2428473002: [ic] Cache weak cells containing prototypes in respective PrototypeInfo objects. (Closed)
Patch Set: Created 4 years, 2 months 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/s390/handler-compiler-s390.cc ('k') | src/ic/x87/handler-compiler-x87.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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/ic/handler-compiler.h" 7 #include "src/ic/handler-compiler.h"
8 8
9 #include "src/api-arguments.h" 9 #include "src/api-arguments.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. 477 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
478 if (!name->IsUniqueName()) { 478 if (!name->IsUniqueName()) {
479 DCHECK(name->IsString()); 479 DCHECK(name->IsString());
480 name = factory()->InternalizeString(Handle<String>::cast(name)); 480 name = factory()->InternalizeString(Handle<String>::cast(name));
481 } 481 }
482 DCHECK(current.is_null() || 482 DCHECK(current.is_null() ||
483 current->property_dictionary()->FindEntry(name) == 483 current->property_dictionary()->FindEntry(name) ==
484 NameDictionary::kNotFound); 484 NameDictionary::kNotFound);
485 485
486 if (depth > 1) { 486 if (depth > 1) {
487 // TODO(jkummerow): Cache and re-use weak cell. 487 Handle<WeakCell> weak_cell =
488 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); 488 Map::GetOrCreatePrototypeWeakCell(current, isolate());
489 __ LoadWeakValue(reg, weak_cell, miss);
489 } 490 }
490 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, 491 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1,
491 scratch2); 492 scratch2);
492 } 493 }
493 494
494 reg = holder_reg; // From now on the object will be in holder_reg. 495 reg = holder_reg; // From now on the object will be in holder_reg.
495 // Go to the next object in the prototype chain. 496 // Go to the next object in the prototype chain.
496 current = prototype; 497 current = prototype;
497 current_map = handle(current->map()); 498 current_map = handle(current->map());
498 } 499 }
499 500
500 DCHECK(!current_map->IsJSGlobalProxyMap()); 501 DCHECK(!current_map->IsJSGlobalProxyMap());
501 502
502 // Log the check depth. 503 // Log the check depth.
503 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); 504 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
504 505
505 bool return_holder = return_what == RETURN_HOLDER; 506 bool return_holder = return_what == RETURN_HOLDER;
506 if (return_holder && depth != 0) { 507 if (return_holder && depth != 0) {
507 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); 508 Handle<WeakCell> weak_cell =
509 Map::GetOrCreatePrototypeWeakCell(current, isolate());
510 __ LoadWeakValue(reg, weak_cell, miss);
508 } 511 }
509 512
510 // Return the register containing the holder. 513 // Return the register containing the holder.
511 return return_holder ? reg : no_reg; 514 return return_holder ? reg : no_reg;
512 } 515 }
513 516
514 517
515 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { 518 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
516 if (!miss->is_unused()) { 519 if (!miss->is_unused()) {
517 Label success; 520 Label success;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 // Return the generated code. 695 // Return the generated code.
693 return GetCode(kind(), name); 696 return GetCode(kind(), name);
694 } 697 }
695 698
696 699
697 #undef __ 700 #undef __
698 } // namespace internal 701 } // namespace internal
699 } // namespace v8 702 } // namespace v8
700 703
701 #endif // V8_TARGET_ARCH_X64 704 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/s390/handler-compiler-s390.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698