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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 | 599 |
600 static byte* GetNoCodeAgeSequence(uint32_t* length) { | 600 static byte* GetNoCodeAgeSequence(uint32_t* length) { |
601 // The sequence of instructions that is patched out for aging code is the | 601 // The sequence of instructions that is patched out for aging code is the |
602 // following boilerplate stack-building prologue that is found in FUNCTIONS | 602 // following boilerplate stack-building prologue that is found in FUNCTIONS |
603 static bool initialized = false; | 603 static bool initialized = false; |
604 static uint32_t sequence[kNoCodeAgeSequenceLength]; | 604 static uint32_t sequence[kNoCodeAgeSequenceLength]; |
605 byte* byte_sequence = reinterpret_cast<byte*>(sequence); | 605 byte* byte_sequence = reinterpret_cast<byte*>(sequence); |
606 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize; | 606 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize; |
607 if (!initialized) { | 607 if (!initialized) { |
608 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); | 608 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); |
| 609 PredictableCodeSizeScope scope(patcher.masm(), *length); |
609 patcher.masm()->stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 610 patcher.masm()->stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
610 patcher.masm()->LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 611 patcher.masm()->LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
611 patcher.masm()->add(fp, sp, Operand(2 * kPointerSize)); | 612 patcher.masm()->add(fp, sp, Operand(2 * kPointerSize)); |
612 initialized = true; | 613 initialized = true; |
613 } | 614 } |
614 return byte_sequence; | 615 return byte_sequence; |
615 } | 616 } |
616 | 617 |
617 | 618 |
618 bool Code::IsYoungSequence(byte* sequence) { | 619 bool Code::IsYoungSequence(byte* sequence) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 patcher.masm()->add(r0, pc, Operand(-8)); | 654 patcher.masm()->add(r0, pc, Operand(-8)); |
654 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 655 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
655 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 656 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
656 } | 657 } |
657 } | 658 } |
658 | 659 |
659 | 660 |
660 } } // namespace v8::internal | 661 } } // namespace v8::internal |
661 | 662 |
662 #endif // V8_TARGET_ARCH_ARM | 663 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |