Commit aa38698d authored by Predrag Rudic's avatar Predrag Rudic Committed by Commit Bot

MIPS[64] [builtins] Enable embedded builtins on MIPS

This fixes failing tests 'ByteinRodata' and 'ByteInText' on MIPS.

Changed assemble directives for 'test_string0_bytes' and
'test_function0_bytes' from .local to .global, and reordered function
bytes according to endianess.

Change-Id: Iecac3a966a57531b41c8ce8959e16021d465520a
Reviewed-on: https://chromium-review.googlesource.com/966287
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52014}
parent 3ffdaaad
......@@ -65,11 +65,8 @@ declare_args() {
v8_enable_fast_mksnapshot = false
# Enable embedded builtins.
# TODO(jgruber,v8:6666): Support mips, mips64, ia32 and maybe MSVC.
v8_enable_embedded_builtins =
v8_current_cpu != "x86" && v8_current_cpu != "mips" &&
v8_current_cpu != "mipsel" && v8_current_cpu != "mips64" &&
v8_current_cpu != "mips64el" && (!is_win || is_clang)
# TODO(jgruber,v8:6666): Support ia32 and maybe MSVC.
v8_enable_embedded_builtins = v8_current_cpu != "x86" && (!is_win || is_clang)
# Enable code-generation-time checking of types in the CodeStubAssembler.
v8_enable_verify_csa = false
......
......@@ -13,7 +13,7 @@
#define V8_ASM_MANGLE_LABEL "_"
#define V8_ASM_RODATA_SECTION ".const_data\n"
#define V8_ASM_TEXT_SECTION ".text\n"
#define V8_ASM_LOCAL(NAME) ".private_extern " V8_ASM_MANGLE_LABEL NAME "\n"
#define V8_ASM_DECLARE(NAME) ".private_extern " V8_ASM_MANGLE_LABEL NAME "\n"
#elif defined(V8_OS_WIN) // WIN
#if defined(V8_TARGET_ARCH_X64)
#define V8_ASM_MANGLE_LABEL ""
......@@ -22,12 +22,16 @@
#endif
#define V8_ASM_RODATA_SECTION ".section .rodata\n"
#define V8_ASM_TEXT_SECTION ".section .text\n"
#define V8_ASM_LOCAL(NAME)
#define V8_ASM_DECLARE(NAME)
#else // !MACOSX && !WIN
#define V8_ASM_MANGLE_LABEL ""
#define V8_ASM_RODATA_SECTION ".section .rodata\n"
#define V8_ASM_TEXT_SECTION ".section .text\n"
#define V8_ASM_LOCAL(NAME) ".local " V8_ASM_MANGLE_LABEL NAME "\n"
#if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64)
#define V8_ASM_DECLARE(NAME) ".global " V8_ASM_MANGLE_LABEL NAME "\n"
#else
#define V8_ASM_DECLARE(NAME) ".local " V8_ASM_MANGLE_LABEL NAME "\n"
#endif
#endif
// Align to kCodeAlignment.
......@@ -37,13 +41,13 @@
// clang-format off
#define V8_EMBEDDED_TEXT_HEADER(LABEL) \
__asm__(V8_ASM_TEXT_SECTION \
V8_ASM_LOCAL(#LABEL) \
V8_ASM_DECLARE(#LABEL) \
V8_ASM_BALIGN32 \
V8_ASM_LABEL(#LABEL));
#define V8_EMBEDDED_RODATA_HEADER(LABEL) \
__asm__(V8_ASM_RODATA_SECTION \
V8_ASM_LOCAL(#LABEL) \
V8_ASM_DECLARE(#LABEL) \
V8_ASM_BALIGN32 \
V8_ASM_LABEL(#LABEL));
// clang-format off
......
......@@ -109,6 +109,7 @@ UNINITIALIZED_TEST(VerifyBuiltinsIsolateIndependence) {
v8_isolate->Dispose();
}
#endif // V8_EMBEDDED_BUILTINS
// V8_CC_MSVC is true for both MSVC and clang on windows. clang can handle
// __asm__-style inline assembly but MSVC cannot, and thus we need a more
......@@ -236,14 +237,16 @@ TEST(GenerateTestFunctionData) {
#define FUNCTION_BYTES ".byte 0x01, 0x00, 0x80, 0xe0, 0x0e, 0xf0, 0xa0, 0xe1\n"
#elif V8_TARGET_ARCH_PPC
#define FUNCTION_BYTES ".byte 0x14, 0x22, 0x63, 0x7c, 0x20, 0x00, 0x80, 0x4e\n"
#elif V8_TARGET_ARCH_MIPS
#elif defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64)
#if defined(V8_TARGET_BIG_ENDIAN)
#define FUNCTION_BYTES \
".byte 0x21, 0x10, 0x85, 0x00, 0x08, 0x00, 0xe0, " \
"0x03, 0x00, 0x00, 0x00, 0x00\n"
#elif V8_TARGET_ARCH_MIPS64
".byte 0x00, 0x85, 0x10, 0x21, 0x03, 0xe0, 0x00, " \
"0x08, 0x00, 0x00, 0x00, 0x00\n"
#else
#define FUNCTION_BYTES \
".byte 0x21, 0x10, 0x85, 0x00, 0x08, 0x00, 0xe0, " \
"0x03, 0x00, 0x00, 0x00, 0x00\n"
#endif
#elif V8_TARGET_ARCH_S390
#define FUNCTION_BYTES \
".byte 0xb9, 0x08, 0x00, 0x23, 0x07, 0xfe\n"
......@@ -279,7 +282,6 @@ TEST(ByteInText) {
}
#endif // #ifndef V8_COMPILER_IS_MSVC
#undef V8_COMPILER_IS_MSVC
#endif // V8_EMBEDDED_BUILTINS
#undef FUNCTION_BYTES
#undef GENERATE_TEST_FUNCTION_DATA
......
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