OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 4895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4906 | 4906 |
4907 #undef __ | 4907 #undef __ |
4908 | 4908 |
4909 | 4909 |
4910 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 4910 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
4911 Address pc, | 4911 Address pc, |
4912 BackEdgeState target_state, | 4912 BackEdgeState target_state, |
4913 Code* replacement_code) { | 4913 Code* replacement_code) { |
4914 static const int kInstrSize = Assembler::kInstrSize; | 4914 static const int kInstrSize = Assembler::kInstrSize; |
4915 Address branch_address = pc - 8 * kInstrSize; | 4915 Address branch_address = pc - 8 * kInstrSize; |
4916 CodePatcher patcher(unoptimized_code->GetIsolate(), branch_address, 1); | 4916 Isolate* isolate = unoptimized_code->GetIsolate(); |
| 4917 CodePatcher patcher(isolate, branch_address, 1); |
4917 | 4918 |
4918 switch (target_state) { | 4919 switch (target_state) { |
4919 case INTERRUPT: | 4920 case INTERRUPT: |
4920 // slt at, a3, zero_reg (in case of count based interrupts) | 4921 // slt at, a3, zero_reg (in case of count based interrupts) |
4921 // beq at, zero_reg, ok | 4922 // beq at, zero_reg, ok |
4922 // lui t9, <interrupt stub address> upper | 4923 // lui t9, <interrupt stub address> upper |
4923 // ori t9, <interrupt stub address> u-middle | 4924 // ori t9, <interrupt stub address> u-middle |
4924 // dsll t9, t9, 16 | 4925 // dsll t9, t9, 16 |
4925 // ori t9, <interrupt stub address> lower | 4926 // ori t9, <interrupt stub address> lower |
4926 // jalr t9 | 4927 // jalr t9 |
(...skipping 11 matching lines...) Expand all Loading... |
4938 // ori t9, <on-stack replacement address> lower | 4939 // ori t9, <on-stack replacement address> lower |
4939 // jalr t9 ;; Not changed | 4940 // jalr t9 ;; Not changed |
4940 // nop ;; Not changed | 4941 // nop ;; Not changed |
4941 // ok-label ----- pc_after points here | 4942 // ok-label ----- pc_after points here |
4942 patcher.masm()->daddiu(at, zero_reg, 1); | 4943 patcher.masm()->daddiu(at, zero_reg, 1); |
4943 break; | 4944 break; |
4944 } | 4945 } |
4945 Address pc_immediate_load_address = pc - 6 * kInstrSize; | 4946 Address pc_immediate_load_address = pc - 6 * kInstrSize; |
4946 // Replace the stack check address in the load-immediate (6-instr sequence) | 4947 // Replace the stack check address in the load-immediate (6-instr sequence) |
4947 // with the entry address of the replacement code. | 4948 // with the entry address of the replacement code. |
4948 Assembler::set_target_address_at(pc_immediate_load_address, | 4949 Assembler::set_target_address_at(isolate, pc_immediate_load_address, |
4949 replacement_code->entry()); | 4950 replacement_code->entry()); |
4950 | 4951 |
4951 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4952 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
4952 unoptimized_code, pc_immediate_load_address, replacement_code); | 4953 unoptimized_code, pc_immediate_load_address, replacement_code); |
4953 } | 4954 } |
4954 | 4955 |
4955 | 4956 |
4956 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4957 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
4957 Isolate* isolate, | 4958 Isolate* isolate, |
4958 Code* unoptimized_code, | 4959 Code* unoptimized_code, |
(...skipping 25 matching lines...) Expand all Loading... |
4984 reinterpret_cast<uint64_t>( | 4985 reinterpret_cast<uint64_t>( |
4985 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4986 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4986 return OSR_AFTER_STACK_CHECK; | 4987 return OSR_AFTER_STACK_CHECK; |
4987 } | 4988 } |
4988 | 4989 |
4989 | 4990 |
4990 } // namespace internal | 4991 } // namespace internal |
4991 } // namespace v8 | 4992 } // namespace v8 |
4992 | 4993 |
4993 #endif // V8_TARGET_ARCH_MIPS64 | 4994 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |