| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 *parity = NO_MARKING_PARITY; | 863 *parity = NO_MARKING_PARITY; |
| 864 } else { | 864 } else { |
| 865 Address target_address = Memory::Address_at( | 865 Address target_address = Memory::Address_at( |
| 866 sequence + Assembler::kInstrSize * (kNoCodeAgeSequenceLength - 1)); | 866 sequence + Assembler::kInstrSize * (kNoCodeAgeSequenceLength - 1)); |
| 867 Code* stub = GetCodeFromTargetAddress(target_address); | 867 Code* stub = GetCodeFromTargetAddress(target_address); |
| 868 GetCodeAgeAndParity(stub, age, parity); | 868 GetCodeAgeAndParity(stub, age, parity); |
| 869 } | 869 } |
| 870 } | 870 } |
| 871 | 871 |
| 872 | 872 |
| 873 void Code::PatchPlatformCodeAge(Isolate* isolate, | 873 void Code::PatchPlatformCodeAge(byte* sequence, |
| 874 byte* sequence, | |
| 875 Code::Age age, | 874 Code::Age age, |
| 876 MarkingParity parity) { | 875 MarkingParity parity) { |
| 877 uint32_t young_length; | 876 uint32_t young_length; |
| 878 byte* young_sequence = GetNoCodeAgeSequence(&young_length); | 877 byte* young_sequence = GetNoCodeAgeSequence(&young_length); |
| 879 if (age == kNoAge) { | 878 if (age == kNoAge) { |
| 880 CopyBytes(sequence, young_sequence, young_length); | 879 CopyBytes(sequence, young_sequence, young_length); |
| 881 CPU::FlushICache(sequence, young_length); | 880 CPU::FlushICache(sequence, young_length); |
| 882 } else { | 881 } else { |
| 883 Code* stub = GetCodeAgeStub(isolate, age, parity); | 882 Code* stub = GetCodeAgeStub(age, parity); |
| 884 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); | 883 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); |
| 885 patcher.masm()->add(r0, pc, Operand(-8)); | 884 patcher.masm()->add(r0, pc, Operand(-8)); |
| 886 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 885 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
| 887 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 886 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
| 888 } | 887 } |
| 889 } | 888 } |
| 890 | 889 |
| 891 | 890 |
| 892 } } // namespace v8::internal | 891 } } // namespace v8::internal |
| 893 | 892 |
| 894 #endif // V8_TARGET_ARCH_ARM | 893 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |