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

Side by Side Diff: src/ic/mips64/handler-compiler-mips64.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/mips/handler-compiler-mips.cc ('k') | src/ic/ppc/handler-compiler-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. 466 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
467 if (!name->IsUniqueName()) { 467 if (!name->IsUniqueName()) {
468 DCHECK(name->IsString()); 468 DCHECK(name->IsString());
469 name = factory()->InternalizeString(Handle<String>::cast(name)); 469 name = factory()->InternalizeString(Handle<String>::cast(name));
470 } 470 }
471 DCHECK(current.is_null() || 471 DCHECK(current.is_null() ||
472 current->property_dictionary()->FindEntry(name) == 472 current->property_dictionary()->FindEntry(name) ==
473 NameDictionary::kNotFound); 473 NameDictionary::kNotFound);
474 474
475 if (depth > 1) { 475 if (depth > 1) {
476 // TODO(jkummerow): Cache and re-use weak cell. 476 Handle<WeakCell> weak_cell =
477 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); 477 Map::GetOrCreatePrototypeWeakCell(current, isolate());
478 __ LoadWeakValue(reg, weak_cell, miss);
478 } 479 }
479 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, 480 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1,
480 scratch2); 481 scratch2);
481 } 482 }
482 483
483 reg = holder_reg; // From now on the object will be in holder_reg. 484 reg = holder_reg; // From now on the object will be in holder_reg.
484 // Go to the next object in the prototype chain. 485 // Go to the next object in the prototype chain.
485 current = prototype; 486 current = prototype;
486 current_map = handle(current->map()); 487 current_map = handle(current->map());
487 } 488 }
488 489
489 DCHECK(!current_map->IsJSGlobalProxyMap()); 490 DCHECK(!current_map->IsJSGlobalProxyMap());
490 491
491 // Log the check depth. 492 // Log the check depth.
492 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); 493 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
493 494
494 bool return_holder = return_what == RETURN_HOLDER; 495 bool return_holder = return_what == RETURN_HOLDER;
495 if (return_holder && depth != 0) { 496 if (return_holder && depth != 0) {
496 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); 497 Handle<WeakCell> weak_cell =
498 Map::GetOrCreatePrototypeWeakCell(current, isolate());
499 __ LoadWeakValue(reg, weak_cell, miss);
497 } 500 }
498 501
499 // Return the register containing the holder. 502 // Return the register containing the holder.
500 return return_holder ? reg : no_reg; 503 return return_holder ? reg : no_reg;
501 } 504 }
502 505
503 506
504 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { 507 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
505 if (!miss->is_unused()) { 508 if (!miss->is_unused()) {
506 Label success; 509 Label success;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 // Return the generated code. 677 // Return the generated code.
675 return GetCode(kind(), name); 678 return GetCode(kind(), name);
676 } 679 }
677 680
678 681
679 #undef __ 682 #undef __
680 } // namespace internal 683 } // namespace internal
681 } // namespace v8 684 } // namespace v8
682 685
683 #endif // V8_TARGET_ARCH_MIPS64 686 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/ppc/handler-compiler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698