From 34174f389927c1f443990f29ff1be037d7d84484 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Wed, 4 May 2011 06:18:49 +0000 Subject: [PATCH] ARM: Add GYP variables to control V8 code generation Added the GYP variables: v8_can_use_unaligned_accesses v8_use_arm_eabi_hardfloat Refer to the comments in v8.gyp on their uses. R=karlklose@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org//6910025 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7769 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- SConstruct | 2 +- tools/gyp/v8.gyp | 45 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index fb780a2..0d01e7e 100644 --- a/SConstruct +++ b/SConstruct @@ -162,7 +162,7 @@ LIBRARY_FLAGS = { } }, 'armeabi:softfp' : { - 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], + 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0', 'CAN_USE_VFP_INSTRUCTIONS'], 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=softfp'], } diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 95b0b1c..0108b12 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -32,7 +32,28 @@ 'gcc_version%': 'unknown', 'v8_compress_startup_data%': 'false', 'v8_target_arch%': '<(target_arch)', + + # Setting 'v8_can_use_unaligned_accesses' to 'true' will allow the code + # generated by V8 to do unaligned memory access, and setting it to 'false' + # will ensure that the generated code will always do aligned memory + # accesses. The default value of 'default' will try to determine the correct + # setting. Note that for Intel architectures (ia32 and x64) unaligned memory + # access is allowed for all CPUs. + 'v8_can_use_unaligned_accesses%': 'default', + + # Setting 'v8_can_use_vfp_instructions' to 'true' will enable use of ARM VFP + # instructions in the V8 generated code. VFP instructions will be enabled + # both for the snapshot and for the ARM target. Leaving the default value + # of 'false' will avoid VFP instructions in the snapshot and use CPU feature + # probing when running on the target. 'v8_can_use_vfp_instructions%': 'false', + + # Setting v8_use_arm_eabi_hardfloat to true will turn on V8 support for ARM + # EABI calling convention where double arguments are passed in VFP + # registers. Note that the GCC flag '-mfloat-abi=hard' should be used as + # well when compiling for the ARM target. + 'v8_use_arm_eabi_hardfloat%': 'false', + 'v8_use_snapshot%': 'true', 'v8_use_liveobjectlist%': 'false', }, @@ -58,11 +79,27 @@ 'V8_TARGET_ARCH_ARM', ], 'conditions': [ + [ 'v8_can_use_unaligned_accesses=="true"', { + 'defines': [ + 'CAN_USE_UNALIGNED_ACCESSES=1', + ], + }], + [ 'v8_can_use_unaligned_accesses=="false"', { + 'defines': [ + 'CAN_USE_UNALIGNED_ACCESSES=0', + ], + }], [ 'v8_can_use_vfp_instructions=="true"', { 'defines': [ 'CAN_USE_VFP_INSTRUCTIONS', ], }], + [ 'v8_use_arm_eabi_hardfloat=="true"', { + 'defines': [ + 'USE_EABI_HARDFLOAT=1', + 'CAN_USE_VFP_INSTRUCTIONS', + ], + }], ], }], ['v8_target_arch=="ia32"', { @@ -781,10 +818,10 @@ '../../src/regexp.js', '../../src/macros.py', ], - 'experimental_library_files': [ - '../../src/proxy.js', + 'experimental_library_files': [ + '../../src/proxy.js', '../../src/macros.py', - ], + ], }, 'actions': [ { @@ -804,7 +841,7 @@ '<@(library_files)' ], }, - { + { 'action_name': 'js2c_experimental', 'inputs': [ '../../tools/js2c.py', -- 2.7.4