| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 if (instr == 0) { | 658 if (instr == 0) { |
| 659 return kEndOfChain; | 659 return kEndOfChain; |
| 660 } else { | 660 } else { |
| 661 int32_t imm18 =((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14; | 661 int32_t imm18 =((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14; |
| 662 return (imm18 + pos); | 662 return (imm18 + pos); |
| 663 } | 663 } |
| 664 } | 664 } |
| 665 // Check we have a branch or jump instruction. | 665 // Check we have a branch or jump instruction. |
| 666 DCHECK(IsBranch(instr) || IsLui(instr)); | 666 DCHECK(IsBranch(instr) || IsLui(instr)); |
| 667 // Do NOT change this to <<2. We rely on arithmetic shifts here, assuming | 667 // Do NOT change this to <<2. We rely on arithmetic shifts here, assuming |
| 668 // the compiler uses arithmectic shifts for signed integers. | 668 // the compiler uses arithmetic shifts for signed integers. |
| 669 if (IsBranch(instr)) { | 669 if (IsBranch(instr)) { |
| 670 int32_t imm18 = ((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14; | 670 int32_t imm18 = ((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14; |
| 671 | 671 |
| 672 if (imm18 == kEndOfChain) { | 672 if (imm18 == kEndOfChain) { |
| 673 // EndOfChain sentinel is returned directly, not relative to pc or pos. | 673 // EndOfChain sentinel is returned directly, not relative to pc or pos. |
| 674 return kEndOfChain; | 674 return kEndOfChain; |
| 675 } else { | 675 } else { |
| 676 return pos + kBranchPCOffset + imm18; | 676 return pos + kBranchPCOffset + imm18; |
| 677 } | 677 } |
| 678 } else if (IsLui(instr)) { | 678 } else if (IsLui(instr)) { |
| (...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3094 if (patched) { | 3094 if (patched) { |
| 3095 CpuFeatures::FlushICache(pc + 2, sizeof(Address)); | 3095 CpuFeatures::FlushICache(pc + 2, sizeof(Address)); |
| 3096 } | 3096 } |
| 3097 } | 3097 } |
| 3098 | 3098 |
| 3099 | 3099 |
| 3100 } // namespace internal | 3100 } // namespace internal |
| 3101 } // namespace v8 | 3101 } // namespace v8 |
| 3102 | 3102 |
| 3103 #endif // V8_TARGET_ARCH_MIPS | 3103 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |