Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/mips/codegen-mips.cc

Issue 132193005: Merged r16772, r18000, r18030, r18298, r18319 into 3.21 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.21
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/deoptimizer-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 return result; 620 return result;
621 } 621 }
622 622
623 623
624 void Code::GetCodeAgeAndParity(byte* sequence, Age* age, 624 void Code::GetCodeAgeAndParity(byte* sequence, Age* age,
625 MarkingParity* parity) { 625 MarkingParity* parity) {
626 if (IsYoungSequence(sequence)) { 626 if (IsYoungSequence(sequence)) {
627 *age = kNoAge; 627 *age = kNoAge;
628 *parity = NO_MARKING_PARITY; 628 *parity = NO_MARKING_PARITY;
629 } else { 629 } else {
630 Address target_address = Memory::Address_at( 630 Address target_address = Assembler::target_address_at(
631 sequence + Assembler::kInstrSize * (kNoCodeAgeSequenceLength - 1)); 631 sequence + Assembler::kInstrSize);
632 Code* stub = GetCodeFromTargetAddress(target_address); 632 Code* stub = GetCodeFromTargetAddress(target_address);
633 GetCodeAgeAndParity(stub, age, parity); 633 GetCodeAgeAndParity(stub, age, parity);
634 } 634 }
635 } 635 }
636 636
637 637
638 void Code::PatchPlatformCodeAge(byte* sequence, 638 void Code::PatchPlatformCodeAge(byte* sequence,
639 Code::Age age, 639 Code::Age age,
640 MarkingParity parity) { 640 MarkingParity parity) {
641 uint32_t young_length; 641 uint32_t young_length;
642 byte* young_sequence = GetNoCodeAgeSequence(&young_length); 642 byte* young_sequence = GetNoCodeAgeSequence(&young_length);
643 if (age == kNoAge) { 643 if (age == kNoAge) {
644 CopyBytes(sequence, young_sequence, young_length); 644 CopyBytes(sequence, young_sequence, young_length);
645 CPU::FlushICache(sequence, young_length); 645 CPU::FlushICache(sequence, young_length);
646 } else { 646 } else {
647 Code* stub = GetCodeAgeStub(age, parity); 647 Code* stub = GetCodeAgeStub(age, parity);
648 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); 648 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize);
649 // Mark this code sequence for FindPlatformCodeAgeSequence() 649 // Mark this code sequence for FindPlatformCodeAgeSequence().
650 patcher.masm()->nop(Assembler::CODE_AGE_MARKER_NOP); 650 patcher.masm()->nop(Assembler::CODE_AGE_MARKER_NOP);
651 // Save the function's original return address 651
652 // (it will be clobbered by Call(t9)) 652 // Load the stub address to t9 and call it,
653 patcher.masm()->mov(at, ra); 653 // GetCodeAgeAndParity() extracts the stub address from this instruction.
654 // Load the stub address to t9 and call it 654 patcher.masm()->li(
655 patcher.masm()->li(t9, 655 t9,
656 Operand(reinterpret_cast<uint32_t>(stub->instruction_start()))); 656 Operand(reinterpret_cast<uint32_t>(stub->instruction_start())),
657 patcher.masm()->Call(t9); 657 CONSTANT_SIZE);
658 // Record the stub address in the empty space for GetCodeAgeAndParity() 658 patcher.masm()->nop(); // Prevent jalr to jal optimization.
659 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); 659 patcher.masm()->jalr(t9, a0);
660 patcher.masm()->nop(); // Branch delay slot nop.
661 patcher.masm()->nop(); // Pad the empty space.
660 } 662 }
661 } 663 }
662 664
663 665
664 #undef __ 666 #undef __
665 667
666 } } // namespace v8::internal 668 } } // namespace v8::internal
667 669
668 #endif // V8_TARGET_ARCH_MIPS 670 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/deoptimizer-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698