| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); | 608 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); |
| 609 patcher.masm()->stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 609 patcher.masm()->stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 610 patcher.masm()->LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 610 patcher.masm()->LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 611 patcher.masm()->add(fp, sp, Operand(2 * kPointerSize)); | 611 patcher.masm()->add(fp, sp, Operand(2 * kPointerSize)); |
| 612 initialized = true; | 612 initialized = true; |
| 613 } | 613 } |
| 614 return byte_sequence; | 614 return byte_sequence; |
| 615 } | 615 } |
| 616 | 616 |
| 617 | 617 |
| 618 byte* Code::FindPlatformCodeAgeSequence() { | |
| 619 byte* start = instruction_start(); | |
| 620 uint32_t young_length; | |
| 621 byte* young_sequence = GetNoCodeAgeSequence(&young_length); | |
| 622 if (!memcmp(start, young_sequence, young_length) || | |
| 623 Memory::uint32_at(start) == kCodeAgePatchFirstInstruction) { | |
| 624 return start; | |
| 625 } else { | |
| 626 byte* start_after_strict = NULL; | |
| 627 if (kind() == FUNCTION) { | |
| 628 start_after_strict = start + kSizeOfFullCodegenStrictModePrologue; | |
| 629 } else { | |
| 630 ASSERT(kind() == OPTIMIZED_FUNCTION); | |
| 631 start_after_strict = start + kSizeOfOptimizedStrictModePrologue; | |
| 632 } | |
| 633 ASSERT(!memcmp(start_after_strict, young_sequence, young_length) || | |
| 634 Memory::uint32_at(start_after_strict) == | |
| 635 kCodeAgePatchFirstInstruction); | |
| 636 return start_after_strict; | |
| 637 } | |
| 638 } | |
| 639 | |
| 640 | |
| 641 bool Code::IsYoungSequence(byte* sequence) { | 618 bool Code::IsYoungSequence(byte* sequence) { |
| 642 uint32_t young_length; | 619 uint32_t young_length; |
| 643 byte* young_sequence = GetNoCodeAgeSequence(&young_length); | 620 byte* young_sequence = GetNoCodeAgeSequence(&young_length); |
| 644 bool result = !memcmp(sequence, young_sequence, young_length); | 621 bool result = !memcmp(sequence, young_sequence, young_length); |
| 645 ASSERT(result || | 622 ASSERT(result || |
| 646 Memory::uint32_at(sequence) == kCodeAgePatchFirstInstruction); | 623 Memory::uint32_at(sequence) == kCodeAgePatchFirstInstruction); |
| 647 return result; | 624 return result; |
| 648 } | 625 } |
| 649 | 626 |
| 650 | 627 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 676 patcher.masm()->add(r0, pc, Operand(-8)); | 653 patcher.masm()->add(r0, pc, Operand(-8)); |
| 677 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 654 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
| 678 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 655 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
| 679 } | 656 } |
| 680 } | 657 } |
| 681 | 658 |
| 682 | 659 |
| 683 } } // namespace v8::internal | 660 } } // namespace v8::internal |
| 684 | 661 |
| 685 #endif // V8_TARGET_ARCH_ARM | 662 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |