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

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

Issue 770373002: CheckPrototypes uses weak cells to embed maps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 scratch2); 454 scratch2);
455 455
456 __ Ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 456 __ Ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
457 reg = holder_reg; // From now on the object will be in holder_reg. 457 reg = holder_reg; // From now on the object will be in holder_reg.
458 __ Ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 458 __ Ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
459 } else { 459 } else {
460 Register map_reg = scratch1; 460 Register map_reg = scratch1;
461 __ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 461 __ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
462 462
463 if (depth != 1 || check == CHECK_ALL_MAPS) { 463 if (depth != 1 || check == CHECK_ALL_MAPS) {
464 __ CheckMap(map_reg, current_map, miss, DONT_DO_SMI_CHECK); 464 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
465 __ CmpWeakValue(map_reg, cell, scratch2);
466 __ B(ne, miss);
465 } 467 }
466 468
467 // Check access rights to the global object. This has to happen after 469 // Check access rights to the global object. This has to happen after
468 // the map check so that we know that the object is actually a global 470 // the map check so that we know that the object is actually a global
469 // object. 471 // object.
470 // This allows us to install generated handlers for accesses to the 472 // This allows us to install generated handlers for accesses to the
471 // global proxy (as opposed to using slow ICs). See corresponding code 473 // global proxy (as opposed to using slow ICs). See corresponding code
472 // in LookupForRead(). 474 // in LookupForRead().
473 if (current_map->IsJSGlobalProxyMap()) { 475 if (current_map->IsJSGlobalProxyMap()) {
474 UseScratchRegisterScope temps(masm()); 476 UseScratchRegisterScope temps(masm());
(...skipping 12 matching lines...) Expand all
487 current = prototype; 489 current = prototype;
488 current_map = handle(current->map()); 490 current_map = handle(current->map());
489 } 491 }
490 492
491 // Log the check depth. 493 // Log the check depth.
492 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); 494 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
493 495
494 // Check the holder map. 496 // Check the holder map.
495 if (depth != 0 || check == CHECK_ALL_MAPS) { 497 if (depth != 0 || check == CHECK_ALL_MAPS) {
496 // Check the holder map. 498 // Check the holder map.
497 __ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK); 499 __ Ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
500 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
501 __ CmpWeakValue(scratch1, cell, scratch2);
502 __ B(ne, miss);
498 } 503 }
499 504
500 // Perform security check for access to the global object. 505 // Perform security check for access to the global object.
501 DCHECK(current_map->IsJSGlobalProxyMap() || 506 DCHECK(current_map->IsJSGlobalProxyMap() ||
502 !current_map->is_access_check_needed()); 507 !current_map->is_access_check_needed());
503 if (current_map->IsJSGlobalProxyMap()) { 508 if (current_map->IsJSGlobalProxyMap()) {
504 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss); 509 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss);
505 } 510 }
506 511
507 // Return the register containing the holder. 512 // Return the register containing the holder.
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 // Return the generated code. 698 // Return the generated code.
694 return GetCode(kind(), Code::FAST, name); 699 return GetCode(kind(), Code::FAST, name);
695 } 700 }
696 701
697 702
698 #undef __ 703 #undef __
699 } 704 }
700 } // namespace v8::internal 705 } // namespace v8::internal
701 706
702 #endif // V8_TARGET_ARCH_IA32 707 #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