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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 4156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4167 | 4167 |
4168 // Calculate branch offset to the ok-label - this is the difference | 4168 // Calculate branch offset to the ok-label - this is the difference |
4169 // between the branch address and |pc| (which points at <blx ip>) plus | 4169 // between the branch address and |pc| (which points at <blx ip>) plus |
4170 // kProfileCounterResetSequence instructions | 4170 // kProfileCounterResetSequence instructions |
4171 int branch_offset = pc - Instruction::kPCReadOffset - branch_address + | 4171 int branch_offset = pc - Instruction::kPCReadOffset - branch_address + |
4172 kProfileCounterResetSequenceLength; | 4172 kProfileCounterResetSequenceLength; |
4173 patcher.masm()->b(branch_offset, pl); | 4173 patcher.masm()->b(branch_offset, pl); |
4174 break; | 4174 break; |
4175 } | 4175 } |
4176 case ON_STACK_REPLACEMENT: | 4176 case ON_STACK_REPLACEMENT: |
4177 case OSR_AFTER_STACK_CHECK: | |
4178 // <decrement profiling counter> | 4177 // <decrement profiling counter> |
4179 // mov r0, r0 (NOP) | 4178 // mov r0, r0 (NOP) |
4180 // ; load on-stack replacement address into ip - either of (for ARMv7): | 4179 // ; load on-stack replacement address into ip - either of (for ARMv7): |
4181 // ; <small cp load> | <extended cp load> | <immediate load> | 4180 // ; <small cp load> | <extended cp load> | <immediate load> |
4182 // ldr ip, [pc/pp, #imm] | movw ip, #imm | movw ip, #imm | 4181 // ldr ip, [pc/pp, #imm] | movw ip, #imm | movw ip, #imm |
4183 // | movt ip, #imm> | movw ip, #imm | 4182 // | movt ip, #imm> | movw ip, #imm |
4184 // | ldr ip, [pp, ip] | 4183 // | ldr ip, [pp, ip] |
4185 // ; or (for ARMv6): | 4184 // ; or (for ARMv6): |
4186 // ; <small cp load> | <extended cp load> | <immediate load> | 4185 // ; <small cp load> | <extended cp load> | <immediate load> |
4187 // ldr ip, [pc/pp, #imm] | mov ip, #imm | mov ip, #imm | 4186 // ldr ip, [pc/pp, #imm] | mov ip, #imm | mov ip, #imm |
(...skipping 28 matching lines...) Expand all Loading... |
4216 pc_immediate_load_address, unoptimized_code); | 4215 pc_immediate_load_address, unoptimized_code); |
4217 | 4216 |
4218 if (Assembler::IsBranch(Assembler::instr_at(branch_address))) { | 4217 if (Assembler::IsBranch(Assembler::instr_at(branch_address))) { |
4219 DCHECK(interrupt_address == | 4218 DCHECK(interrupt_address == |
4220 isolate->builtins()->InterruptCheck()->entry()); | 4219 isolate->builtins()->InterruptCheck()->entry()); |
4221 return INTERRUPT; | 4220 return INTERRUPT; |
4222 } | 4221 } |
4223 | 4222 |
4224 DCHECK(Assembler::IsNop(Assembler::instr_at(branch_address))); | 4223 DCHECK(Assembler::IsNop(Assembler::instr_at(branch_address))); |
4225 | 4224 |
4226 if (interrupt_address == | |
4227 isolate->builtins()->OnStackReplacement()->entry()) { | |
4228 return ON_STACK_REPLACEMENT; | |
4229 } | |
4230 | |
4231 DCHECK(interrupt_address == | 4225 DCHECK(interrupt_address == |
4232 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4226 isolate->builtins()->OnStackReplacement()->entry()); |
4233 return OSR_AFTER_STACK_CHECK; | 4227 return ON_STACK_REPLACEMENT; |
4234 } | 4228 } |
4235 | 4229 |
4236 | 4230 |
4237 } // namespace internal | 4231 } // namespace internal |
4238 } // namespace v8 | 4232 } // namespace v8 |
4239 | 4233 |
4240 #endif // V8_TARGET_ARCH_ARM | 4234 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |