OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 // function which is requesting this patch operation. | 814 // function which is requesting this patch operation. |
815 Address info_address = Assembler::return_address_from_call_start(address); | 815 Address info_address = Assembler::return_address_from_call_start(address); |
816 InlineSmiCheckInfo info(info_address); | 816 InlineSmiCheckInfo info(info_address); |
817 | 817 |
818 // Check and decode the patch information instruction. | 818 // Check and decode the patch information instruction. |
819 if (!info.HasSmiCheck()) { | 819 if (!info.HasSmiCheck()) { |
820 return; | 820 return; |
821 } | 821 } |
822 | 822 |
823 if (FLAG_trace_ic) { | 823 if (FLAG_trace_ic) { |
824 PrintF("[ Patching ic at %p, marker=%p, SMI check=%p\n", address, | 824 PrintF("[ Patching ic at %p, marker=%p, SMI check=%p\n", |
825 info_address, reinterpret_cast<void*>(info.SmiCheck())); | 825 static_cast<void*>(address), static_cast<void*>(info_address), |
| 826 static_cast<void*>(info.SmiCheck())); |
826 } | 827 } |
827 | 828 |
828 // Patch and activate code generated by JumpPatchSite::EmitJumpIfNotSmi() | 829 // Patch and activate code generated by JumpPatchSite::EmitJumpIfNotSmi() |
829 // and JumpPatchSite::EmitJumpIfSmi(). | 830 // and JumpPatchSite::EmitJumpIfSmi(). |
830 // Changing | 831 // Changing |
831 // tb(n)z xzr, #0, <target> | 832 // tb(n)z xzr, #0, <target> |
832 // to | 833 // to |
833 // tb(!n)z test_reg, #0, <target> | 834 // tb(!n)z test_reg, #0, <target> |
834 Instruction* to_patch = info.SmiCheck(); | 835 Instruction* to_patch = info.SmiCheck(); |
835 PatchingAssembler patcher(isolate, to_patch, 1); | 836 PatchingAssembler patcher(isolate, to_patch, 1); |
(...skipping 21 matching lines...) Expand all Loading... |
857 } else { | 858 } else { |
858 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); | 859 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); |
859 // This is JumpIfSmi(smi_reg, branch_imm). | 860 // This is JumpIfSmi(smi_reg, branch_imm). |
860 patcher.tbz(smi_reg, 0, branch_imm); | 861 patcher.tbz(smi_reg, 0, branch_imm); |
861 } | 862 } |
862 } | 863 } |
863 } // namespace internal | 864 } // namespace internal |
864 } // namespace v8 | 865 } // namespace v8 |
865 | 866 |
866 #endif // V8_TARGET_ARCH_ARM64 | 867 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |