Index: src/arm64/assembler-arm64.cc |
diff --git a/src/arm64/assembler-arm64.cc b/src/arm64/assembler-arm64.cc |
index 9d804db17b9976e95f2ecbbb63022b0ef5e6a4ee..3aff8ef69170580c2f60505c267a0732c3a1aac6 100644 |
--- a/src/arm64/assembler-arm64.cc |
+++ b/src/arm64/assembler-arm64.cc |
@@ -33,6 +33,7 @@ |
#define ARM64_DEFINE_REG_STATICS |
#include "src/arm64/assembler-arm64-inl.h" |
+#include "src/base/bits.h" |
#include "src/base/cpu.h" |
namespace v8 { |
@@ -601,7 +602,7 @@ void Assembler::GetCode(CodeDesc* desc) { |
void Assembler::Align(int m) { |
- DCHECK(m >= 4 && IsPowerOf2(m)); |
+ DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); |
while ((pc_offset() & (m - 1)) != 0) { |
nop(); |
} |
@@ -2208,6 +2209,17 @@ void Assembler::brk(int code) { |
} |
+void Assembler::EmitStringData(const char* string) { |
+ size_t len = strlen(string) + 1; |
+ DCHECK(RoundUp(len, kInstructionSize) <= static_cast<size_t>(kGap)); |
+ EmitData(string, len); |
+ // Pad with NULL characters until pc_ is aligned. |
+ const char pad[] = {'\0', '\0', '\0', '\0'}; |
+ STATIC_ASSERT(sizeof(pad) == kInstructionSize); |
+ EmitData(pad, RoundUp(pc_offset(), kInstructionSize) - pc_offset()); |
+} |
+ |
+ |
void Assembler::debug(const char* message, uint32_t code, Instr params) { |
#ifdef USE_SIMULATOR |
// Don't generate simulator specific code if we are building a snapshot, which |