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

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

Issue 957393002: MIPS: Skip the mapcheck on the global object since the global proxy and cell are already checked (o… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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') | no next file » | 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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, 447 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1,
448 scratch2); 448 scratch2);
449 449
450 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 450 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
451 reg = holder_reg; // From now on the object will be in holder_reg. 451 reg = holder_reg; // From now on the object will be in holder_reg.
452 __ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); 452 __ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
453 } else { 453 } else {
454 Register map_reg = scratch1; 454 Register map_reg = scratch1;
455 __ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 455 __ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
456 if (depth != 1 || check == CHECK_ALL_MAPS) {
457 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
458 __ GetWeakValue(scratch2, cell);
459 __ Branch(miss, ne, scratch2, Operand(map_reg));
460 }
461 456
462 // Check access rights to the global object. This has to happen after 457 // Check access rights to the global object. This has to happen after
463 // the map check so that we know that the object is actually a global 458 // the map check so that we know that the object is actually a global
464 // object. 459 // object.
465 // This allows us to install generated handlers for accesses to the 460 // This allows us to install generated handlers for accesses to the
466 // global proxy (as opposed to using slow ICs). See corresponding code 461 // global proxy (as opposed to using slow ICs). See corresponding code
467 // in LookupForRead(). 462 // in LookupForRead().
468 if (current_map->IsJSGlobalProxyMap()) { 463 if (current_map->IsJSGlobalProxyMap()) {
469 __ CheckAccessGlobalProxy(reg, scratch2, miss); 464 __ CheckAccessGlobalProxy(reg, scratch2, miss);
470 } else if (current_map->IsJSGlobalObjectMap()) { 465 } else if (current_map->IsJSGlobalObjectMap()) {
471 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), 466 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
472 name, scratch2, miss); 467 name, scratch2, miss);
468 } else if (depth != 1 || check == CHECK_ALL_MAPS) {
469 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
470 __ GetWeakValue(scratch2, cell);
471 __ Branch(miss, ne, scratch2, Operand(map_reg));
473 } 472 }
474 473
475 reg = holder_reg; // From now on the object will be in holder_reg. 474 reg = holder_reg; // From now on the object will be in holder_reg.
476 475
477 __ ld(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); 476 __ ld(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
478 } 477 }
479 478
480 // Go to the next object in the prototype chain. 479 // Go to the next object in the prototype chain.
481 current = prototype; 480 current = prototype;
482 current_map = handle(current->map()); 481 current_map = handle(current->map());
483 } 482 }
484 483
484 DCHECK(!current_map->IsJSGlobalProxyMap());
485
485 // Log the check depth. 486 // Log the check depth.
486 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); 487 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
487 488
488 if (depth != 0 || check == CHECK_ALL_MAPS) { 489 if (depth != 0 || check == CHECK_ALL_MAPS) {
489 // Check the holder map. 490 // Check the holder map.
490 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); 491 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
491 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); 492 Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
492 __ GetWeakValue(scratch2, cell); 493 __ GetWeakValue(scratch2, cell);
493 __ Branch(miss, ne, scratch2, Operand(scratch1)); 494 __ Branch(miss, ne, scratch2, Operand(scratch1));
494 } 495 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 // Return the generated code. 744 // Return the generated code.
744 return GetCode(kind(), Code::NORMAL, name); 745 return GetCode(kind(), Code::NORMAL, name);
745 } 746 }
746 747
747 748
748 #undef __ 749 #undef __
749 } 750 }
750 } // namespace v8::internal 751 } // namespace v8::internal
751 752
752 #endif // V8_TARGET_ARCH_MIPS64 753 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698