| 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 #include "src/arm/codegen-arm.h" | 5 #include "src/arm/codegen-arm.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/arm/simulator-arm.h" | 9 #include "src/arm/simulator-arm.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008; | 886 static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008; |
| 887 #endif | 887 #endif |
| 888 | 888 |
| 889 CodeAgingHelper::CodeAgingHelper(Isolate* isolate) { | 889 CodeAgingHelper::CodeAgingHelper(Isolate* isolate) { |
| 890 USE(isolate); | 890 USE(isolate); |
| 891 DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); | 891 DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); |
| 892 // Since patcher is a large object, allocate it dynamically when needed, | 892 // Since patcher is a large object, allocate it dynamically when needed, |
| 893 // to avoid overloading the stack in stress conditions. | 893 // to avoid overloading the stack in stress conditions. |
| 894 // DONT_FLUSH is used because the CodeAgingHelper is initialized early in | 894 // DONT_FLUSH is used because the CodeAgingHelper is initialized early in |
| 895 // the process, before ARM simulator ICache is setup. | 895 // the process, before ARM simulator ICache is setup. |
| 896 base::SmartPointer<CodePatcher> patcher(new CodePatcher( | 896 base::SmartPointer<CodePatcher> patcher( |
| 897 young_sequence_.start(), young_sequence_.length() / Assembler::kInstrSize, | 897 new CodePatcher(isolate, young_sequence_.start(), |
| 898 CodePatcher::DONT_FLUSH)); | 898 young_sequence_.length() / Assembler::kInstrSize, |
| 899 CodePatcher::DONT_FLUSH)); |
| 899 PredictableCodeSizeScope scope(patcher->masm(), young_sequence_.length()); | 900 PredictableCodeSizeScope scope(patcher->masm(), young_sequence_.length()); |
| 900 patcher->masm()->PushFixedFrame(r1); | 901 patcher->masm()->PushFixedFrame(r1); |
| 901 patcher->masm()->nop(ip.code()); | 902 patcher->masm()->nop(ip.code()); |
| 902 patcher->masm()->add( | 903 patcher->masm()->add( |
| 903 fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 904 fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 904 } | 905 } |
| 905 | 906 |
| 906 | 907 |
| 907 #ifdef DEBUG | 908 #ifdef DEBUG |
| 908 bool CodeAgingHelper::IsOld(byte* candidate) const { | 909 bool CodeAgingHelper::IsOld(byte* candidate) const { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 935 void Code::PatchPlatformCodeAge(Isolate* isolate, | 936 void Code::PatchPlatformCodeAge(Isolate* isolate, |
| 936 byte* sequence, | 937 byte* sequence, |
| 937 Code::Age age, | 938 Code::Age age, |
| 938 MarkingParity parity) { | 939 MarkingParity parity) { |
| 939 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); | 940 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); |
| 940 if (age == kNoAgeCodeAge) { | 941 if (age == kNoAgeCodeAge) { |
| 941 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); | 942 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); |
| 942 Assembler::FlushICache(isolate, sequence, young_length); | 943 Assembler::FlushICache(isolate, sequence, young_length); |
| 943 } else { | 944 } else { |
| 944 Code* stub = GetCodeAgeStub(isolate, age, parity); | 945 Code* stub = GetCodeAgeStub(isolate, age, parity); |
| 945 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); | 946 CodePatcher patcher(isolate, sequence, |
| 947 young_length / Assembler::kInstrSize); |
| 946 patcher.masm()->add(r0, pc, Operand(-8)); | 948 patcher.masm()->add(r0, pc, Operand(-8)); |
| 947 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 949 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
| 948 patcher.masm()->emit_code_stub_address(stub); | 950 patcher.masm()->emit_code_stub_address(stub); |
| 949 } | 951 } |
| 950 } | 952 } |
| 951 | 953 |
| 952 | 954 |
| 953 } // namespace internal | 955 } // namespace internal |
| 954 } // namespace v8 | 956 } // namespace v8 |
| 955 | 957 |
| 956 #endif // V8_TARGET_ARCH_ARM | 958 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |