| 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 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4918 return load_address; | 4918 return load_address; |
| 4919 } | 4919 } |
| 4920 | 4920 |
| 4921 | 4921 |
| 4922 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 4922 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
| 4923 Address pc, | 4923 Address pc, |
| 4924 BackEdgeState target_state, | 4924 BackEdgeState target_state, |
| 4925 Code* replacement_code) { | 4925 Code* replacement_code) { |
| 4926 Address pc_immediate_load_address = GetInterruptImmediateLoadAddress(pc); | 4926 Address pc_immediate_load_address = GetInterruptImmediateLoadAddress(pc); |
| 4927 Address branch_address = pc_immediate_load_address - Assembler::kInstrSize; | 4927 Address branch_address = pc_immediate_load_address - Assembler::kInstrSize; |
| 4928 CodePatcher patcher(unoptimized_code->GetIsolate(), branch_address, 1); | 4928 Isolate* isolate = unoptimized_code->GetIsolate(); |
| 4929 CodePatcher patcher(isolate, branch_address, 1); |
| 4929 switch (target_state) { | 4930 switch (target_state) { |
| 4930 case INTERRUPT: | 4931 case INTERRUPT: |
| 4931 { | 4932 { |
| 4932 // <decrement profiling counter> | 4933 // <decrement profiling counter> |
| 4933 // bpl ok | 4934 // bpl ok |
| 4934 // ; load interrupt stub address into ip - either of (for ARMv7): | 4935 // ; load interrupt stub address into ip - either of (for ARMv7): |
| 4935 // ; <small cp load> | <extended cp load> | <immediate load> | 4936 // ; <small cp load> | <extended cp load> | <immediate load> |
| 4936 // ldr ip, [pc/pp, #imm] | movw ip, #imm | movw ip, #imm | 4937 // ldr ip, [pc/pp, #imm] | movw ip, #imm | movw ip, #imm |
| 4937 // | movt ip, #imm | movw ip, #imm | 4938 // | movt ip, #imm | movw ip, #imm |
| 4938 // | ldr ip, [pp, ip] | 4939 // | ldr ip, [pp, ip] |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4970 // | orr ip, ip, #imm> | orr ip, ip, #imm | 4971 // | orr ip, ip, #imm> | orr ip, ip, #imm |
| 4971 // | orr ip, ip, #imm> | orr ip, ip, #imm | 4972 // | orr ip, ip, #imm> | orr ip, ip, #imm |
| 4972 // blx ip | 4973 // blx ip |
| 4973 // <reset profiling counter> | 4974 // <reset profiling counter> |
| 4974 // ok-label | 4975 // ok-label |
| 4975 patcher.masm()->nop(); | 4976 patcher.masm()->nop(); |
| 4976 break; | 4977 break; |
| 4977 } | 4978 } |
| 4978 | 4979 |
| 4979 // Replace the call address. | 4980 // Replace the call address. |
| 4980 Assembler::set_target_address_at(pc_immediate_load_address, unoptimized_code, | 4981 Assembler::set_target_address_at(isolate, pc_immediate_load_address, |
| 4981 replacement_code->entry()); | 4982 unoptimized_code, replacement_code->entry()); |
| 4982 | 4983 |
| 4983 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 4984 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 4984 unoptimized_code, pc_immediate_load_address, replacement_code); | 4985 unoptimized_code, pc_immediate_load_address, replacement_code); |
| 4985 } | 4986 } |
| 4986 | 4987 |
| 4987 | 4988 |
| 4988 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( | 4989 BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
| 4989 Isolate* isolate, | 4990 Isolate* isolate, |
| 4990 Code* unoptimized_code, | 4991 Code* unoptimized_code, |
| 4991 Address pc) { | 4992 Address pc) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 5012 DCHECK(interrupt_address == | 5013 DCHECK(interrupt_address == |
| 5013 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5014 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5014 return OSR_AFTER_STACK_CHECK; | 5015 return OSR_AFTER_STACK_CHECK; |
| 5015 } | 5016 } |
| 5016 | 5017 |
| 5017 | 5018 |
| 5018 } // namespace internal | 5019 } // namespace internal |
| 5019 } // namespace v8 | 5020 } // namespace v8 |
| 5020 | 5021 |
| 5021 #endif // V8_TARGET_ARCH_ARM | 5022 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |