[GTK] Enable the LLInt
authorwingo@igalia.com <wingo@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2012 16:00:38 +0000 (16:00 +0000)
committerwingo@igalia.com <wingo@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2012 16:00:38 +0000 (16:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88315

Reviewed by Filip Pizlo.

.:

* configure.ac: Require Ruby, to build the low-level interpreter.

Source/JavaScriptCore:

* GNUmakefile.am: Add rules to generate LLIntDesiredOffsets.h and
LLIntAssembly.h.
* GNUmakefile.list.am: Add offlineasm and llint files to the
dist.  Add LLInt source files to the build.
* llint/LowLevelInterpreter.asm (crash): Generate a store of
0xbbadbeef to a register, not to a constant.  Otherwise, gas was
failing to assemble result.
* offlineasm/asm.rb (labelReference): Generate a
SYMBOL_STRING_RELOCATION instead of a SYMBOL_STRING, so that we go
through the PLT on ELF systems.

Source/WTF:

* wtf/InlineASM.h: Add an implementation of LOCAL_LABEL_STRING for
OS(LINUX).
* wtf/Platform.h: Add OS(LINUX) to the set of operating systems
for ENABLE_LLINT.  Add a specific check for PLATFORM(MAC) or
PLATFORM(IOS), and add to that a check for PLATFORM(GTK).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119593 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.am
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/offlineasm/asm.rb
Source/WTF/ChangeLog
Source/WTF/wtf/InlineASM.h
Source/WTF/wtf/Platform.h
configure.ac

index f4dd8c2..26e8819 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-06-06  Andy Wingo  <wingo@igalia.com>
+
+        [GTK] Enable the LLInt
+        https://bugs.webkit.org/show_bug.cgi?id=88315
+
+        Reviewed by Filip Pizlo.
+
+        * configure.ac: Require Ruby, to build the low-level interpreter.
+
 2012-06-06  Sam D  <dsam2912@gmail.com>
 
         Web Inspector: Option for selecting/deselecting all breakpoints in breakpoint pane
index d75b5ac..3558be9 100644 (file)
@@ -1,5 +1,23 @@
 2012-06-06  Andy Wingo  <wingo@igalia.com>
 
+        [GTK] Enable the LLInt
+        https://bugs.webkit.org/show_bug.cgi?id=88315
+
+        Reviewed by Filip Pizlo.
+
+        * GNUmakefile.am: Add rules to generate LLIntDesiredOffsets.h and
+        LLIntAssembly.h.
+        * GNUmakefile.list.am: Add offlineasm and llint files to the
+        dist.  Add LLInt source files to the build.
+        * llint/LowLevelInterpreter.asm (crash): Generate a store of
+        0xbbadbeef to a register, not to a constant.  Otherwise, gas was
+        failing to assemble result.
+        * offlineasm/asm.rb (labelReference): Generate a
+        SYMBOL_STRING_RELOCATION instead of a SYMBOL_STRING, so that we go
+        through the PLT on ELF systems.
+
+2012-06-06  Andy Wingo  <wingo@igalia.com>
+
         REGRESSION (r106478): None of the Paper.js JavaScript examples work
         https://bugs.webkit.org/show_bug.cgi?id=87158
 
index 1ad42fd..e203d44 100644 (file)
@@ -89,6 +89,16 @@ DerivedSources/JavaScriptCore/RegExpJitTables.h: $(srcdir)/Source/JavaScriptCore
 DerivedSources/JavaScriptCore/KeywordLookup.h: $(srcdir)/Source/JavaScriptCore/KeywordLookupGenerator.py $(srcdir)/Source/JavaScriptCore/parser/Keywords.table
        $(AM_V_GEN)$(PYTHON) $^ > $@
 
+DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h: $(javascriptcore_sources) $(llint_nosources) $(offlineasm_nosources)
+       $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm $@
+
+$(Programs_LLIntOffsetsExtractor_OBJECTS): DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h
+
+DerivedSources/JavaScriptCore/LLIntAssembly.h: Programs/LLIntOffsetsExtractor$(EXEEXT)
+       $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/asm.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm Programs/LLIntOffsetsExtractor$(EXEEXT) $@
+
+$(libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_OBJECTS): DerivedSources/JavaScriptCore/LLIntAssembly.h
+
 jsc: $(javascriptcore_built_nosources) Programs/jsc$(EXEEXT)
 
 bin_PROGRAMS += \
@@ -96,7 +106,8 @@ bin_PROGRAMS += \
 
 noinst_PROGRAMS += \
        Programs/jsc \
-       Programs/minidom
+       Programs/minidom \
+       Programs/LLIntOffsetsExtractor
 
 Programs_minidom_CPPFLAGS = \
        $(global_cppflags) \
@@ -119,6 +130,30 @@ Programs_minidom_LDFLAGS = \
        -no-install \
        -no-fast-install
 
+Programs_LLIntOffsetsExtractor_CPPFLAGS = \
+       $(global_cppflags) \
+       $(javascriptcore_cppflags)
+
+Programs_LLIntOffsetsExtractor_CFLAGS = \
+       -ansi \
+       -fno-strict-aliasing \
+       $(global_cflags) \
+       $(GLOBALDEPS_CFLAGS)
+
+Programs_LLIntOffsetsExtractor_LDADD = \
+       -lpthread \
+       libWTF.la \
+       $(UNICODE_LIBS) \
+       $(GLIB_LIBS) \
+       $(WINMM_LIBS) \
+       -lm \
+       -lpthread \
+       -lstdc++
+
+Programs_LLIntOffsetsExtractor_LDFLAGS = \
+       -no-install \
+       -no-fast-install
+
 # jsc
 Programs/jsc$(EXEEXT): Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
        $(AM_V_GEN)cp -f Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT) Programs/jsc$(EXEEXT)
@@ -151,12 +186,15 @@ EXTRA_DIST += \
        Source/JavaScriptCore/icu/README \
        Source/JavaScriptCore/KeywordLookupGenerator.py \
        Source/JavaScriptCore/parser/Keywords.table \
-       Source/JavaScriptCore/THANKS
+       Source/JavaScriptCore/THANKS \
+       $(llint_nosources) \
+       $(offlineasm_nosources)
 
 CLEANFILES += \
        $(javascriptcore_built_nosources) \
        Programs/jsc \
        Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \
+       Programs/LLIntOffsetsExtractor \
        Programs/minidom
 
 DISTCLEANFILES += \
index efd4b5f..f7130c1 100644 (file)
@@ -20,7 +20,7 @@ javascriptcore_built_nosources += \
        DerivedSources/JavaScriptCore/JSGlobalObject.lut.h \
        DerivedSources/JavaScriptCore/JSONObject.lut.h \
        DerivedSources/JavaScriptCore/MathObject.lut.h \
-    DerivedSources/JavaScriptCore/NamePrototype.lut.h \
+       DerivedSources/JavaScriptCore/NamePrototype.lut.h \
        DerivedSources/JavaScriptCore/NumberConstructor.lut.h \
        DerivedSources/JavaScriptCore/NumberPrototype.lut.h \
        DerivedSources/JavaScriptCore/ObjectConstructor.lut.h \
@@ -29,7 +29,9 @@ javascriptcore_built_nosources += \
        DerivedSources/JavaScriptCore/RegExpObject.lut.h \
        DerivedSources/JavaScriptCore/RegExpPrototype.lut.h \
        DerivedSources/JavaScriptCore/StringConstructor.lut.h \
-       DerivedSources/JavaScriptCore/StringPrototype.lut.h
+       DerivedSources/JavaScriptCore/StringPrototype.lut.h \
+       DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h \
+       DerivedSources/JavaScriptCore/LLIntAssembly.h
 
 javascriptcore_sources += \
        Source/JavaScriptCore/API/APICast.h \
@@ -232,8 +234,8 @@ javascriptcore_sources += \
        Source/JavaScriptCore/heap/HandleSet.cpp \
        Source/JavaScriptCore/heap/HandleSet.h \
        Source/JavaScriptCore/heap/HeapBlock.h \
-    Source/JavaScriptCore/heap/IncrementalSweeper.h \
-    Source/JavaScriptCore/heap/IncrementalSweeper.cpp \
+       Source/JavaScriptCore/heap/IncrementalSweeper.h \
+       Source/JavaScriptCore/heap/IncrementalSweeper.cpp \
        Source/JavaScriptCore/heap/SlotVisitor.h \
        Source/JavaScriptCore/heap/HandleStack.cpp \
        Source/JavaScriptCore/heap/HandleStack.h \
@@ -357,9 +359,18 @@ javascriptcore_sources += \
        Source/JavaScriptCore/jit/SpecializedThunkJIT.h \
        Source/JavaScriptCore/jit/ThunkGenerators.cpp \
        Source/JavaScriptCore/jit/ThunkGenerators.h \
+       Source/JavaScriptCore/llint/LLIntCommon.h \
+       Source/JavaScriptCore/llint/LLIntData.cpp \
        Source/JavaScriptCore/llint/LLIntData.h \
        Source/JavaScriptCore/llint/LLIntEntrypoints.cpp \
        Source/JavaScriptCore/llint/LLIntEntrypoints.h \
+       Source/JavaScriptCore/llint/LLIntExceptions.cpp \
+       Source/JavaScriptCore/llint/LLIntExceptions.h \
+       Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h \
+       Source/JavaScriptCore/llint/LLIntSlowPaths.cpp \
+       Source/JavaScriptCore/llint/LLIntSlowPaths.h \
+       Source/JavaScriptCore/llint/LLIntThunks.cpp \
+       Source/JavaScriptCore/llint/LLIntThunks.h \
        Source/JavaScriptCore/llint/LowLevelInterpreter.cpp \
        Source/JavaScriptCore/llint/LowLevelInterpreter.h \
        Source/JavaScriptCore/os-win32/stdbool.h \
@@ -626,6 +637,27 @@ javascriptcore_sources += \
        Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
 endif
 
+llint_nosources = \
+       Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm \
+       Source/JavaScriptCore/llint/LowLevelInterpreter64.asm \
+       Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+
+offlineasm_nosources = \
+       Source/JavaScriptCore/offlineasm/armv7.rb \
+       Source/JavaScriptCore/offlineasm/asm.rb \
+       Source/JavaScriptCore/offlineasm/ast.rb \
+       Source/JavaScriptCore/offlineasm/backends.rb \
+       Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb \
+       Source/JavaScriptCore/offlineasm/instructions.rb \
+       Source/JavaScriptCore/offlineasm/offsets.rb \
+       Source/JavaScriptCore/offlineasm/opt.rb \
+       Source/JavaScriptCore/offlineasm/parser.rb \
+       Source/JavaScriptCore/offlineasm/registers.rb \
+       Source/JavaScriptCore/offlineasm/self_hash.rb \
+       Source/JavaScriptCore/offlineasm/settings.rb \
+       Source/JavaScriptCore/offlineasm/transform.rb \
+       Source/JavaScriptCore/offlineasm/x86.rb
+
 # minidom
 Programs_minidom_SOURCES = \
        Source/JavaScriptCore/API/tests/JSNode.c \
@@ -638,6 +670,10 @@ Programs_minidom_SOURCES = \
        Source/JavaScriptCore/API/tests/NodeList.h \
        Source/JavaScriptCore/API/tests/minidom.c
 
+Programs_LLIntOffsetsExtractor_SOURCES = \
+       Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp \
+       Source/JavaScriptCore/llint/LLIntOffsetsExtractor.h
+
 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_SOURCES = \
        Source/JavaScriptCore/JSCTypedArrayStubs.h \
        Source/JavaScriptCore/jsc.cpp
index d9c4728..e59ddeb 100644 (file)
@@ -103,7 +103,7 @@ end
 
 # Some common utilities.
 macro crash()
-    storei 0, 0xbbadbeef[]
+    storei t0, 0xbbadbeef[]
     move 0, t0
     call t0
 end
index 12bade0..da5821f 100644 (file)
@@ -97,7 +97,7 @@ class Assembler
     end
     
     def self.labelReference(labelName)
-        "\" SYMBOL_STRING(#{labelName}) \""
+        "\" SYMBOL_STRING_RELOCATION(#{labelName}) \""
     end
     
     def self.localLabelReference(labelName)
index 1df20c6..2fb2da0 100644 (file)
@@ -1,3 +1,16 @@
+2012-06-06  Andy Wingo  <wingo@igalia.com>
+
+        [GTK] Enable the LLInt
+        https://bugs.webkit.org/show_bug.cgi?id=88315
+
+        Reviewed by Filip Pizlo.
+
+        * wtf/InlineASM.h: Add an implementation of LOCAL_LABEL_STRING for
+        OS(LINUX).
+        * wtf/Platform.h: Add OS(LINUX) to the set of operating systems
+        for ENABLE_LLINT.  Add a specific check for PLATFORM(MAC) or
+        PLATFORM(IOS), and add to that a check for PLATFORM(GTK).
+
 2012-06-05  Roland Takacs  <takacs.roland@stud.u-szeged.hu>
 
         [Qt] Use GraphicsContext3DOpenGLES.cpp when using OpenGL ES
index 1c99e65..b10b668 100644 (file)
@@ -75,6 +75,8 @@
 // Don't know about any of the others.
 #if PLATFORM(MAC)
 #define LOCAL_LABEL_STRING(name) "L" #name
+#elif OS(LINUX)
+#define LOCAL_LABEL_STRING(name) ".L" #name
 #endif
 
 #endif // InlineASM_h
index 0d1cd19..f94dfe2 100644 (file)
 
 /* On some of the platforms where we have a JIT, we want to also have the 
    low-level interpreter. */
-#if !defined(ENABLE_LLINT) && ENABLE(JIT) && (OS(DARWIN) && !PLATFORM(QT)) && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2))
+#if !defined(ENABLE_LLINT) \
+    && ENABLE(JIT) \
+    && (OS(DARWIN) || OS(LINUX)) \
+    && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(GTK)) \
+    && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2))
 #define ENABLE_LLINT 1
 #endif
 
index 72e19bf..c830609 100644 (file)
@@ -105,6 +105,11 @@ if test -z "$PYTHON"; then
    AC_MSG_ERROR([You need 'python' to compile WebKit])
 fi
 
+AC_PATH_PROG(RUBY, ruby)
+if test -z "$RUBY"; then
+   AC_MSG_ERROR([You need 'ruby' to compile WebKit])
+fi
+
 AC_PATH_PROG(BISON, bison)
 if test -z "$BISON"; then
    AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])