Commit b9c99322 authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

[jumbo] fix B macro/symbol clashes in arm64 builds

assembler-arm64.h and assembler-arm64-inl.h have a B() function
which conflicts with the B macro in bytecode-utils.h.

Headers that leak macros can be annoying to deal with, in this case
we can't simply undef B at the end of source files that include
bytecode-utils.h because the second source file that includes
bytecode-utils.h won't see the B macro.  Let's just move this macro
into the two unittest files that include this header.

Bug: chromium:746958
Change-Id: I588b73fe81615f882a0e010c92ba187d3bc2bf25
Reviewed-on: https://chromium-review.googlesource.com/758779
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49258}
parent 23883b85
......@@ -24,6 +24,7 @@ namespace internal {
namespace interpreter {
namespace bytecode_array_writer_unittest {
#define B(Name) static_cast<uint8_t>(Bytecode::k##Name)
#define R(i) static_cast<uint32_t>(Register(i).ToOperand())
class BytecodeArrayWriterUnittest : public TestWithIsolateAndZone {
......@@ -364,6 +365,7 @@ TEST_F(BytecodeArrayWriterUnittest, DeadcodeElimination) {
CHECK(source_iterator.done());
}
#undef B
#undef R
} // namespace bytecode_array_writer_unittest
......
......@@ -16,6 +16,8 @@ namespace v8 {
namespace internal {
namespace interpreter {
#define B(Name) static_cast<uint8_t>(Bytecode::k##Name)
TEST(BytecodeDecoder, DecodeBytecodeAndOperands) {
struct BytecodesAndResult {
const uint8_t bytecode[32];
......@@ -95,6 +97,8 @@ TEST(BytecodeDecoder, DecodeBytecodeAndOperands) {
}
}
#undef B
} // namespace interpreter
} // namespace internal
} // namespace v8
......@@ -27,7 +27,6 @@
#endif
#define U8(i) static_cast<uint8_t>(i)
#define B(Name) static_cast<uint8_t>(Bytecode::k##Name)
#define REG_OPERAND(i) \
(InterpreterFrameConstants::kRegisterFileFromFp / kPointerSize - (i))
#define R8(i) static_cast<uint8_t>(REG_OPERAND(i))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment