OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 4883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4894 | 4894 |
4895 | 4895 |
4896 #undef __ | 4896 #undef __ |
4897 | 4897 |
4898 | 4898 |
4899 void BackEdgeTable::PatchAt(Code* unoptimized_code, Address pc, | 4899 void BackEdgeTable::PatchAt(Code* unoptimized_code, Address pc, |
4900 BackEdgeState target_state, | 4900 BackEdgeState target_state, |
4901 Code* replacement_code) { | 4901 Code* replacement_code) { |
4902 Address mov_address = Assembler::target_address_from_return_address(pc); | 4902 Address mov_address = Assembler::target_address_from_return_address(pc); |
4903 Address cmp_address = mov_address - 2 * Assembler::kInstrSize; | 4903 Address cmp_address = mov_address - 2 * Assembler::kInstrSize; |
4904 CodePatcher patcher(unoptimized_code->GetIsolate(), cmp_address, 1); | 4904 Isolate* isolate = unoptimized_code->GetIsolate(); |
| 4905 CodePatcher patcher(isolate, cmp_address, 1); |
4905 | 4906 |
4906 switch (target_state) { | 4907 switch (target_state) { |
4907 case INTERRUPT: { | 4908 case INTERRUPT: { |
4908 // <decrement profiling counter> | 4909 // <decrement profiling counter> |
4909 // cmpi r6, 0 | 4910 // cmpi r6, 0 |
4910 // bge <ok> ;; not changed | 4911 // bge <ok> ;; not changed |
4911 // mov r12, <interrupt stub address> | 4912 // mov r12, <interrupt stub address> |
4912 // mtlr r12 | 4913 // mtlr r12 |
4913 // blrl | 4914 // blrl |
4914 // <reset profiling counter> | 4915 // <reset profiling counter> |
(...skipping 12 matching lines...) Expand all Loading... |
4927 // <reset profiling counter> | 4928 // <reset profiling counter> |
4928 // ok-label ----- pc_after points here | 4929 // ok-label ----- pc_after points here |
4929 | 4930 |
4930 // Set the LT bit such that bge is a NOP | 4931 // Set the LT bit such that bge is a NOP |
4931 patcher.masm()->crset(Assembler::encode_crbit(cr7, CR_LT)); | 4932 patcher.masm()->crset(Assembler::encode_crbit(cr7, CR_LT)); |
4932 break; | 4933 break; |
4933 } | 4934 } |
4934 | 4935 |
4935 // Replace the stack check address in the mov sequence with the | 4936 // Replace the stack check address in the mov sequence with the |
4936 // entry address of the replacement code. | 4937 // entry address of the replacement code. |
4937 Assembler::set_target_address_at(mov_address, unoptimized_code, | 4938 Assembler::set_target_address_at(isolate, mov_address, unoptimized_code, |
4938 replacement_code->entry()); | 4939 replacement_code->entry()); |
4939 | 4940 |
4940 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4941 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
4941 unoptimized_code, mov_address, replacement_code); | 4942 unoptimized_code, mov_address, replacement_code); |
4942 } | 4943 } |
4943 | 4944 |
4944 | 4945 |
4945 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4946 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
4946 Isolate* isolate, Code* unoptimized_code, Address pc) { | 4947 Isolate* isolate, Code* unoptimized_code, Address pc) { |
4947 Address mov_address = Assembler::target_address_from_return_address(pc); | 4948 Address mov_address = Assembler::target_address_from_return_address(pc); |
(...skipping 12 matching lines...) Expand all Loading... |
4960 return ON_STACK_REPLACEMENT; | 4961 return ON_STACK_REPLACEMENT; |
4961 } | 4962 } |
4962 | 4963 |
4963 DCHECK(interrupt_address == | 4964 DCHECK(interrupt_address == |
4964 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4965 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4965 return OSR_AFTER_STACK_CHECK; | 4966 return OSR_AFTER_STACK_CHECK; |
4966 } | 4967 } |
4967 } // namespace internal | 4968 } // namespace internal |
4968 } // namespace v8 | 4969 } // namespace v8 |
4969 #endif // V8_TARGET_ARCH_PPC | 4970 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |