OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4693 scratch, Operand(ORI)); | 4693 scratch, Operand(ORI)); |
4694 lw(scratch, MemOperand(li_location, kInstrSize)); | 4694 lw(scratch, MemOperand(li_location, kInstrSize)); |
4695 } | 4695 } |
4696 Ins(scratch, new_value, 0, kImm16Bits); | 4696 Ins(scratch, new_value, 0, kImm16Bits); |
4697 sw(scratch, MemOperand(li_location, kInstrSize)); | 4697 sw(scratch, MemOperand(li_location, kInstrSize)); |
4698 | 4698 |
4699 // Update the I-cache so the new lui and ori can be executed. | 4699 // Update the I-cache so the new lui and ori can be executed. |
4700 FlushICache(li_location, 2); | 4700 FlushICache(li_location, 2); |
4701 } | 4701 } |
4702 | 4702 |
| 4703 void MacroAssembler::GetRelocatedValue(Register li_location, |
| 4704 Register value, |
| 4705 Register scratch) { |
| 4706 lw(value, MemOperand(li_location)); |
| 4707 if (emit_debug_code()) { |
| 4708 And(value, value, kOpcodeMask); |
| 4709 Check(eq, "The instruction should be a lui.", |
| 4710 value, Operand(LUI)); |
| 4711 lw(value, MemOperand(li_location)); |
| 4712 } |
| 4713 |
| 4714 // value now holds a lui instruction. Extract the immediate. |
| 4715 sll(value, value, kImm16Bits); |
| 4716 |
| 4717 lw(scratch, MemOperand(li_location, kInstrSize)); |
| 4718 if (emit_debug_code()) { |
| 4719 And(scratch, scratch, kOpcodeMask); |
| 4720 Check(eq, "The instruction should be an ori.", |
| 4721 scratch, Operand(ORI)); |
| 4722 lw(scratch, MemOperand(li_location, kInstrSize)); |
| 4723 } |
| 4724 // "scratch" now holds an ori instruction. Extract the immediate. |
| 4725 andi(scratch, scratch, kImm16Mask); |
| 4726 |
| 4727 // Merge the results. |
| 4728 or_(value, value, scratch); |
| 4729 } |
| 4730 |
4703 | 4731 |
4704 void MacroAssembler::CheckPageFlag( | 4732 void MacroAssembler::CheckPageFlag( |
4705 Register object, | 4733 Register object, |
4706 Register scratch, | 4734 Register scratch, |
4707 int mask, | 4735 int mask, |
4708 Condition cc, | 4736 Condition cc, |
4709 Label* condition_met) { | 4737 Label* condition_met) { |
4710 And(scratch, object, Operand(~Page::kPageAlignmentMask)); | 4738 And(scratch, object, Operand(~Page::kPageAlignmentMask)); |
4711 lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); | 4739 lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); |
4712 And(scratch, scratch, Operand(mask)); | 4740 And(scratch, scratch, Operand(mask)); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5014 opcode == BGTZL); | 5042 opcode == BGTZL); |
5015 opcode = (cond == eq) ? BEQ : BNE; | 5043 opcode = (cond == eq) ? BEQ : BNE; |
5016 instr = (instr & ~kOpcodeMask) | opcode; | 5044 instr = (instr & ~kOpcodeMask) | opcode; |
5017 masm_.emit(instr); | 5045 masm_.emit(instr); |
5018 } | 5046 } |
5019 | 5047 |
5020 | 5048 |
5021 } } // namespace v8::internal | 5049 } } // namespace v8::internal |
5022 | 5050 |
5023 #endif // V8_TARGET_ARCH_MIPS | 5051 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |