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 4713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4724 scratch, Operand(ORI)); | 4724 scratch, Operand(ORI)); |
4725 lw(scratch, MemOperand(li_location, kInstrSize)); | 4725 lw(scratch, MemOperand(li_location, kInstrSize)); |
4726 } | 4726 } |
4727 Ins(scratch, new_value, 0, kImm16Bits); | 4727 Ins(scratch, new_value, 0, kImm16Bits); |
4728 sw(scratch, MemOperand(li_location, kInstrSize)); | 4728 sw(scratch, MemOperand(li_location, kInstrSize)); |
4729 | 4729 |
4730 // Update the I-cache so the new lui and ori can be executed. | 4730 // Update the I-cache so the new lui and ori can be executed. |
4731 FlushICache(li_location, 2); | 4731 FlushICache(li_location, 2); |
4732 } | 4732 } |
4733 | 4733 |
| 4734 void MacroAssembler::GetRelocatedValue(Register li_location, |
| 4735 Register value, |
| 4736 Register scratch) { |
| 4737 lw(value, MemOperand(li_location)); |
| 4738 if (emit_debug_code()) { |
| 4739 And(value, value, kOpcodeMask); |
| 4740 Check(eq, "The instruction should be a lui.", |
| 4741 value, Operand(LUI)); |
| 4742 lw(value, MemOperand(li_location)); |
| 4743 } |
| 4744 |
| 4745 // value now holds a lui instruction. Extract the immediate. |
| 4746 sll(value, value, kImm16Bits); |
| 4747 |
| 4748 lw(scratch, MemOperand(li_location, kInstrSize)); |
| 4749 if (emit_debug_code()) { |
| 4750 And(scratch, scratch, kOpcodeMask); |
| 4751 Check(eq, "The instruction should be an ori.", |
| 4752 scratch, Operand(ORI)); |
| 4753 lw(scratch, MemOperand(li_location, kInstrSize)); |
| 4754 } |
| 4755 // "scratch" now holds an ori instruction. Extract the immediate. |
| 4756 andi(scratch, scratch, kImm16Mask); |
| 4757 |
| 4758 // Merge the results. |
| 4759 or_(value, value, scratch); |
| 4760 } |
| 4761 |
4734 | 4762 |
4735 void MacroAssembler::CheckPageFlag( | 4763 void MacroAssembler::CheckPageFlag( |
4736 Register object, | 4764 Register object, |
4737 Register scratch, | 4765 Register scratch, |
4738 int mask, | 4766 int mask, |
4739 Condition cc, | 4767 Condition cc, |
4740 Label* condition_met) { | 4768 Label* condition_met) { |
4741 And(scratch, object, Operand(~Page::kPageAlignmentMask)); | 4769 And(scratch, object, Operand(~Page::kPageAlignmentMask)); |
4742 lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); | 4770 lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); |
4743 And(scratch, scratch, Operand(mask)); | 4771 And(scratch, scratch, Operand(mask)); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5045 opcode == BGTZL); | 5073 opcode == BGTZL); |
5046 opcode = (cond == eq) ? BEQ : BNE; | 5074 opcode = (cond == eq) ? BEQ : BNE; |
5047 instr = (instr & ~kOpcodeMask) | opcode; | 5075 instr = (instr & ~kOpcodeMask) | opcode; |
5048 masm_.emit(instr); | 5076 masm_.emit(instr); |
5049 } | 5077 } |
5050 | 5078 |
5051 | 5079 |
5052 } } // namespace v8::internal | 5080 } } // namespace v8::internal |
5053 | 5081 |
5054 #endif // V8_TARGET_ARCH_MIPS | 5082 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |