diff options
author | Feng Qian <fqian@google.com> | 2009-07-01 10:51:31 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-07-01 10:51:31 -0700 |
commit | e75482bdbf01bdccab186c00e0f56013041275d7 (patch) | |
tree | ad6041dba8c011189874557b29fc700af62bb3d4 /V8Binding | |
parent | 1a2cd24724c522c1f5259d455d3fdec3366bd976 (diff) | |
download | external_webkit-e75482bdbf01bdccab186c00e0f56013041275d7.zip external_webkit-e75482bdbf01bdccab186c00e0f56013041275d7.tar.gz external_webkit-e75482bdbf01bdccab186c00e0f56013041275d7.tar.bz2 |
Add V8 snapshot to Makefile.
Snapshotting can be turned on by adding ENABLE_V8_SNAPSHOT in buildspec.mk file.
It is off by default. When it is turned on, the binary size is increased by about 370K, it only saves the first cold startup time of browser (or first time using JavaScript).
Diffstat (limited to 'V8Binding')
-rw-r--r-- | V8Binding/Android.libv8.mk | 166 | ||||
-rw-r--r-- | V8Binding/Android.mksnapshot.mk | 56 | ||||
-rw-r--r-- | V8Binding/Android.v8common.mk | 131 | ||||
-rw-r--r-- | V8Binding/v8/src/serialize.cc | 2 |
4 files changed, 216 insertions, 139 deletions
diff --git a/V8Binding/Android.libv8.mk b/V8Binding/Android.libv8.mk index 4331f78..f85ba79 100644 --- a/V8Binding/Android.libv8.mk +++ b/V8Binding/Android.libv8.mk @@ -9,144 +9,17 @@ LOCAL_MODULE := libv8 LOCAL_MODULE_CLASS := STATIC_LIBRARIES intermediates := $(call local-intermediates-dir) -LOCAL_CPP_EXTENSION := .cc +# Android.v8common.mk defines common V8_LOCAL_SRC_FILES +# and V8_LOCAL_JS_LIBRARY_FILES +V8_LOCAL_SRC_FILES := +V8_LOCAL_JS_LIBRARY_FILES := +include $(LOCAL_PATH)/Android.v8common.mk -LOCAL_SRC_FILES := \ - src/accessors.cc \ - src/allocation.cc \ - src/api.cc \ - src/assembler.cc \ - src/ast.cc \ - src/bootstrapper.cc \ - src/builtins.cc \ - src/checks.cc \ - src/code-stubs.cc \ - src/codegen.cc \ - src/compilation-cache.cc \ - src/compiler.cc \ - src/contexts.cc \ - src/conversions.cc \ - src/counters.cc \ - src/dateparser.cc \ - src/disassembler.cc \ - src/execution.cc \ - src/factory.cc \ - src/flags.cc \ - src/frames.cc \ - src/func-name-inferrer.cc \ - src/global-handles.cc \ - src/handles.cc \ - src/hashmap.cc \ - src/heap.cc \ - src/ic.cc \ - src/interpreter-irregexp.cc \ - src/jsregexp.cc \ - src/jump-target.cc \ - src/log.cc \ - src/log-utils.cc \ - src/mark-compact.cc \ - src/messages.cc \ - src/objects.cc \ - src/oprofile-agent.cc \ - src/parser.cc \ - src/property.cc \ - src/regexp-macro-assembler.cc \ - src/regexp-macro-assembler-irregexp.cc \ - src/regexp-stack.cc \ - src/register-allocator.cc \ - src/rewriter.cc \ - src/runtime.cc \ - src/scanner.cc \ - src/scopeinfo.cc \ - src/scopes.cc \ - src/serialize.cc \ - src/snapshot-common.cc \ - src/spaces.cc \ - src/string-stream.cc \ - src/stub-cache.cc \ - src/token.cc \ - src/top.cc \ - src/unicode.cc \ - src/usage-analyzer.cc \ - src/utils.cc \ - src/v8-counters.cc \ - src/v8.cc \ - src/v8threads.cc \ - src/variables.cc \ - src/virtual-frame.cc \ - src/version.cc \ - src/zone.cc +LOCAL_SRC_FILES := $(addprefix v8/, $(V8_LOCAL_SRC_FILES)) -ifeq ($(TARGET_ARCH),arm) - LOCAL_SRC_FILES += \ - src/arm/assembler-arm.cc \ - src/arm/builtins-arm.cc \ - src/arm/codegen-arm.cc \ - src/arm/cpu-arm.cc \ - src/arm/disasm-arm.cc \ - src/arm/frames-arm.cc \ - src/arm/ic-arm.cc \ - src/arm/jump-target-arm.cc \ - src/arm/macro-assembler-arm.cc \ - src/arm/regexp-macro-assembler-arm.cc \ - src/arm/register-allocator-arm.cc \ - src/arm/stub-cache-arm.cc \ - src/arm/virtual-frame-arm.cc -endif - -ifeq ($(TARGET_ARCH),x86) - LOCAL_SRC_FILES += \ - src/ia32/assembler-ia32.cc \ - src/ia32/builtins-ia32.cc \ - src/ia32/codegen-ia32.cc \ - src/ia32/cpu-ia32.cc \ - src/ia32/disasm-ia32.cc \ - src/ia32/frames-ia32.cc \ - src/ia32/ic-ia32.cc \ - src/ia32/jump-target-ia32.cc \ - src/ia32/macro-assembler-ia32.cc \ - src/ia32/regexp-macro-assembler-ia32.cc \ - src/ia32/register-allocator-ia32.cc \ - src/ia32/stub-cache-ia32.cc \ - src/ia32/virtual-frame-ia32.cc -endif - -ifeq ($(TARGET_OS),linux) - LOCAL_SRC_FILES += \ - src/platform-linux.cc \ - src/platform-posix.cc -endif - -# Enable DEBUG option. -ifeq ($(DEBUG_V8),true) - LOCAL_SRC_FILES += \ - src/objects-debug.cc \ - src/prettyprinter.cc \ - src/regexp-macro-assembler-tracer.cc -endif - -# Don't use snapshot for now. -LOCAL_SRC_FILES += \ - src/snapshot-empty.cc \ - src/dtoa-config.c - -LOCAL_SRC_FILES := $(addprefix v8/, $(LOCAL_SRC_FILES)) - -LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/v8/, \ - src/runtime.js \ - src/v8natives.js \ - src/array.js \ - src/string.js \ - src/uri.js \ - src/math.js \ - src/messages.js \ - src/apinatives.js \ - src/date-delay.js \ - src/regexp-delay.js \ - src/json-delay.js \ - src/macros.py \ -) +LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/v8/, $(V8_LOCAL_JS_LIBRARY_FILES)) +LOCAL_GENERATED_SOURCES := # Generate libraries.cc GEN1 := $(intermediates)/libraries.cc $(intermediates)/libraries-empty.cc $(GEN1): SCRIPT := $(LOCAL_PATH)/v8/tools/js2c.py @@ -154,10 +27,27 @@ $(GEN1): $(LOCAL_JS_LIBRARY_FILES) @echo "Generating libraries.cc" @mkdir -p $(dir $@) python $(SCRIPT) $(GEN1) CORE $(LOCAL_JS_LIBRARY_FILES) -LOCAL_GENERATED_SOURCES += $(intermediates)/libraries.cc +V8_GENERATED_LIBRARIES := $(intermediates)/libraries.cc + + +LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES) + +# Generate snapshot.cc +ifeq ($(ENABLE_V8_SNAPSHOT),true) +GEN := $(intermediates)/snapshot.cc +$(GEN): MKSNAPSHOT := $(HOST_OUT_EXECUTABLES)/mksnapshot +# mksnapshot is the module name. This dependency rule makes sure that mksnapshot +# is built before calling the following rule. +$(GEN): mksnapshot + @echo "Generating snapshot.cc" + @mkdir -p $(dir $@) + $(MKSNAPSHOT) $(GEN) +LOCAL_GENERATED_SOURCES += $(intermediates)/snapshot.cc +else +LOCAL_SRC_FILES += \ + v8/src/snapshot-empty.cc +endif -# GCC 4.3.1 has a bug that generates wrong code, -fno-tree-sink fixes the -# issue. LOCAL_CFLAGS += \ -Wno-endif-labels \ -Wno-import \ diff --git a/V8Binding/Android.mksnapshot.mk b/V8Binding/Android.mksnapshot.mk new file mode 100644 index 0000000..ef18196 --- /dev/null +++ b/V8Binding/Android.mksnapshot.mk @@ -0,0 +1,56 @@ +## +# mksnapshot +# =================================================== +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# Set up the target identity +LOCAL_IS_HOST_MODULE := true +LOCAL_MODULE := mksnapshot +LOCAL_MODULE_CLASS := EXECUTABLES +intermediates := $(call local-intermediates-dir) + +V8_LOCAL_SRC_FILES := +V8_LOCAL_JS_LIBRARY_FILES := +include $(LOCAL_PATH)/Android.v8common.mk + +LOCAL_SRC_FILES := $(addprefix v8/, $(V8_LOCAL_SRC_FILES)) +LOCAL_SRC_FILES += \ + v8/src/mksnapshot.cc \ + v8/src/arm/simulator-arm.cc \ + v8/src/snapshot-empty.cc + +LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/v8/, $(V8_LOCAL_JS_LIBRARY_FILES)) + +# Generate libraries.cc +GEN2 := $(intermediates)/libraries.cc $(intermediates)/libraries-empty.cc +$(GEN2): SCRIPT := $(LOCAL_PATH)/v8/tools/js2c.py +$(GEN2): $(LOCAL_JS_LIBRARY_FILES) + @echo "Generating libraries.cc" + @mkdir -p $(dir $@) + python $(SCRIPT) $(GEN2) CORE $(LOCAL_JS_LIBRARY_FILES) +LOCAL_GENERATED_SOURCES := $(intermediates)/libraries.cc + +LOCAL_CFLAGS := \ + -Wno-endif-labels \ + -Wno-import \ + -Wno-format \ + -ansi \ + -fno-rtti + +ifeq ($(TARGET_ARCH),arm) + LOCAL_CFLAGS += -DV8_TARGET_ARCH_ARM +endif + +ifeq ($(TARGET_ARCH),x86) + LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32 +endif + +LOCAL_CFLAGS += -DENABLE_LOGGING_AND_PROFILING + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/v8/src + +# This is on host. +LOCAL_LDLIBS := -lpthread + +include $(BUILD_HOST_EXECUTABLE) diff --git a/V8Binding/Android.v8common.mk b/V8Binding/Android.v8common.mk new file mode 100644 index 0000000..b75cdf2 --- /dev/null +++ b/V8Binding/Android.v8common.mk @@ -0,0 +1,131 @@ +LOCAL_CPP_EXTENSION := .cc + +V8_LOCAL_SRC_FILES := \ + src/accessors.cc \ + src/allocation.cc \ + src/api.cc \ + src/assembler.cc \ + src/ast.cc \ + src/bootstrapper.cc \ + src/builtins.cc \ + src/checks.cc \ + src/code-stubs.cc \ + src/codegen.cc \ + src/compilation-cache.cc \ + src/compiler.cc \ + src/contexts.cc \ + src/conversions.cc \ + src/counters.cc \ + src/dateparser.cc \ + src/disassembler.cc \ + src/execution.cc \ + src/factory.cc \ + src/flags.cc \ + src/frames.cc \ + src/func-name-inferrer.cc \ + src/global-handles.cc \ + src/handles.cc \ + src/hashmap.cc \ + src/heap.cc \ + src/ic.cc \ + src/interpreter-irregexp.cc \ + src/jsregexp.cc \ + src/jump-target.cc \ + src/log.cc \ + src/log-utils.cc \ + src/mark-compact.cc \ + src/messages.cc \ + src/objects.cc \ + src/oprofile-agent.cc \ + src/parser.cc \ + src/property.cc \ + src/regexp-macro-assembler.cc \ + src/regexp-macro-assembler-irregexp.cc \ + src/regexp-stack.cc \ + src/register-allocator.cc \ + src/rewriter.cc \ + src/runtime.cc \ + src/scanner.cc \ + src/scopeinfo.cc \ + src/scopes.cc \ + src/serialize.cc \ + src/snapshot-common.cc \ + src/spaces.cc \ + src/string-stream.cc \ + src/stub-cache.cc \ + src/token.cc \ + src/top.cc \ + src/unicode.cc \ + src/usage-analyzer.cc \ + src/utils.cc \ + src/v8-counters.cc \ + src/v8.cc \ + src/v8threads.cc \ + src/variables.cc \ + src/virtual-frame.cc \ + src/version.cc \ + src/zone.cc \ + \ + src/platform-linux.cc \ + src/platform-posix.cc + +ifeq ($(TARGET_ARCH),arm) + V8_LOCAL_SRC_FILES += \ + src/arm/assembler-arm.cc \ + src/arm/builtins-arm.cc \ + src/arm/codegen-arm.cc \ + src/arm/cpu-arm.cc \ + src/arm/disasm-arm.cc \ + src/arm/frames-arm.cc \ + src/arm/ic-arm.cc \ + src/arm/jump-target-arm.cc \ + src/arm/macro-assembler-arm.cc \ + src/arm/regexp-macro-assembler-arm.cc \ + src/arm/register-allocator-arm.cc \ + src/arm/stub-cache-arm.cc \ + src/arm/virtual-frame-arm.cc +endif + +ifeq ($(TARGET_ARCH),x86) + V8_LOCAL_SRC_FILES += \ + src/ia32/assembler-ia32.cc \ + src/ia32/builtins-ia32.cc \ + src/ia32/codegen-ia32.cc \ + src/ia32/cpu-ia32.cc \ + src/ia32/disasm-ia32.cc \ + src/ia32/frames-ia32.cc \ + src/ia32/ic-ia32.cc \ + src/ia32/jump-target-ia32.cc \ + src/ia32/macro-assembler-ia32.cc \ + src/ia32/regexp-macro-assembler-ia32.cc \ + src/ia32/register-allocator-ia32.cc \ + src/ia32/stub-cache-ia32.cc \ + src/ia32/virtual-frame-ia32.cc +endif + +# Enable DEBUG option. +ifeq ($(DEBUG_V8),true) + V8_LOCAL_SRC_FILES += \ + src/objects-debug.cc \ + src/prettyprinter.cc \ + src/regexp-macro-assembler-tracer.cc +endif + +V8_LOCAL_SRC_FILES += \ + src/dtoa-config.c + +V8_LOCAL_JS_LIBRARY_FILES := \ + src/runtime.js \ + src/v8natives.js \ + src/array.js \ + src/string.js \ + src/uri.js \ + src/math.js \ + src/messages.js \ + src/apinatives.js \ + src/date-delay.js \ + src/regexp-delay.js \ + src/json-delay.js \ + src/macros.py + + diff --git a/V8Binding/v8/src/serialize.cc b/V8Binding/v8/src/serialize.cc index 2939c01..7e38494 100644 --- a/V8Binding/v8/src/serialize.cc +++ b/V8Binding/v8/src/serialize.cc @@ -699,6 +699,7 @@ void ExternalReferenceTable::PopulateTable() { UNCLASSIFIED, 10, "Debug::step_in_fp_addr()"); +#endif Add(ExternalReference::double_fp_operation(Token::ADD).address(), UNCLASSIFIED, 11, @@ -715,7 +716,6 @@ void ExternalReferenceTable::PopulateTable() { UNCLASSIFIED, 14, "compare_doubles"); -#endif } |