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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // but it may be bound only once. | 409 // but it may be bound only once. |
410 void bind(Label* L); // Binds an unbound label L to current code position. | 410 void bind(Label* L); // Binds an unbound label L to current code position. |
411 | 411 |
412 enum OffsetSize : int { kOffset26 = 26, kOffset21 = 21, kOffset16 = 16 }; | 412 enum OffsetSize : int { kOffset26 = 26, kOffset21 = 21, kOffset16 = 16 }; |
413 | 413 |
414 // Determines if Label is bound and near enough so that branch instruction | 414 // Determines if Label is bound and near enough so that branch instruction |
415 // can be used to reach it, instead of jump instruction. | 415 // can be used to reach it, instead of jump instruction. |
416 bool is_near(Label* L); | 416 bool is_near(Label* L); |
417 bool is_near(Label* L, OffsetSize bits); | 417 bool is_near(Label* L, OffsetSize bits); |
418 bool is_near_branch(Label* L); | 418 bool is_near_branch(Label* L); |
| 419 inline bool is_near_pre_r6(Label* L) { |
| 420 DCHECK(!IsMipsArchVariant(kMips32r6)); |
| 421 return pc_offset() - L->pos() < kMaxBranchOffset - 4 * kInstrSize; |
| 422 } |
| 423 inline bool is_near_r6(Label* L) { |
| 424 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 425 return pc_offset() - L->pos() < kMaxCompactBranchOffset - 4 * kInstrSize; |
| 426 } |
| 427 |
| 428 int BranchOffset(Instr instr); |
419 | 429 |
420 // Returns the branch offset to the given label from the current code | 430 // Returns the branch offset to the given label from the current code |
421 // position. Links the label to the current position if it is still unbound. | 431 // position. Links the label to the current position if it is still unbound. |
422 // Manages the jump elimination optimization if the second parameter is true. | 432 // Manages the jump elimination optimization if the second parameter is true. |
423 int32_t branch_offset_helper(Label* L, OffsetSize bits); | 433 int32_t branch_offset_helper(Label* L, OffsetSize bits); |
424 inline int32_t branch_offset(Label* L) { | 434 inline int32_t branch_offset(Label* L) { |
425 return branch_offset_helper(L, OffsetSize::kOffset16); | 435 return branch_offset_helper(L, OffsetSize::kOffset16); |
426 } | 436 } |
427 inline int32_t branch_offset21(Label* L) { | 437 inline int32_t branch_offset21(Label* L) { |
428 return branch_offset_helper(L, OffsetSize::kOffset21); | 438 return branch_offset_helper(L, OffsetSize::kOffset21); |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 public: | 1430 public: |
1421 explicit EnsureSpace(Assembler* assembler) { | 1431 explicit EnsureSpace(Assembler* assembler) { |
1422 assembler->CheckBuffer(); | 1432 assembler->CheckBuffer(); |
1423 } | 1433 } |
1424 }; | 1434 }; |
1425 | 1435 |
1426 } // namespace internal | 1436 } // namespace internal |
1427 } // namespace v8 | 1437 } // namespace v8 |
1428 | 1438 |
1429 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1439 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |