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

Side by Side Diff: src/ic/arm/handler-compiler-arm.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 | « no previous file | src/ic/arm64/handler-compiler-arm64.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_ARM 7 #if V8_TARGET_ARCH_ARM
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 NameDictionary::kNotFound); 409 NameDictionary::kNotFound);
410 410
411 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, 411 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1,
412 scratch2); 412 scratch2);
413 413
414 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 414 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
415 reg = holder_reg; // From now on the object will be in holder_reg. 415 reg = holder_reg; // From now on the object will be in holder_reg.
416 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 416 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
417 } else { 417 } else {
418 Register map_reg = scratch1; 418 Register map_reg = scratch1;
419 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
419 if (depth != 1 || check == CHECK_ALL_MAPS) { 420 if (depth != 1 || check == CHECK_ALL_MAPS) {
420 // CheckMap implicitly loads the map of |reg| into |map_reg|. 421 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
421 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK); 422 __ CmpWeakValue(map_reg, cell, scratch2);
422 } else { 423 __ b(ne, miss);
423 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
424 } 424 }
425 425
426 // Check access rights to the global object. This has to happen after 426 // Check access rights to the global object. This has to happen after
427 // the map check so that we know that the object is actually a global 427 // the map check so that we know that the object is actually a global
428 // object. 428 // object.
429 // This allows us to install generated handlers for accesses to the 429 // This allows us to install generated handlers for accesses to the
430 // global proxy (as opposed to using slow ICs). See corresponding code 430 // global proxy (as opposed to using slow ICs). See corresponding code
431 // in LookupForRead(). 431 // in LookupForRead().
432 if (current_map->IsJSGlobalProxyMap()) { 432 if (current_map->IsJSGlobalProxyMap()) {
433 __ CheckAccessGlobalProxy(reg, scratch2, miss); 433 __ CheckAccessGlobalProxy(reg, scratch2, miss);
(...skipping 10 matching lines...) Expand all
444 // Go to the next object in the prototype chain. 444 // Go to the next object in the prototype chain.
445 current = prototype; 445 current = prototype;
446 current_map = handle(current->map()); 446 current_map = handle(current->map());
447 } 447 }
448 448
449 // Log the check depth. 449 // Log the check depth.
450 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); 450 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
451 451
452 if (depth != 0 || check == CHECK_ALL_MAPS) { 452 if (depth != 0 || check == CHECK_ALL_MAPS) {
453 // Check the holder map. 453 // Check the holder map.
454 __ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK); 454 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
455 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
456 __ CmpWeakValue(scratch1, cell, scratch2);
457 __ b(ne, miss);
455 } 458 }
456 459
457 // Perform security check for access to the global object. 460 // Perform security check for access to the global object.
458 DCHECK(current_map->IsJSGlobalProxyMap() || 461 DCHECK(current_map->IsJSGlobalProxyMap() ||
459 !current_map->is_access_check_needed()); 462 !current_map->is_access_check_needed());
460 if (current_map->IsJSGlobalProxyMap()) { 463 if (current_map->IsJSGlobalProxyMap()) {
461 __ CheckAccessGlobalProxy(reg, scratch1, miss); 464 __ CheckAccessGlobalProxy(reg, scratch1, miss);
462 } 465 }
463 466
464 // Return the register containing the holder. 467 // Return the register containing the holder.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 // Return the generated code. 682 // Return the generated code.
680 return GetCode(kind(), Code::NORMAL, name); 683 return GetCode(kind(), Code::NORMAL, name);
681 } 684 }
682 685
683 686
684 #undef __ 687 #undef __
685 } 688 }
686 } // namespace v8::internal 689 } // namespace v8::internal
687 690
688 #endif // V8_TARGET_ARCH_ARM 691 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698