| 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_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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 scratch2); | 413 scratch2); |
| 414 | 414 |
| 415 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 415 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 416 reg = holder_reg; // From now on the object will be in holder_reg. | 416 reg = holder_reg; // From now on the object will be in holder_reg. |
| 417 __ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); | 417 __ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); |
| 418 } else { | 418 } else { |
| 419 Register map_reg = scratch1; | 419 Register map_reg = scratch1; |
| 420 __ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 420 __ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 421 if (depth != 1 || check == CHECK_ALL_MAPS) { | 421 if (depth != 1 || check == CHECK_ALL_MAPS) { |
| 422 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 422 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 423 __ CmpWeakValue(scratch2, map_reg, cell); | 423 __ GetWeakValue(scratch2, cell); |
| 424 __ Branch(miss, ne, scratch2, Operand(zero_reg)); | 424 __ Branch(miss, ne, scratch2, Operand(map_reg)); |
| 425 } | 425 } |
| 426 | 426 |
| 427 // Check access rights to the global object. This has to happen after | 427 // Check access rights to the global object. This has to happen after |
| 428 // the map check so that we know that the object is actually a global | 428 // the map check so that we know that the object is actually a global |
| 429 // object. | 429 // object. |
| 430 // This allows us to install generated handlers for accesses to the | 430 // This allows us to install generated handlers for accesses to the |
| 431 // global proxy (as opposed to using slow ICs). See corresponding code | 431 // global proxy (as opposed to using slow ICs). See corresponding code |
| 432 // in LookupForRead(). | 432 // in LookupForRead(). |
| 433 if (current_map->IsJSGlobalProxyMap()) { | 433 if (current_map->IsJSGlobalProxyMap()) { |
| 434 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 434 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 447 current_map = handle(current->map()); | 447 current_map = handle(current->map()); |
| 448 } | 448 } |
| 449 | 449 |
| 450 // Log the check depth. | 450 // Log the check depth. |
| 451 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 451 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
| 452 | 452 |
| 453 if (depth != 0 || check == CHECK_ALL_MAPS) { | 453 if (depth != 0 || check == CHECK_ALL_MAPS) { |
| 454 // Check the holder map. | 454 // Check the holder map. |
| 455 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 455 __ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 456 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 456 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 457 __ CmpWeakValue(scratch2, scratch1, cell); | 457 __ GetWeakValue(scratch2, cell); |
| 458 __ Branch(miss, ne, scratch2, Operand(zero_reg)); | 458 __ Branch(miss, ne, scratch2, Operand(scratch1)); |
| 459 } | 459 } |
| 460 | 460 |
| 461 // Perform security check for access to the global object. | 461 // Perform security check for access to the global object. |
| 462 DCHECK(current_map->IsJSGlobalProxyMap() || | 462 DCHECK(current_map->IsJSGlobalProxyMap() || |
| 463 !current_map->is_access_check_needed()); | 463 !current_map->is_access_check_needed()); |
| 464 if (current_map->IsJSGlobalProxyMap()) { | 464 if (current_map->IsJSGlobalProxyMap()) { |
| 465 __ CheckAccessGlobalProxy(reg, scratch1, miss); | 465 __ CheckAccessGlobalProxy(reg, scratch1, miss); |
| 466 } | 466 } |
| 467 | 467 |
| 468 // Return the register containing the holder. | 468 // Return the register containing the holder. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 // Return the generated code. | 685 // Return the generated code. |
| 686 return GetCode(kind(), Code::NORMAL, name); | 686 return GetCode(kind(), Code::NORMAL, name); |
| 687 } | 687 } |
| 688 | 688 |
| 689 | 689 |
| 690 #undef __ | 690 #undef __ |
| 691 } | 691 } |
| 692 } // namespace v8::internal | 692 } // namespace v8::internal |
| 693 | 693 |
| 694 #endif // V8_TARGET_ARCH_MIPS64 | 694 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |