OLD | NEW |
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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 445 |
446 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, | 446 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
447 scratch2); | 447 scratch2); |
448 | 448 |
449 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 449 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
450 reg = holder_reg; // From now on the object will be in holder_reg. | 450 reg = holder_reg; // From now on the object will be in holder_reg. |
451 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); | 451 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); |
452 } else { | 452 } else { |
453 Register map_reg = scratch1; | 453 Register map_reg = scratch1; |
454 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 454 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
455 if (depth != 1 || check == CHECK_ALL_MAPS) { | |
456 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | |
457 __ GetWeakValue(scratch2, cell); | |
458 __ Branch(miss, ne, scratch2, Operand(map_reg)); | |
459 } | |
460 | 455 |
461 // Check access rights to the global object. This has to happen after | 456 // Check access rights to the global object. This has to happen after |
462 // the map check so that we know that the object is actually a global | 457 // the map check so that we know that the object is actually a global |
463 // object. | 458 // object. |
464 // This allows us to install generated handlers for accesses to the | 459 // This allows us to install generated handlers for accesses to the |
465 // global proxy (as opposed to using slow ICs). See corresponding code | 460 // global proxy (as opposed to using slow ICs). See corresponding code |
466 // in LookupForRead(). | 461 // in LookupForRead(). |
467 if (current_map->IsJSGlobalProxyMap()) { | 462 if (current_map->IsJSGlobalProxyMap()) { |
468 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 463 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
469 } else if (current_map->IsJSGlobalObjectMap()) { | 464 } else if (current_map->IsJSGlobalObjectMap()) { |
470 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), | 465 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), |
471 name, scratch2, miss); | 466 name, scratch2, miss); |
| 467 } else if (depth != 1 || check == CHECK_ALL_MAPS) { |
| 468 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 469 __ GetWeakValue(scratch2, cell); |
| 470 __ Branch(miss, ne, scratch2, Operand(map_reg)); |
472 } | 471 } |
473 | 472 |
474 reg = holder_reg; // From now on the object will be in holder_reg. | 473 reg = holder_reg; // From now on the object will be in holder_reg. |
475 | 474 |
476 __ lw(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); | 475 __ lw(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); |
477 } | 476 } |
478 | 477 |
479 // Go to the next object in the prototype chain. | 478 // Go to the next object in the prototype chain. |
480 current = prototype; | 479 current = prototype; |
481 current_map = handle(current->map()); | 480 current_map = handle(current->map()); |
482 } | 481 } |
483 | 482 |
| 483 DCHECK(!current_map->IsJSGlobalProxyMap()); |
| 484 |
484 // Log the check depth. | 485 // Log the check depth. |
485 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 486 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
486 | 487 |
487 if (depth != 0 || check == CHECK_ALL_MAPS) { | 488 if (depth != 0 || check == CHECK_ALL_MAPS) { |
488 // Check the holder map. | 489 // Check the holder map. |
489 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 490 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
490 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 491 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
491 __ GetWeakValue(scratch2, cell); | 492 __ GetWeakValue(scratch2, cell); |
492 __ Branch(miss, ne, scratch2, Operand(scratch1)); | 493 __ Branch(miss, ne, scratch2, Operand(scratch1)); |
493 } | 494 } |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // Return the generated code. | 743 // Return the generated code. |
743 return GetCode(kind(), Code::NORMAL, name); | 744 return GetCode(kind(), Code::NORMAL, name); |
744 } | 745 } |
745 | 746 |
746 | 747 |
747 #undef __ | 748 #undef __ |
748 } | 749 } |
749 } // namespace v8::internal | 750 } // namespace v8::internal |
750 | 751 |
751 #endif // V8_TARGET_ARCH_MIPS | 752 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |