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(byte* sequence, | 873 void Code::PatchPlatformCodeAge(Isolate* isolate, |
| 874 byte* sequence, |
874 Code::Age age, | 875 Code::Age age, |
875 MarkingParity parity) { | 876 MarkingParity parity) { |
876 uint32_t young_length; | 877 uint32_t young_length; |
877 byte* young_sequence = GetNoCodeAgeSequence(&young_length); | 878 byte* young_sequence = GetNoCodeAgeSequence(&young_length); |
878 if (age == kNoAge) { | 879 if (age == kNoAge) { |
879 CopyBytes(sequence, young_sequence, young_length); | 880 CopyBytes(sequence, young_sequence, young_length); |
880 CPU::FlushICache(sequence, young_length); | 881 CPU::FlushICache(sequence, young_length); |
881 } else { | 882 } else { |
882 Code* stub = GetCodeAgeStub(age, parity); | 883 Code* stub = GetCodeAgeStub(isolate, age, parity); |
883 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); | 884 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); |
884 patcher.masm()->add(r0, pc, Operand(-8)); | 885 patcher.masm()->add(r0, pc, Operand(-8)); |
885 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 886 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
886 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 887 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
887 } | 888 } |
888 } | 889 } |
889 | 890 |
890 | 891 |
891 } } // namespace v8::internal | 892 } } // namespace v8::internal |
892 | 893 |
893 #endif // V8_TARGET_ARCH_ARM | 894 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |