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 4088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4099 // bge <ok> ;; not changed | 4099 // bge <ok> ;; not changed |
4100 // mov r12, <interrupt stub address> | 4100 // mov r12, <interrupt stub address> |
4101 // mtlr r12 | 4101 // mtlr r12 |
4102 // blrl | 4102 // blrl |
4103 // <reset profiling counter> | 4103 // <reset profiling counter> |
4104 // ok-label | 4104 // ok-label |
4105 patcher.masm()->cmpi(r6, Operand::Zero()); | 4105 patcher.masm()->cmpi(r6, Operand::Zero()); |
4106 break; | 4106 break; |
4107 } | 4107 } |
4108 case ON_STACK_REPLACEMENT: | 4108 case ON_STACK_REPLACEMENT: |
4109 case OSR_AFTER_STACK_CHECK: | |
4110 // <decrement profiling counter> | 4109 // <decrement profiling counter> |
4111 // crset | 4110 // crset |
4112 // bge <ok> ;; not changed | 4111 // bge <ok> ;; not changed |
4113 // mov r12, <on-stack replacement address> | 4112 // mov r12, <on-stack replacement address> |
4114 // mtlr r12 | 4113 // mtlr r12 |
4115 // blrl | 4114 // blrl |
4116 // <reset profiling counter> | 4115 // <reset profiling counter> |
4117 // ok-label ----- pc_after points here | 4116 // ok-label ----- pc_after points here |
4118 | 4117 |
4119 // Set the LT bit such that bge is a NOP | 4118 // Set the LT bit such that bge is a NOP |
4120 patcher.masm()->crset(Assembler::encode_crbit(cr7, CR_LT)); | 4119 patcher.masm()->crset(Assembler::encode_crbit(cr7, CR_LT)); |
4121 break; | 4120 break; |
4122 } | 4121 } |
4123 | 4122 |
4124 // Replace the stack check address in the mov sequence with the | 4123 // Replace the stack check address in the mov sequence with the |
4125 // entry address of the replacement code. | 4124 // entry address of the replacement code. |
4126 Assembler::set_target_address_at(isolate, mov_address, unoptimized_code, | 4125 Assembler::set_target_address_at(isolate, mov_address, unoptimized_code, |
4127 replacement_code->entry()); | 4126 replacement_code->entry()); |
4128 | 4127 |
4129 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4128 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
4130 unoptimized_code, mov_address, replacement_code); | 4129 unoptimized_code, mov_address, replacement_code); |
4131 } | 4130 } |
4132 | 4131 |
4133 | 4132 |
4134 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4133 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
4135 Isolate* isolate, Code* unoptimized_code, Address pc) { | 4134 Isolate* isolate, Code* unoptimized_code, Address pc) { |
4136 Address mov_address = Assembler::target_address_from_return_address(pc); | 4135 Address mov_address = Assembler::target_address_from_return_address(pc); |
4137 Address cmp_address = mov_address - 2 * Assembler::kInstrSize; | 4136 Address cmp_address = mov_address - 2 * Assembler::kInstrSize; |
| 4137 #ifdef DEBUG |
4138 Address interrupt_address = | 4138 Address interrupt_address = |
4139 Assembler::target_address_at(mov_address, unoptimized_code); | 4139 Assembler::target_address_at(mov_address, unoptimized_code); |
| 4140 #endif |
4140 | 4141 |
4141 if (Assembler::IsCmpImmediate(Assembler::instr_at(cmp_address))) { | 4142 if (Assembler::IsCmpImmediate(Assembler::instr_at(cmp_address))) { |
4142 DCHECK(interrupt_address == isolate->builtins()->InterruptCheck()->entry()); | 4143 DCHECK(interrupt_address == isolate->builtins()->InterruptCheck()->entry()); |
4143 return INTERRUPT; | 4144 return INTERRUPT; |
4144 } | 4145 } |
4145 | 4146 |
4146 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 4147 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
4147 | 4148 |
4148 if (interrupt_address == isolate->builtins()->OnStackReplacement()->entry()) { | |
4149 return ON_STACK_REPLACEMENT; | |
4150 } | |
4151 | |
4152 DCHECK(interrupt_address == | 4149 DCHECK(interrupt_address == |
4153 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4150 isolate->builtins()->OnStackReplacement()->entry()); |
4154 return OSR_AFTER_STACK_CHECK; | 4151 return ON_STACK_REPLACEMENT; |
4155 } | 4152 } |
4156 } // namespace internal | 4153 } // namespace internal |
4157 } // namespace v8 | 4154 } // namespace v8 |
4158 #endif // V8_TARGET_ARCH_PPC | 4155 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |