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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 NameDictionary::kNotFound); | 405 NameDictionary::kNotFound); |
406 | 406 |
407 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, | 407 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
408 scratch2); | 408 scratch2); |
409 | 409 |
410 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 410 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
411 reg = holder_reg; // From now on the object will be in holder_reg. | 411 reg = holder_reg; // From now on the object will be in holder_reg. |
412 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); | 412 __ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); |
413 } else { | 413 } else { |
414 Register map_reg = scratch1; | 414 Register map_reg = scratch1; |
| 415 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
415 if (depth != 1 || check == CHECK_ALL_MAPS) { | 416 if (depth != 1 || check == CHECK_ALL_MAPS) { |
416 // CheckMap implicitly loads the map of |reg| into |map_reg|. | 417 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
417 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK); | 418 __ CmpWeakValue(scratch2, map_reg, cell); |
418 } else { | 419 __ Branch(miss, ne, scratch2, Operand(zero_reg)); |
419 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | |
420 } | 420 } |
421 | 421 |
422 // Check access rights to the global object. This has to happen after | 422 // Check access rights to the global object. This has to happen after |
423 // the map check so that we know that the object is actually a global | 423 // the map check so that we know that the object is actually a global |
424 // object. | 424 // object. |
425 // This allows us to install generated handlers for accesses to the | 425 // This allows us to install generated handlers for accesses to the |
426 // global proxy (as opposed to using slow ICs). See corresponding code | 426 // global proxy (as opposed to using slow ICs). See corresponding code |
427 // in LookupForRead(). | 427 // in LookupForRead(). |
428 if (current_map->IsJSGlobalProxyMap()) { | 428 if (current_map->IsJSGlobalProxyMap()) { |
429 __ CheckAccessGlobalProxy(reg, scratch2, miss); | 429 __ CheckAccessGlobalProxy(reg, scratch2, miss); |
(...skipping 10 matching lines...) Expand all Loading... |
440 // Go to the next object in the prototype chain. | 440 // Go to the next object in the prototype chain. |
441 current = prototype; | 441 current = prototype; |
442 current_map = handle(current->map()); | 442 current_map = handle(current->map()); |
443 } | 443 } |
444 | 444 |
445 // Log the check depth. | 445 // Log the check depth. |
446 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 446 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
447 | 447 |
448 if (depth != 0 || check == CHECK_ALL_MAPS) { | 448 if (depth != 0 || check == CHECK_ALL_MAPS) { |
449 // Check the holder map. | 449 // Check the holder map. |
450 __ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK); | 450 __ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 451 Handle<WeakCell> cell = Map::WeakCellForMap(current_map); |
| 452 __ CmpWeakValue(scratch2, scratch1, cell); |
| 453 __ Branch(miss, ne, scratch2, Operand(zero_reg)); |
451 } | 454 } |
452 | 455 |
453 // Perform security check for access to the global object. | 456 // Perform security check for access to the global object. |
454 DCHECK(current_map->IsJSGlobalProxyMap() || | 457 DCHECK(current_map->IsJSGlobalProxyMap() || |
455 !current_map->is_access_check_needed()); | 458 !current_map->is_access_check_needed()); |
456 if (current_map->IsJSGlobalProxyMap()) { | 459 if (current_map->IsJSGlobalProxyMap()) { |
457 __ CheckAccessGlobalProxy(reg, scratch1, miss); | 460 __ CheckAccessGlobalProxy(reg, scratch1, miss); |
458 } | 461 } |
459 | 462 |
460 // Return the register containing the holder. | 463 // Return the register containing the holder. |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 // Return the generated code. | 680 // Return the generated code. |
678 return GetCode(kind(), Code::NORMAL, name); | 681 return GetCode(kind(), Code::NORMAL, name); |
679 } | 682 } |
680 | 683 |
681 | 684 |
682 #undef __ | 685 #undef __ |
683 } | 686 } |
684 } // namespace v8::internal | 687 } // namespace v8::internal |
685 | 688 |
686 #endif // V8_TARGET_ARCH_MIPS | 689 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |