Title: [96808] trunk
Revision
96808
Author
[email protected]
Date
2011-10-06 06:37:01 -0700 (Thu, 06 Oct 2011)

Log Message

Provide configure option to switch between JSC and V8.
https://bugs.webkit.org/show_bug.cgi?id=69469

Patch by Nayan Kumar K <[email protected]> on 2011-10-06
Reviewed by Philippe Normand.

This is first of the patches to support building of V8 with
WebKit GTK. With this patch, new command line switch named
'--with-jsengine' is introduced, using which we can choose to
build either jsc or v8.

* GNUmakefile.am:
* configure.ac:

Modified Paths

Diff

Modified: trunk/ChangeLog (96807 => 96808)


--- trunk/ChangeLog	2011-10-06 13:20:27 UTC (rev 96807)
+++ trunk/ChangeLog	2011-10-06 13:37:01 UTC (rev 96808)
@@ -1,3 +1,18 @@
+2011-10-06  Nayan Kumar K  <[email protected]>
+
+        Provide configure option to switch between JSC and V8.
+        https://bugs.webkit.org/show_bug.cgi?id=69469
+
+        Reviewed by Philippe Normand.
+
+        This is first of the patches to support building of V8 with
+        WebKit GTK. With this patch, new command line switch named
+        '--with-jsengine' is introduced, using which we can choose to
+        build either jsc or v8.
+
+        * GNUmakefile.am:
+        * configure.ac:
+
 2011-10-04  Scott Graham  <[email protected]>
 
         Add GAMEPAD feature flag

Modified: trunk/GNUmakefile.am (96807 => 96808)


--- trunk/GNUmakefile.am	2011-10-06 13:20:27 UTC (rev 96807)
+++ trunk/GNUmakefile.am	2011-10-06 13:37:01 UTC (rev 96808)
@@ -198,7 +198,9 @@
 	$(srcdir)/Source/WebKit/LICENSE
 
 # Include module makefiles
+if USE_JSC
 include Source/_javascript_Core/GNUmakefile.am
+endif
 include Source/WebCore/GNUmakefile.am
 include Source/WebKit/gtk/GNUmakefile.am
 include Source/WebCore/bindings/gobject/GNUmakefile.am
@@ -216,13 +218,17 @@
 
 # Autogenerated sources
 BUILT_SOURCES += \
-	$(_javascript_core_built_sources) \
-	$(_javascript_core_built_nosources) \
 	$(webcore_built_sources) \
 	$(webcore_built_nosources) \
 	$(webkitgtk_built_sources) \
 	$(webkitgtk_built_nosources)
 
+if USE_JSC
+BUILT_SOURCES += \
+	$(_javascript_core_built_sources) \
+	$(_javascript_core_built_nosources)
+endif
+
 DISTCLEANFILES += \
 	$(CLEANFILES) \
 	$(builddir)/doltcompile \

Modified: trunk/configure.ac (96807 => 96808)


--- trunk/configure.ac	2011-10-06 13:20:27 UTC (rev 96807)
+++ trunk/configure.ac	2011-10-06 13:37:01 UTC (rev 96808)
@@ -793,48 +793,67 @@
               [],[if test "$enable_debug" = "yes"; then enable_debug_features="yes"; else enable_debug_features="no"; fi])
 AC_MSG_RESULT([$enable_debug_features])
 
-AC_MSG_CHECKING([whether to enable JIT compilation])
-AC_ARG_ENABLE([jit],
-              AC_HELP_STRING([--enable-jit],
-                             [Enable JIT compilation default=yes]),
-              [],[enable_jit="yes"])
-if test "$enable_jit" = "yes"; then
-    case "$host_cpu" in
-        arm*)
-            AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
-            AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
-            AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
-        ;;
-        i*86|x86_64)
-            AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
-            AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
-            AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
-            AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
-            AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
-            AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
-            case "$host_cpu" in
-                i*86)
-                    AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
-                ;;
-                x86_64)
-                    AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
-                    AC_DEFINE([WTF_USE_ALTERNATE_JSIMMEDIATE], [1], [Use alternate JSImmediate])
-                ;;
-            esac
-        ;;
-        sh4)
-            AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
-            AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
-            AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
-            AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
-        ;;
-        *)
-            enable_jit="no (CPU '$host_cpu' not supported)"
-        ;;
-    esac
+# Determine _javascript_ engine to use.
+AC_MSG_CHECKING([_javascript_ engine])
+AC_ARG_WITH(jsengine,
+            AC_HELP_STRING([--with-jsengine=@<:@jsc@:>@],
+                           [Select _javascript_ engine [default=jsc]]),
+            [],[with_jsengine="jsc"])
+
+case "$with_jsengine" in
+     jsc) ;;
+     *) AC_MSG_ERROR([Invalid JS engine: Must be jsc]) ;;
+esac
+AC_MSG_RESULT([$with_jsengine])
+
+if test "$with_jsengine" = "jsc"; then
+    AC_MSG_CHECKING([whether to enable JIT compilation])
+    AC_ARG_ENABLE([jit],
+                  AC_HELP_STRING([--enable-jit],
+                                 [Enable JIT compilation default=yes]),
+                  [],[enable_jit="yes"])
+    if test "$enable_jit" = "yes"; then
+        case "$host_cpu" in
+            arm*)
+                AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
+                AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
+                AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
+            ;;
+            i*86|x86_64)
+                AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
+                AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
+                AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
+                AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
+                AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
+                AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
+                case "$host_cpu" in
+                    i*86)
+                        AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
+                    ;;
+                    x86_64)
+                        AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
+                        AC_DEFINE([WTF_USE_ALTERNATE_JSIMMEDIATE], [1], [Use alternate JSImmediate])
+                    ;;
+                esac
+            ;;
+            sh4)
+                AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
+                AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
+                AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
+                AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
+            ;;
+            *)
+                enable_jit="no (CPU '$host_cpu' not supported)"
+            ;;
+        esac
+    else
+            AC_DEFINE([ENABLE_JIT], [0], [Define to enable JIT])
+    fi
 else
-        AC_DEFINE([ENABLE_JIT], [0], [Define to enable JIT])
+    AC_DEFINE([ENABLE_JIT], [0], [Define to enable JIT])
+    enable_jit="no"
 fi
+
 AC_MSG_RESULT([$enable_jit])
 
 # Opcode stats
@@ -1103,6 +1122,9 @@
 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
 
+# JS engine conditionals
+AM_CONDITIONAL([USE_JSC], [test "$with_jsengine" = "jsc"])
+
 # Unicode backend conditionals
 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
@@ -1226,6 +1248,7 @@
  Unicode backend                                          : $with_unicode_backend
  Font backend                                             : $with_font_backend
  Optimized memory allocator                               : $enable_fast_malloc
+ _javascript_ Engine                                        : $with_jsengine
 Features:
  3D Rendering                                             : $enable_3d_rendering
  WebGL                                                    : $enable_webgl
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to