| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 scratch2); | 412 scratch2); |
| 413 | 413 |
| 414 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 414 __ lw(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 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); | 416 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); |
| 417 } else { | 417 } else { |
| 418 Register map_reg = scratch1; | 418 Register map_reg = scratch1; |
| 419 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 419 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 420 if (depth != 1 || check == CHECK_ALL_MAPS) { | 420 if (depth != 1 || check == CHECK_ALL_MAPS) { |
| 421 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 421 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 422 __ CmpWeakValue(scratch2, map_reg, cell); | 422 __ GetWeakValue(scratch2, cell); |
| 423 __ Branch(miss, ne, scratch2, Operand(zero_reg)); | 423 __ Branch(miss, ne, scratch2, Operand(map_reg)); |
| 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 12 matching lines...) Expand all Loading... |
| 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 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 454 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 455 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); | 455 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 456 __ CmpWeakValue(scratch2, scratch1, cell); | 456 __ GetWeakValue(scratch2, cell); |
| 457 __ Branch(miss, ne, scratch2, Operand(zero_reg)); | 457 __ Branch(miss, ne, scratch2, Operand(scratch1)); |
| 458 } | 458 } |
| 459 | 459 |
| 460 // Perform security check for access to the global object. | 460 // Perform security check for access to the global object. |
| 461 DCHECK(current_map->IsJSGlobalProxyMap() || | 461 DCHECK(current_map->IsJSGlobalProxyMap() || |
| 462 !current_map->is_access_check_needed()); | 462 !current_map->is_access_check_needed()); |
| 463 if (current_map->IsJSGlobalProxyMap()) { | 463 if (current_map->IsJSGlobalProxyMap()) { |
| 464 __ CheckAccessGlobalProxy(reg, scratch1, miss); | 464 __ CheckAccessGlobalProxy(reg, scratch1, miss); |
| 465 } | 465 } |
| 466 | 466 |
| 467 // Return the register containing the holder. | 467 // Return the register containing the holder. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 // Return the generated code. | 684 // Return the generated code. |
| 685 return GetCode(kind(), Code::NORMAL, name); | 685 return GetCode(kind(), Code::NORMAL, name); |
| 686 } | 686 } |
| 687 | 687 |
| 688 | 688 |
| 689 #undef __ | 689 #undef __ |
| 690 } | 690 } |
| 691 } // namespace v8::internal | 691 } // namespace v8::internal |
| 692 | 692 |
| 693 #endif // V8_TARGET_ARCH_MIPS | 693 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |