| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 4897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4908 | 4908 |
| 4909 #undef __ | 4909 #undef __ |
| 4910 | 4910 |
| 4911 | 4911 |
| 4912 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 4912 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
| 4913 Address pc, | 4913 Address pc, |
| 4914 BackEdgeState target_state, | 4914 BackEdgeState target_state, |
| 4915 Code* replacement_code) { | 4915 Code* replacement_code) { |
| 4916 // Turn the jump into a nop. | 4916 // Turn the jump into a nop. |
| 4917 Address branch_address = pc - 3 * kInstructionSize; | 4917 Address branch_address = pc - 3 * kInstructionSize; |
| 4918 PatchingAssembler patcher(unoptimized_code->GetIsolate(), branch_address, 1); | 4918 Isolate* isolate = unoptimized_code->GetIsolate(); |
| 4919 PatchingAssembler patcher(isolate, branch_address, 1); |
| 4919 | 4920 |
| 4920 DCHECK(Instruction::Cast(branch_address) | 4921 DCHECK(Instruction::Cast(branch_address) |
| 4921 ->IsNop(Assembler::INTERRUPT_CODE_NOP) || | 4922 ->IsNop(Assembler::INTERRUPT_CODE_NOP) || |
| 4922 (Instruction::Cast(branch_address)->IsCondBranchImm() && | 4923 (Instruction::Cast(branch_address)->IsCondBranchImm() && |
| 4923 Instruction::Cast(branch_address)->ImmPCOffset() == | 4924 Instruction::Cast(branch_address)->ImmPCOffset() == |
| 4924 6 * kInstructionSize)); | 4925 6 * kInstructionSize)); |
| 4925 | 4926 |
| 4926 switch (target_state) { | 4927 switch (target_state) { |
| 4927 case INTERRUPT: | 4928 case INTERRUPT: |
| 4928 // <decrement profiling counter> | 4929 // <decrement profiling counter> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 4942 // .. .. .. .. blr x16 | 4943 // .. .. .. .. blr x16 |
| 4943 patcher.nop(Assembler::INTERRUPT_CODE_NOP); | 4944 patcher.nop(Assembler::INTERRUPT_CODE_NOP); |
| 4944 break; | 4945 break; |
| 4945 } | 4946 } |
| 4946 | 4947 |
| 4947 // Replace the call address. | 4948 // Replace the call address. |
| 4948 Instruction* load = Instruction::Cast(pc)->preceding(2); | 4949 Instruction* load = Instruction::Cast(pc)->preceding(2); |
| 4949 Address interrupt_address_pointer = | 4950 Address interrupt_address_pointer = |
| 4950 reinterpret_cast<Address>(load) + load->ImmPCOffset(); | 4951 reinterpret_cast<Address>(load) + load->ImmPCOffset(); |
| 4951 DCHECK((Memory::uint64_at(interrupt_address_pointer) == | 4952 DCHECK((Memory::uint64_at(interrupt_address_pointer) == |
| 4952 reinterpret_cast<uint64_t>(unoptimized_code->GetIsolate() | 4953 reinterpret_cast<uint64_t>( |
| 4953 ->builtins() | 4954 isolate->builtins()->OnStackReplacement()->entry())) || |
| 4954 ->OnStackReplacement() | |
| 4955 ->entry())) || | |
| 4956 (Memory::uint64_at(interrupt_address_pointer) == | 4955 (Memory::uint64_at(interrupt_address_pointer) == |
| 4957 reinterpret_cast<uint64_t>(unoptimized_code->GetIsolate() | 4956 reinterpret_cast<uint64_t>( |
| 4958 ->builtins() | 4957 isolate->builtins()->InterruptCheck()->entry())) || |
| 4959 ->InterruptCheck() | |
| 4960 ->entry())) || | |
| 4961 (Memory::uint64_at(interrupt_address_pointer) == | 4958 (Memory::uint64_at(interrupt_address_pointer) == |
| 4962 reinterpret_cast<uint64_t>(unoptimized_code->GetIsolate() | 4959 reinterpret_cast<uint64_t>( |
| 4963 ->builtins() | 4960 isolate->builtins()->OsrAfterStackCheck()->entry())) || |
| 4964 ->OsrAfterStackCheck() | |
| 4965 ->entry())) || | |
| 4966 (Memory::uint64_at(interrupt_address_pointer) == | 4961 (Memory::uint64_at(interrupt_address_pointer) == |
| 4967 reinterpret_cast<uint64_t>(unoptimized_code->GetIsolate() | 4962 reinterpret_cast<uint64_t>( |
| 4968 ->builtins() | 4963 isolate->builtins()->OnStackReplacement()->entry()))); |
| 4969 ->OnStackReplacement() | |
| 4970 ->entry()))); | |
| 4971 Memory::uint64_at(interrupt_address_pointer) = | 4964 Memory::uint64_at(interrupt_address_pointer) = |
| 4972 reinterpret_cast<uint64_t>(replacement_code->entry()); | 4965 reinterpret_cast<uint64_t>(replacement_code->entry()); |
| 4973 | 4966 |
| 4974 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4967 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 4975 unoptimized_code, reinterpret_cast<Address>(load), replacement_code); | 4968 unoptimized_code, reinterpret_cast<Address>(load), replacement_code); |
| 4976 } | 4969 } |
| 4977 | 4970 |
| 4978 | 4971 |
| 4979 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4972 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
| 4980 Isolate* isolate, | 4973 Isolate* isolate, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 5001 } | 4994 } |
| 5002 | 4995 |
| 5003 return INTERRUPT; | 4996 return INTERRUPT; |
| 5004 } | 4997 } |
| 5005 | 4998 |
| 5006 | 4999 |
| 5007 } // namespace internal | 5000 } // namespace internal |
| 5008 } // namespace v8 | 5001 } // namespace v8 |
| 5009 | 5002 |
| 5010 #endif // V8_TARGET_ARCH_ARM64 | 5003 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |