| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 Ldr(map, FieldMemOperand(current_object, HeapObject::kMapOffset)); | 1012 Ldr(map, FieldMemOperand(current_object, HeapObject::kMapOffset)); |
| 1013 | 1013 |
| 1014 // For all objects but the receiver, check that the cache is empty. | 1014 // For all objects but the receiver, check that the cache is empty. |
| 1015 EnumLengthUntagged(enum_length, map); | 1015 EnumLengthUntagged(enum_length, map); |
| 1016 Cbnz(enum_length, call_runtime); | 1016 Cbnz(enum_length, call_runtime); |
| 1017 | 1017 |
| 1018 Bind(&start); | 1018 Bind(&start); |
| 1019 | 1019 |
| 1020 // Check that there are no elements. Register current_object contains the | 1020 // Check that there are no elements. Register current_object contains the |
| 1021 // current JS object we've reached through the prototype chain. | 1021 // current JS object we've reached through the prototype chain. |
| 1022 Label no_elements; |
| 1022 Ldr(current_object, FieldMemOperand(current_object, | 1023 Ldr(current_object, FieldMemOperand(current_object, |
| 1023 JSObject::kElementsOffset)); | 1024 JSObject::kElementsOffset)); |
| 1024 Cmp(current_object, empty_fixed_array_value); | 1025 Cmp(current_object, empty_fixed_array_value); |
| 1026 B(eq, &no_elements); |
| 1027 |
| 1028 // Second chance, the object may be using the empty slow element dictionary. |
| 1029 CompareRoot(current_object, Heap::kEmptySlowElementDictionaryRootIndex); |
| 1025 B(ne, call_runtime); | 1030 B(ne, call_runtime); |
| 1026 | 1031 |
| 1032 Bind(&no_elements); |
| 1027 Ldr(current_object, FieldMemOperand(map, Map::kPrototypeOffset)); | 1033 Ldr(current_object, FieldMemOperand(map, Map::kPrototypeOffset)); |
| 1028 Cmp(current_object, null_value); | 1034 Cmp(current_object, null_value); |
| 1029 B(ne, &next); | 1035 B(ne, &next); |
| 1030 } | 1036 } |
| 1031 | 1037 |
| 1032 | 1038 |
| 1033 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, | 1039 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
| 1034 Register scratch1, | 1040 Register scratch1, |
| 1035 Register scratch2, | 1041 Register scratch2, |
| 1036 Label* no_memento_found) { | 1042 Label* no_memento_found) { |
| (...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3519 | 3525 |
| 3520 | 3526 |
| 3521 // Note: The ARM version of this clobbers elements_reg, but this version does | 3527 // Note: The ARM version of this clobbers elements_reg, but this version does |
| 3522 // not. Some uses of this in A64 assume that elements_reg will be preserved. | 3528 // not. Some uses of this in A64 assume that elements_reg will be preserved. |
| 3523 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, | 3529 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, |
| 3524 Register key_reg, | 3530 Register key_reg, |
| 3525 Register elements_reg, | 3531 Register elements_reg, |
| 3526 Register scratch1, | 3532 Register scratch1, |
| 3527 FPRegister fpscratch1, | 3533 FPRegister fpscratch1, |
| 3528 FPRegister fpscratch2, | 3534 FPRegister fpscratch2, |
| 3529 Label* fail) { | 3535 Label* fail, |
| 3536 int elements_offset) { |
| 3530 ASSERT(!AreAliased(value_reg, key_reg, elements_reg, scratch1)); | 3537 ASSERT(!AreAliased(value_reg, key_reg, elements_reg, scratch1)); |
| 3531 Label store_num; | 3538 Label store_num; |
| 3532 | 3539 |
| 3533 // Speculatively convert the smi to a double - all smis can be exactly | 3540 // Speculatively convert the smi to a double - all smis can be exactly |
| 3534 // represented as a double. | 3541 // represented as a double. |
| 3535 SmiUntagToDouble(fpscratch1, value_reg, kSpeculativeUntag); | 3542 SmiUntagToDouble(fpscratch1, value_reg, kSpeculativeUntag); |
| 3536 | 3543 |
| 3537 // If value_reg is a smi, we're done. | 3544 // If value_reg is a smi, we're done. |
| 3538 JumpIfSmi(value_reg, &store_num); | 3545 JumpIfSmi(value_reg, &store_num); |
| 3539 | 3546 |
| 3540 // Ensure that the object is a heap number. | 3547 // Ensure that the object is a heap number. |
| 3541 CheckMap(value_reg, scratch1, isolate()->factory()->heap_number_map(), | 3548 CheckMap(value_reg, scratch1, isolate()->factory()->heap_number_map(), |
| 3542 fail, DONT_DO_SMI_CHECK); | 3549 fail, DONT_DO_SMI_CHECK); |
| 3543 | 3550 |
| 3544 Ldr(fpscratch1, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); | 3551 Ldr(fpscratch1, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); |
| 3545 Fmov(fpscratch2, FixedDoubleArray::canonical_not_the_hole_nan_as_double()); | 3552 Fmov(fpscratch2, FixedDoubleArray::canonical_not_the_hole_nan_as_double()); |
| 3546 | 3553 |
| 3547 // Check for NaN by comparing the number to itself: NaN comparison will | 3554 // Check for NaN by comparing the number to itself: NaN comparison will |
| 3548 // report unordered, indicated by the overflow flag being set. | 3555 // report unordered, indicated by the overflow flag being set. |
| 3549 Fcmp(fpscratch1, fpscratch1); | 3556 Fcmp(fpscratch1, fpscratch1); |
| 3550 Fcsel(fpscratch1, fpscratch2, fpscratch1, vs); | 3557 Fcsel(fpscratch1, fpscratch2, fpscratch1, vs); |
| 3551 | 3558 |
| 3552 // Store the result. | 3559 // Store the result. |
| 3553 Bind(&store_num); | 3560 Bind(&store_num); |
| 3554 Add(scratch1, elements_reg, | 3561 Add(scratch1, elements_reg, |
| 3555 Operand::UntagSmiAndScale(key_reg, kDoubleSizeLog2)); | 3562 Operand::UntagSmiAndScale(key_reg, kDoubleSizeLog2)); |
| 3556 Str(fpscratch1, FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize)); | 3563 Str(fpscratch1, |
| 3564 FieldMemOperand(scratch1, |
| 3565 FixedDoubleArray::kHeaderSize - elements_offset)); |
| 3557 } | 3566 } |
| 3558 | 3567 |
| 3559 | 3568 |
| 3560 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 3569 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
| 3561 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 3570 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
| 3562 } | 3571 } |
| 3563 | 3572 |
| 3564 | 3573 |
| 3565 void MacroAssembler::IndexFromHash(Register hash, Register index) { | 3574 void MacroAssembler::IndexFromHash(Register hash, Register index) { |
| 3566 // If the hash field contains an array index pick it out. The assert checks | 3575 // If the hash field contains an array index pick it out. The assert checks |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4785 } | 4794 } |
| 4786 } | 4795 } |
| 4787 | 4796 |
| 4788 | 4797 |
| 4789 #undef __ | 4798 #undef __ |
| 4790 | 4799 |
| 4791 | 4800 |
| 4792 } } // namespace v8::internal | 4801 } } // namespace v8::internal |
| 4793 | 4802 |
| 4794 #endif // V8_TARGET_ARCH_A64 | 4803 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |