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 <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 | 1726 |
1727 // Emit 32 bits of data in the instruction stream. | 1727 // Emit 32 bits of data in the instruction stream. |
1728 void dc32(uint32_t data) { EmitData(&data, sizeof(data)); } | 1728 void dc32(uint32_t data) { EmitData(&data, sizeof(data)); } |
1729 | 1729 |
1730 // Emit 64 bits of data in the instruction stream. | 1730 // Emit 64 bits of data in the instruction stream. |
1731 void dc64(uint64_t data) { EmitData(&data, sizeof(data)); } | 1731 void dc64(uint64_t data) { EmitData(&data, sizeof(data)); } |
1732 | 1732 |
1733 // Copy a string into the instruction stream, including the terminating NULL | 1733 // Copy a string into the instruction stream, including the terminating NULL |
1734 // character. The instruction pointer (pc_) is then aligned correctly for | 1734 // character. The instruction pointer (pc_) is then aligned correctly for |
1735 // subsequent instructions. | 1735 // subsequent instructions. |
1736 void EmitStringData(const char * string) { | 1736 void EmitStringData(const char* string); |
1737 size_t len = strlen(string) + 1; | |
1738 DCHECK(RoundUp(len, kInstructionSize) <= static_cast<size_t>(kGap)); | |
1739 EmitData(string, len); | |
1740 // Pad with NULL characters until pc_ is aligned. | |
1741 const char pad[] = {'\0', '\0', '\0', '\0'}; | |
1742 STATIC_ASSERT(sizeof(pad) == kInstructionSize); | |
1743 byte* next_pc = AlignUp(pc_, kInstructionSize); | |
1744 EmitData(&pad, next_pc - pc_); | |
1745 } | |
1746 | 1737 |
1747 // Pseudo-instructions ------------------------------------------------------ | 1738 // Pseudo-instructions ------------------------------------------------------ |
1748 | 1739 |
1749 // Parameters are described in arm64/instructions-arm64.h. | 1740 // Parameters are described in arm64/instructions-arm64.h. |
1750 void debug(const char* message, uint32_t code, Instr params = BREAK); | 1741 void debug(const char* message, uint32_t code, Instr params = BREAK); |
1751 | 1742 |
1752 // Required by V8. | 1743 // Required by V8. |
1753 void dd(uint32_t data) { dc32(data); } | 1744 void dd(uint32_t data) { dc32(data); } |
1754 void db(uint8_t data) { dc8(data); } | 1745 void db(uint8_t data) { dc8(data); } |
1755 | 1746 |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 class EnsureSpace BASE_EMBEDDED { | 2290 class EnsureSpace BASE_EMBEDDED { |
2300 public: | 2291 public: |
2301 explicit EnsureSpace(Assembler* assembler) { | 2292 explicit EnsureSpace(Assembler* assembler) { |
2302 assembler->CheckBufferSpace(); | 2293 assembler->CheckBufferSpace(); |
2303 } | 2294 } |
2304 }; | 2295 }; |
2305 | 2296 |
2306 } } // namespace v8::internal | 2297 } } // namespace v8::internal |
2307 | 2298 |
2308 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ | 2299 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ |
OLD | NEW |