OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARM64_ASSEMBLER_ARM64_H_ | 5 #ifndef V8_ARM64_ASSEMBLER_ARM64_H_ |
6 #define V8_ARM64_ASSEMBLER_ARM64_H_ | 6 #define V8_ARM64_ASSEMBLER_ARM64_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 | 3487 |
3488 // Code generation | 3488 // Code generation |
3489 // The relocation writer's position is at least kGap bytes below the end of | 3489 // The relocation writer's position is at least kGap bytes below the end of |
3490 // the generated instructions. This is so that multi-instruction sequences do | 3490 // the generated instructions. This is so that multi-instruction sequences do |
3491 // not have to check for overflow. The same is true for writes of large | 3491 // not have to check for overflow. The same is true for writes of large |
3492 // relocation info entries, and debug strings encoded in the instruction | 3492 // relocation info entries, and debug strings encoded in the instruction |
3493 // stream. | 3493 // stream. |
3494 static constexpr int kGap = 128; | 3494 static constexpr int kGap = 128; |
3495 | 3495 |
3496 public: | 3496 public: |
| 3497 #ifdef DEBUG |
| 3498 // Functions used for testing. |
| 3499 int GetConstantPoolEntriesSizeForTesting() const { |
| 3500 // Do not include branch over the pool. |
| 3501 return constpool_.EntryCount() * kPointerSize; |
| 3502 } |
| 3503 |
| 3504 static constexpr int GetCheckConstPoolIntervalForTesting() { |
| 3505 return kCheckConstPoolInterval; |
| 3506 } |
| 3507 |
| 3508 static constexpr int GetApproxMaxDistToConstPoolForTesting() { |
| 3509 return kApproxMaxDistToConstPool; |
| 3510 } |
| 3511 #endif |
| 3512 |
3497 class FarBranchInfo { | 3513 class FarBranchInfo { |
3498 public: | 3514 public: |
3499 FarBranchInfo(int offset, Label* label) | 3515 FarBranchInfo(int offset, Label* label) |
3500 : pc_offset_(offset), label_(label) {} | 3516 : pc_offset_(offset), label_(label) {} |
3501 // Offset of the branch in the code generation buffer. | 3517 // Offset of the branch in the code generation buffer. |
3502 int pc_offset_; | 3518 int pc_offset_; |
3503 // The label branched to. | 3519 // The label branched to. |
3504 Label* label_; | 3520 Label* label_; |
3505 }; | 3521 }; |
3506 | 3522 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3611 public: | 3627 public: |
3612 explicit EnsureSpace(Assembler* assembler) { | 3628 explicit EnsureSpace(Assembler* assembler) { |
3613 assembler->CheckBufferSpace(); | 3629 assembler->CheckBufferSpace(); |
3614 } | 3630 } |
3615 }; | 3631 }; |
3616 | 3632 |
3617 } // namespace internal | 3633 } // namespace internal |
3618 } // namespace v8 | 3634 } // namespace v8 |
3619 | 3635 |
3620 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ | 3636 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ |
OLD | NEW |