From 68a13761e28d34f90fa0140363616dda73ad49de Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Sat, 28 Apr 2012 10:43:39 -0700 Subject: Build a different mksnapshot for each arch. Since mksnapshot uses different source files for each arch, building it in a single location fails when switching between builds. This uses a separate version for each arch, using the same variable that is used to select which source files get built. Change-Id: I8608bf3b0f85571c75c7f6b21e47091ef8ed8c3f --- Android.libv8.mk | 6 +++--- Android.mksnapshot.mk | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Android.libv8.mk b/Android.libv8.mk index 913c525f..7192cccb 100644 --- a/Android.libv8.mk +++ b/Android.libv8.mk @@ -11,8 +11,8 @@ LOCAL_MODULE := libv8 LOCAL_MODULE_CLASS := STATIC_LIBRARIES intermediates := $(call local-intermediates-dir) -PRIVATE_CLEAN_FILES := $(HOST_OUT)/bin/mksnapshot \ - $(HOST_OUT)/obj/EXECUTABLES/mksnapshot_intermediates +PRIVATE_CLEAN_FILES := $(HOST_OUT)/bin/mksnapshot.$(TARGET_ARCH) \ + $(HOST_OUT)/obj/EXECUTABLES/mksnapshot.$(TARGET_ARCH)_intermediates # Android.v8common.mk defines common V8_LOCAL_SRC_FILES # and V8_LOCAL_JS_LIBRARY_FILES @@ -50,7 +50,7 @@ LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES) # Generate snapshot.cc ifeq ($(ENABLE_V8_SNAPSHOT),true) SNAP_GEN := $(intermediates)/snapshot.cc -MKSNAPSHOT := $(HOST_OUT_EXECUTABLES)/mksnapshot +MKSNAPSHOT := $(HOST_OUT_EXECUTABLES)/mksnapshot.$(TARGET_ARCH) $(SNAP_GEN): PRIVATE_CUSTOM_TOOL = $(MKSNAPSHOT) --logfile $(intermediates)/v8.log $(SNAP_GEN) $(SNAP_GEN): $(MKSNAPSHOT) $(transform-generated-source) diff --git a/Android.mksnapshot.mk b/Android.mksnapshot.mk index 9b2a68b0..c1326e03 100644 --- a/Android.mksnapshot.mk +++ b/Android.mksnapshot.mk @@ -6,8 +6,9 @@ include $(CLEAR_VARS) # Set up the target identity LOCAL_IS_HOST_MODULE := true -LOCAL_MODULE := mksnapshot +LOCAL_MODULE := mksnapshot.$(TARGET_ARCH) LOCAL_MODULE_CLASS := EXECUTABLES +LOCAL_MODULE_TAGS = optional intermediates := $(call local-intermediates-dir) V8_LOCAL_SRC_FILES := -- cgit v1.2.3 From e3e50ec5e7238abadbe1c70e9566fc8e9f595098 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 11 May 2012 17:05:18 +0100 Subject: Build d8 instead of v8shell. d8 is the preferred V8 debug console. Change-Id: I2b0c63133e619a4bdc531fd0b4acfde185703f45 --- Android.d8.mk | 22 ++++++++++++++++++++++ Android.mk | 4 ++-- Android.v8shell.mk | 19 ------------------- 3 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 Android.d8.mk delete mode 100644 Android.v8shell.mk diff --git a/Android.d8.mk b/Android.d8.mk new file mode 100644 index 00000000..0f74eb5e --- /dev/null +++ b/Android.d8.mk @@ -0,0 +1,22 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SHARED_LIBRARIES := libstlport +include external/stlport/libstlport.mk + +LOCAL_SRC_FILES := \ + src/d8.cc \ + src/d8-posix.cc + +LOCAL_MODULE := d8 + +LOCAL_CPP_EXTENSION := .cc + +LOCAL_STATIC_LIBRARIES := libv8 +LOCAL_SHARED_LIBRARIES += liblog + +LOCAL_MODULE_TAGS := optional + +LOCAL_C_INCLUDES += $(LOCAL_PATH)/include + +include $(BUILD_EXECUTABLE) diff --git a/Android.mk b/Android.mk index ff42934e..ec89b78d 100644 --- a/Android.mk +++ b/Android.mk @@ -23,10 +23,10 @@ ifeq ($(TARGET_ARCH),arm) endif endif -# Build libv8 and v8shell +# Build libv8 and d8 ifneq ($(filter $(TARGET_ARCH),x86 arm),) ENABLE_V8_SNAPSHOT = true include $(BASE_PATH)/Android.mksnapshot.mk include $(BASE_PATH)/Android.libv8.mk - include $(BASE_PATH)/Android.v8shell.mk + include $(BASE_PATH)/Android.d8.mk endif diff --git a/Android.v8shell.mk b/Android.v8shell.mk deleted file mode 100644 index efe8ddfc..00000000 --- a/Android.v8shell.mk +++ /dev/null @@ -1,19 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SHARED_LIBRARIES := libstlport -include external/stlport/libstlport.mk - -LOCAL_SRC_FILES:= samples/shell.cc -LOCAL_MODULE := v8shell - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_STATIC_LIBRARIES := libv8 -LOCAL_SHARED_LIBRARIES += liblog - -LOCAL_MODULE_TAGS := optional - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/include - -include $(BUILD_EXECUTABLE) -- cgit v1.2.3 From 9a7009c496e0b8faef298cc7063545692ae3ba3f Mon Sep 17 00:00:00 2001 From: Lijuan Xiao Date: Tue, 15 May 2012 18:58:42 +0800 Subject: Fix profiling functionality provided by V8 for x86 Change-Id: I0af645b60f7aa90472ff9c9ddff6b3b2df92e914 Signed-off-by: Lijuan Xiao --- src/platform-linux.cc | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/platform-linux.cc b/src/platform-linux.cc index 474c5406..39633a24 100644 --- a/src/platform-linux.cc +++ b/src/platform-linux.cc @@ -808,7 +808,7 @@ Semaphore* OS::CreateSemaphore(int count) { #ifdef ENABLE_LOGGING_AND_PROFILING -#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__) || defined(__i386__)) +#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__)) // Android runs a fairly new Linux kernel, so signal info is there, // but the C library doesn't have the structs defined. @@ -830,10 +830,27 @@ typedef struct ucontext { __sigset_t uc_sigmask; } ucontext_t; enum ArmRegisters {R15 = 15, R13 = 13, R11 = 11}; -enum X86Registers {REG_EIP = 14, REG_ESP = 7, REG_EBP = 6}; -#endif +#elif !defined(__GLIBC__) && defined(__i386__) +// x86 version for Android. +struct sigcontext { + uint32_t gregs[19]; + void* fpregs; + uint32_t oldmask; + uint32_t cr2; +}; +typedef uint32_t __sigset_t; +typedef struct sigcontext mcontext_t; +typedef struct ucontext { + uint32_t uc_flags; + struct ucontext* uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; +} ucontext_t; +enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 }; +#endif static int GetThreadID() { // Glibc doesn't provide a wrapper for gettid(2). -- cgit v1.2.3 From 749e8943526482d432828bc4e08d9bf711f446d2 Mon Sep 17 00:00:00 2001 From: Chen YANG Date: Wed, 11 Jul 2012 00:47:03 +0800 Subject: Fix the compilation issue with mksnapshot for x86 target Change-Id: I5fd200bee3473a084cb8e05e4a0af0eaefd89348 --- Android.mksnapshot.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Android.mksnapshot.mk b/Android.mksnapshot.mk index 1672963a..f73549b0 100644 --- a/Android.mksnapshot.mk +++ b/Android.mksnapshot.mk @@ -18,9 +18,12 @@ include $(LOCAL_PATH)/Android.v8common.mk V8_LOCAL_SRC_FILES += \ src/mksnapshot.cc \ - src/arm/simulator-arm.cc \ src/snapshot-empty.cc +ifeq ($(TARGET_ARCH),arm) +V8_LOCAL_SRC_FILES += src/arm/simulator-arm.cc +endif + ifeq ($(HOST_ARCH),x86) V8_LOCAL_SRC_FILES += src/atomicops_internals_x86_gcc.cc endif -- cgit v1.2.3 From 6db049a1dc7dc1fc597acde780c5a87e2b9698e7 Mon Sep 17 00:00:00 2001 From: Paul Lind Date: Wed, 1 Aug 2012 17:50:26 -0700 Subject: Add MIPS to v8 makefiles. Provides Android build support for the working mips code already in v8 3.9.x. Change-Id: Id28d09a2a9f08535484fda9aabbb15b6a02690f2 Signed-off-by: Paul Lind --- Android.libv8.mk | 11 +++++++++++ Android.mk | 2 +- Android.mksnapshot.mk | 13 +++++++++++++ Android.v8common.mk | 22 ++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/Android.libv8.mk b/Android.libv8.mk index 81d8296b..cd32be65 100644 --- a/Android.libv8.mk +++ b/Android.libv8.mk @@ -6,6 +6,10 @@ include $(CLEAR_VARS) include external/stlport/libstlport.mk +ifeq ($(TARGET_ARCH),mips) + LOCAL_MIPS_MODE=mips +endif + # Set up the target identity LOCAL_MODULE := libv8 LOCAL_MODULE_CLASS := STATIC_LIBRARIES @@ -92,6 +96,13 @@ ifeq ($(TARGET_ARCH),arm) LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM endif +ifeq ($(TARGET_ARCH),mips) + LOCAL_CFLAGS += -DV8_TARGET_ARCH_MIPS + LOCAL_CFLAGS += -Umips + LOCAL_CFLAGS += -finline-limit=64 + LOCAL_CFLAGS += -fno-strict-aliasing +endif + ifeq ($(TARGET_ARCH),x86) LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32 endif diff --git a/Android.mk b/Android.mk index ff42934e..c98c57cd 100644 --- a/Android.mk +++ b/Android.mk @@ -24,7 +24,7 @@ ifeq ($(TARGET_ARCH),arm) endif # Build libv8 and v8shell -ifneq ($(filter $(TARGET_ARCH),x86 arm),) +ifneq ($(filter $(TARGET_ARCH),x86 arm mips),) ENABLE_V8_SNAPSHOT = true include $(BASE_PATH)/Android.mksnapshot.mk include $(BASE_PATH)/Android.libv8.mk diff --git a/Android.mksnapshot.mk b/Android.mksnapshot.mk index f73549b0..9ab80b40 100644 --- a/Android.mksnapshot.mk +++ b/Android.mksnapshot.mk @@ -24,6 +24,11 @@ ifeq ($(TARGET_ARCH),arm) V8_LOCAL_SRC_FILES += src/arm/simulator-arm.cc endif +ifeq ($(TARGET_ARCH),mips) +V8_LOCAL_SRC_FILES += src/mips/simulator-mips.cc + +endif + ifeq ($(HOST_ARCH),x86) V8_LOCAL_SRC_FILES += src/atomicops_internals_x86_gcc.cc endif @@ -90,6 +95,14 @@ ifeq ($(TARGET_CPU_ABI),armeabi-v7a) endif endif +ifeq ($(TARGET_ARCH),mips) + LOCAL_CFLAGS += -DV8_TARGET_ARCH_MIPS + LOCAL_CFLAGS += -DCAN_USE_FPU_INSTRUCTIONS + LOCAL_CFLAGS += -Umips + LOCAL_CFLAGS += -finline-limit=64 + LOCAL_CFLAGS += -fno-strict-aliasing +endif + ifeq ($(TARGET_ARCH),x86) LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32 endif diff --git a/Android.v8common.mk b/Android.v8common.mk index 71ffe57f..4c77a903 100644 --- a/Android.v8common.mk +++ b/Android.v8common.mk @@ -122,6 +122,28 @@ ifeq ($(TARGET_ARCH),arm) src/arm/stub-cache-arm.cc endif +ifeq ($(TARGET_ARCH),mips) + V8_LOCAL_SRC_FILES += \ + src/mips/assembler-mips.cc \ + src/mips/builtins-mips.cc \ + src/mips/codegen-mips.cc \ + src/mips/code-stubs-mips.cc \ + src/mips/constants-mips.cc \ + src/mips/cpu-mips.cc \ + src/mips/debug-mips.cc \ + src/mips/deoptimizer-mips.cc \ + src/mips/disasm-mips.cc \ + src/mips/frames-mips.cc \ + src/mips/full-codegen-mips.cc \ + src/mips/ic-mips.cc \ + src/mips/lithium-mips.cc \ + src/mips/lithium-codegen-mips.cc \ + src/mips/lithium-gap-resolver-mips.cc \ + src/mips/macro-assembler-mips.cc \ + src/mips/regexp-macro-assembler-mips.cc \ + src/mips/stub-cache-mips.cc +endif + ifeq ($(TARGET_ARCH),x86) V8_LOCAL_SRC_FILES += \ src/ia32/assembler-ia32.cc \ -- cgit v1.2.3 From 5516927b9231f622e1db0606ea876df4cefb9ce6 Mon Sep 17 00:00:00 2001 From: bxu10X Date: Tue, 6 Mar 2012 15:05:11 +0800 Subject: V8: enable no-pic compiling option This patch is to enable no-pic compiling option PIC enables efficient code sharing between processes but increases overhead due to indirectly access global variables and functions. By enabling no-pic here, we can get rid of indirect access calling __x86.get_pc_thunk.bx, while still share the library between processes, since zygote loads libwebcore, and all android applications are forked from zygote and inherits its address space. The patch takes effect together with the one enabling no-pic compiling option in v8. With them, we can see obvious performance improvement for browser workloads, 5%+ for HTML5-zoom and HTML5-animation, 6.6% for sunspider, and 9.1% for pageloading Note: This patch is related to a change in external/webkit Change-Id: Ib055e70c2e0587ac66dcc29ccef8e455aa0b832e Author: Bin Xu Signed-off-by: Bin Xu Singed-off-by: Shuo Gao Signed-off-by: Bruce Beare Signed-off-by: Jack Ren Author-tracking-BZ: 26358 --- Android.libv8.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android.libv8.mk b/Android.libv8.mk index cd32be65..35e5e5f1 100644 --- a/Android.libv8.mk +++ b/Android.libv8.mk @@ -104,7 +104,7 @@ ifeq ($(TARGET_ARCH),mips) endif ifeq ($(TARGET_ARCH),x86) - LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32 + LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32 -fno-pic endif ifeq ($(DEBUG_V8),true) -- cgit v1.2.3