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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 4891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4902 | 4902 |
4903 #undef __ | 4903 #undef __ |
4904 | 4904 |
4905 | 4905 |
4906 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 4906 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
4907 Address pc, | 4907 Address pc, |
4908 BackEdgeState target_state, | 4908 BackEdgeState target_state, |
4909 Code* replacement_code) { | 4909 Code* replacement_code) { |
4910 static const int kInstrSize = Assembler::kInstrSize; | 4910 static const int kInstrSize = Assembler::kInstrSize; |
4911 Address branch_address = pc - 6 * kInstrSize; | 4911 Address branch_address = pc - 6 * kInstrSize; |
4912 CodePatcher patcher(unoptimized_code->GetIsolate(), branch_address, 1); | 4912 Isolate* isolate = unoptimized_code->GetIsolate(); |
| 4913 CodePatcher patcher(isolate, branch_address, 1); |
4913 | 4914 |
4914 switch (target_state) { | 4915 switch (target_state) { |
4915 case INTERRUPT: | 4916 case INTERRUPT: |
4916 // slt at, a3, zero_reg (in case of count based interrupts) | 4917 // slt at, a3, zero_reg (in case of count based interrupts) |
4917 // beq at, zero_reg, ok | 4918 // beq at, zero_reg, ok |
4918 // lui t9, <interrupt stub address> upper | 4919 // lui t9, <interrupt stub address> upper |
4919 // ori t9, <interrupt stub address> lower | 4920 // ori t9, <interrupt stub address> lower |
4920 // jalr t9 | 4921 // jalr t9 |
4921 // nop | 4922 // nop |
4922 // ok-label ----- pc_after points here | 4923 // ok-label ----- pc_after points here |
4923 patcher.masm()->slt(at, a3, zero_reg); | 4924 patcher.masm()->slt(at, a3, zero_reg); |
4924 break; | 4925 break; |
4925 case ON_STACK_REPLACEMENT: | 4926 case ON_STACK_REPLACEMENT: |
4926 case OSR_AFTER_STACK_CHECK: | 4927 case OSR_AFTER_STACK_CHECK: |
4927 // addiu at, zero_reg, 1 | 4928 // addiu at, zero_reg, 1 |
4928 // beq at, zero_reg, ok ;; Not changed | 4929 // beq at, zero_reg, ok ;; Not changed |
4929 // lui t9, <on-stack replacement address> upper | 4930 // lui t9, <on-stack replacement address> upper |
4930 // ori t9, <on-stack replacement address> lower | 4931 // ori t9, <on-stack replacement address> lower |
4931 // jalr t9 ;; Not changed | 4932 // jalr t9 ;; Not changed |
4932 // nop ;; Not changed | 4933 // nop ;; Not changed |
4933 // ok-label ----- pc_after points here | 4934 // ok-label ----- pc_after points here |
4934 patcher.masm()->addiu(at, zero_reg, 1); | 4935 patcher.masm()->addiu(at, zero_reg, 1); |
4935 break; | 4936 break; |
4936 } | 4937 } |
4937 Address pc_immediate_load_address = pc - 4 * kInstrSize; | 4938 Address pc_immediate_load_address = pc - 4 * kInstrSize; |
4938 // Replace the stack check address in the load-immediate (lui/ori pair) | 4939 // Replace the stack check address in the load-immediate (lui/ori pair) |
4939 // with the entry address of the replacement code. | 4940 // with the entry address of the replacement code. |
4940 Assembler::set_target_address_at(pc_immediate_load_address, | 4941 Assembler::set_target_address_at(isolate, pc_immediate_load_address, |
4941 replacement_code->entry()); | 4942 replacement_code->entry()); |
4942 | 4943 |
4943 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4944 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
4944 unoptimized_code, pc_immediate_load_address, replacement_code); | 4945 unoptimized_code, pc_immediate_load_address, replacement_code); |
4945 } | 4946 } |
4946 | 4947 |
4947 | 4948 |
4948 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4949 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
4949 Isolate* isolate, | 4950 Isolate* isolate, |
4950 Code* unoptimized_code, | 4951 Code* unoptimized_code, |
(...skipping 25 matching lines...) Expand all Loading... |
4976 reinterpret_cast<uint32_t>( | 4977 reinterpret_cast<uint32_t>( |
4977 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4978 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4978 return OSR_AFTER_STACK_CHECK; | 4979 return OSR_AFTER_STACK_CHECK; |
4979 } | 4980 } |
4980 | 4981 |
4981 | 4982 |
4982 } // namespace internal | 4983 } // namespace internal |
4983 } // namespace v8 | 4984 } // namespace v8 |
4984 | 4985 |
4985 #endif // V8_TARGET_ARCH_MIPS | 4986 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |