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

Side by Side Diff: src/ic/arm64/handler-compiler-arm64.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/arm/handler-compiler-arm.cc ('k') | src/ic/ia32/handler-compiler-ia32.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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } else if (current_map->is_dictionary_map()) { 509 } else if (current_map->is_dictionary_map()) {
510 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. 510 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
511 if (!name->IsUniqueName()) { 511 if (!name->IsUniqueName()) {
512 DCHECK(name->IsString()); 512 DCHECK(name->IsString());
513 name = factory()->InternalizeString(Handle<String>::cast(name)); 513 name = factory()->InternalizeString(Handle<String>::cast(name));
514 } 514 }
515 DCHECK(current.is_null() || (current->property_dictionary()->FindEntry( 515 DCHECK(current.is_null() || (current->property_dictionary()->FindEntry(
516 name) == NameDictionary::kNotFound)); 516 name) == NameDictionary::kNotFound));
517 517
518 if (depth > 1) { 518 if (depth > 1) {
519 // TODO(jkummerow): Cache and re-use weak cell. 519 Handle<WeakCell> weak_cell =
520 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); 520 Map::GetOrCreatePrototypeWeakCell(current, isolate());
521 __ LoadWeakValue(reg, weak_cell, miss);
521 } 522 }
522 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, 523 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1,
523 scratch2); 524 scratch2);
524 } 525 }
525 526
526 reg = holder_reg; // From now on the object will be in holder_reg. 527 reg = holder_reg; // From now on the object will be in holder_reg.
527 // Go to the next object in the prototype chain. 528 // Go to the next object in the prototype chain.
528 current = prototype; 529 current = prototype;
529 current_map = handle(current->map()); 530 current_map = handle(current->map());
530 } 531 }
531 532
532 DCHECK(!current_map->IsJSGlobalProxyMap()); 533 DCHECK(!current_map->IsJSGlobalProxyMap());
533 534
534 // Log the check depth. 535 // Log the check depth.
535 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); 536 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
536 537
537 bool return_holder = return_what == RETURN_HOLDER; 538 bool return_holder = return_what == RETURN_HOLDER;
538 if (return_holder && depth != 0) { 539 if (return_holder && depth != 0) {
539 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); 540 Handle<WeakCell> weak_cell =
541 Map::GetOrCreatePrototypeWeakCell(current, isolate());
542 __ LoadWeakValue(reg, weak_cell, miss);
540 } 543 }
541 544
542 // Return the register containing the holder. 545 // Return the register containing the holder.
543 return return_holder ? reg : no_reg; 546 return return_holder ? reg : no_reg;
544 } 547 }
545 548
546 549
547 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { 550 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
548 if (!miss->is_unused()) { 551 if (!miss->is_unused()) {
549 Label success; 552 Label success;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // Return the generated code. 689 // Return the generated code.
687 return GetCode(kind(), name); 690 return GetCode(kind(), name);
688 } 691 }
689 692
690 693
691 #undef __ 694 #undef __
692 } // namespace internal 695 } // namespace internal
693 } // namespace v8 696 } // namespace v8
694 697
695 #endif // V8_TARGET_ARCH_IA32 698 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698