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/arm64/assembler-arm64-inl.h" | 7 #include "src/arm64/assembler-arm64-inl.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 LOG(isolate, PatchIC(address, info_address, info.SmiCheckDelta())); | 64 LOG(isolate, PatchIC(address, info_address, info.SmiCheckDelta())); |
65 } | 65 } |
66 | 66 |
67 // Patch and activate code generated by JumpPatchSite::EmitJumpIfNotSmi() | 67 // Patch and activate code generated by JumpPatchSite::EmitJumpIfNotSmi() |
68 // and JumpPatchSite::EmitJumpIfSmi(). | 68 // and JumpPatchSite::EmitJumpIfSmi(). |
69 // Changing | 69 // Changing |
70 // tb(n)z xzr, #0, <target> | 70 // tb(n)z xzr, #0, <target> |
71 // to | 71 // to |
72 // tb(!n)z test_reg, #0, <target> | 72 // tb(!n)z test_reg, #0, <target> |
73 Instruction* to_patch = info.SmiCheck(); | 73 Instruction* to_patch = info.SmiCheck(); |
74 PatchingAssembler patcher(isolate, to_patch, 1); | 74 PatchingAssembler patcher(isolate, reinterpret_cast<byte*>(to_patch), 1); |
75 DCHECK(to_patch->IsTestBranch()); | 75 DCHECK(to_patch->IsTestBranch()); |
76 DCHECK(to_patch->ImmTestBranchBit5() == 0); | 76 DCHECK(to_patch->ImmTestBranchBit5() == 0); |
77 DCHECK(to_patch->ImmTestBranchBit40() == 0); | 77 DCHECK(to_patch->ImmTestBranchBit40() == 0); |
78 | 78 |
79 STATIC_ASSERT(kSmiTag == 0); | 79 STATIC_ASSERT(kSmiTag == 0); |
80 STATIC_ASSERT(kSmiTagMask == 1); | 80 STATIC_ASSERT(kSmiTagMask == 1); |
81 | 81 |
82 int branch_imm = to_patch->ImmTestBranch(); | 82 int branch_imm = to_patch->ImmTestBranch(); |
83 Register smi_reg; | 83 Register smi_reg; |
84 if (check == ENABLE_INLINED_SMI_CHECK) { | 84 if (check == ENABLE_INLINED_SMI_CHECK) { |
(...skipping 11 matching lines...) Expand all Loading... |
96 } else { | 96 } else { |
97 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); | 97 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); |
98 // This is JumpIfSmi(smi_reg, branch_imm). | 98 // This is JumpIfSmi(smi_reg, branch_imm). |
99 patcher.tbz(smi_reg, 0, branch_imm); | 99 patcher.tbz(smi_reg, 0, branch_imm); |
100 } | 100 } |
101 } | 101 } |
102 } // namespace internal | 102 } // namespace internal |
103 } // namespace v8 | 103 } // namespace v8 |
104 | 104 |
105 #endif // V8_TARGET_ARCH_ARM64 | 105 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |