Title: [139004] trunk/Source
Revision
139004
Author
[email protected]
Date
2013-01-07 15:49:29 -0800 (Mon, 07 Jan 2013)

Log Message

Unreviewed, it should be possible to build JSC on ARM.

Source/_javascript_Core: 

* API/JSBase.h:
* jit/JITStubs.cpp:
(JSC::performPlatformSpecificJITAssertions):
(JSC):
* jit/JITStubs.h:
(JSC):
* jit/JITThunks.cpp:
(JSC::JITThunks::JITThunks):
* jit/JITThunks.h:
(JITThunks):
* offlineasm/armv7.rb:
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):

Source/WTF: 

* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::IncrementalScavenge):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSBase.h (139003 => 139004)


--- trunk/Source/_javascript_Core/API/JSBase.h	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/API/JSBase.h	2013-01-07 23:49:29 UTC (rev 139004)
@@ -141,6 +141,6 @@
 
 /* Enable the Objective-C API for platforms with a modern runtime. */
 #undef JS_OBJC_API_ENABLED
-#define JS_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) && !defined(__i386__))
+#define JS_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 && !defined(__i386__))
 
 #endif /* JSBase_h */

Modified: trunk/Source/_javascript_Core/ChangeLog (139003 => 139004)


--- trunk/Source/_javascript_Core/ChangeLog	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-01-07 23:49:29 UTC (rev 139004)
@@ -1,3 +1,21 @@
+2013-01-07  Filip Pizlo  <[email protected]>
+
+        Unreviewed, it should be possible to build JSC on ARM.
+
+        * API/JSBase.h:
+        * jit/JITStubs.cpp:
+        (JSC::performPlatformSpecificJITAssertions):
+        (JSC):
+        * jit/JITStubs.h:
+        (JSC):
+        * jit/JITThunks.cpp:
+        (JSC::JITThunks::JITThunks):
+        * jit/JITThunks.h:
+        (JITThunks):
+        * offlineasm/armv7.rb:
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::JSGlobalData):
+
 2013-01-07  Balazs Kilvady  <[email protected]>
 
         MIPS LLInt implementation.

Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (139003 => 139004)


--- trunk/Source/_javascript_Core/jit/JITStubs.cpp	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp	2013-01-07 23:49:29 UTC (rev 139004)
@@ -789,6 +789,50 @@
     #define CTI_SAMPLER 0
 #endif
 
+void performPlatformSpecificJITAssertions(JSGlobalData* globalData)
+{
+    if (!globalData->canUseJIT())
+        return;
+
+#if CPU(ARM_THUMB2)
+    // Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it contains non POD types),
+    // and the OBJECT_OFFSETOF macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT
+    // macros.
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVED_R4_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR5) == PRESERVED_R5_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR6) == PRESERVED_R6_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR7) == PRESERVED_R7_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR8) == PRESERVED_R8_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR9) == PRESERVED_R9_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR10) == PRESERVED_R10_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR11) == PRESERVED_R11_OFFSET);
+
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
+    // The fifth argument is the first item already on the stack.
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, unused1) == FIRST_STACK_ARGUMENT);
+
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
+
+#elif CPU(ARM_TRADITIONAL)
+
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVEDR4_OFFSET);
+
+
+#elif CPU(MIPS)
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == PRESERVED_GP_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == PRESERVED_S0_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == PRESERVED_S1_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == PRESERVED_S2_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == GLOBAL_DATA_OFFSET);
+
+#endif
+}
+
 NEVER_INLINE static void tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, ReturnAddressPtr returnAddress, JSValue baseValue, const PutPropertySlot& slot, StructureStubInfo* stubInfo, bool direct)
 {
     // The interpreter checks for recursion here; I do not believe this can occur in CTI.

Modified: trunk/Source/_javascript_Core/jit/JITStubs.h (139003 => 139004)


--- trunk/Source/_javascript_Core/jit/JITStubs.h	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/jit/JITStubs.h	2013-01-07 23:49:29 UTC (rev 139004)
@@ -292,6 +292,8 @@
 }
 #endif
 
+void performPlatformSpecificJITAssertions(JSGlobalData*);
+
 extern "C" {
 EncodedJSValue JIT_STUB cti_op_add(STUB_ARGS_DECLARATION) WTF_INTERNAL;
 EncodedJSValue JIT_STUB cti_op_bitand(STUB_ARGS_DECLARATION) WTF_INTERNAL;

Modified: trunk/Source/_javascript_Core/jit/JITThunks.cpp (139003 => 139004)


--- trunk/Source/_javascript_Core/jit/JITThunks.cpp	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/jit/JITThunks.cpp	2013-01-07 23:49:29 UTC (rev 139004)
@@ -35,49 +35,9 @@
 
 namespace JSC {
 
-JITThunks::JITThunks(JSGlobalData* globalData)
+JITThunks::JITThunks()
     : m_hostFunctionStubMap(adoptPtr(new HostFunctionStubMap))
 {
-    if (!globalData->canUseJIT())
-        return;
-
-#if CPU(ARM_THUMB2)
-    // Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it contains non POD types),
-    // and the OBJECT_OFFSETOF macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT
-    // macros.
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVED_R4_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR5) == PRESERVED_R5_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR6) == PRESERVED_R6_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR7) == PRESERVED_R7_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR8) == PRESERVED_R8_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR9) == PRESERVED_R9_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR10) == PRESERVED_R10_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR11) == PRESERVED_R11_OFFSET);
-
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
-    // The fifth argument is the first item already on the stack.
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, unused1) == FIRST_STACK_ARGUMENT);
-
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
-
-#elif CPU(ARM_TRADITIONAL)
-
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVEDR4_OFFSET);
-
-
-#elif CPU(MIPS)
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == PRESERVED_GP_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == PRESERVED_S0_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == PRESERVED_S1_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == PRESERVED_S2_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == GLOBAL_DATA_OFFSET);
-
-#endif
 }
 
 JITThunks::~JITThunks()

Modified: trunk/Source/_javascript_Core/jit/JITThunks.h (139003 => 139004)


--- trunk/Source/_javascript_Core/jit/JITThunks.h	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/jit/JITThunks.h	2013-01-07 23:49:29 UTC (rev 139004)
@@ -46,7 +46,7 @@
 
 class JITThunks {
 public:
-    JITThunks(JSGlobalData*);
+    JITThunks();
     ~JITThunks();
 
     MacroAssemblerCodePtr ctiNativeCall(JSGlobalData*);

Modified: trunk/Source/_javascript_Core/offlineasm/armv7.rb (139003 => 139004)


--- trunk/Source/_javascript_Core/offlineasm/armv7.rb	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/offlineasm/armv7.rb	2013-01-07 23:49:29 UTC (rev 139004)
@@ -201,7 +201,7 @@
     else
         raise unless operands.size == 2
         raise unless operands[1].register?
-        if operands[0].is_a? Immediate
+        if operands[0].immediate?
             $asm.puts "#{opcode3} #{operands[1].armV7Operand}, #{operands[1].armV7Operand}, #{operands[0].armV7Operand}"
         else
             $asm.puts "#{opcode2} #{armV7FlippedOperands(operands)}"
@@ -235,9 +235,9 @@
         raise "Expected 2 or 3 operands but got #{operands.size} at #{codeOriginString}"
     end
     
-    if mask.is_a? Immediate and mask.value == -1
+    if mask.immediate? and mask.value == -1
         $asm.puts "tst #{value.armV7Operand}, #{value.armV7Operand}"
-    elsif mask.is_a? Immediate
+    elsif mask.immediate?
         $asm.puts "tst.w #{value.armV7Operand}, #{mask.armV7Operand}"
     else
         $asm.puts "tst #{value.armV7Operand}, #{mask.armV7Operand}"
@@ -270,9 +270,9 @@
             else
                 suffix = ""
             end
-            if operands.size == 3 and operands[0].is_a? Immediate
-                raise unless operands[1].is_a? RegisterID
-                raise unless operands[2].is_a? RegisterID
+            if operands.size == 3 and operands[0].immediate?
+                raise unless operands[1].register?
+                raise unless operands[2].register?
                 if operands[0].value == 0 and suffix.empty?
                     unless operands[1] == operands[2]
                         $asm.puts "mov #{operands[2].armV7Operand}, #{operands[1].armV7Operand}"
@@ -280,12 +280,12 @@
                 else
                     $asm.puts "adds #{operands[2].armV7Operand}, #{operands[1].armV7Operand}, #{operands[0].armV7Operand}"
                 end
-            elsif operands.size == 3 and operands[0].is_a? RegisterID
-                raise unless operands[1].is_a? RegisterID
-                raise unless operands[2].is_a? RegisterID
+            elsif operands.size == 3 and operands[0].immediate?
+                raise unless operands[1].register?
+                raise unless operands[2].register?
                 $asm.puts "adds #{armV7FlippedOperands(operands)}"
             else
-                if operands[0].is_a? Immediate
+                if operands[0].immediate?
                     unless Immediate.new(nil, 0) == operands[0]
                         $asm.puts "adds #{armV7FlippedOperands(operands)}"
                     end
@@ -402,7 +402,7 @@
         when "push"
             $asm.puts "push #{operands[0].armV7Operand}"
         when "move"
-            if operands[0].is_a? Immediate
+            if operands[0].immediate?
                 armV7MoveImmediate(operands[0].value, operands[1])
             else
                 $asm.puts "mov #{armV7FlippedOperands(operands)}"

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (139003 => 139004)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2013-01-07 23:49:29 UTC (rev 139004)
@@ -234,7 +234,8 @@
     wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable);
 
 #if ENABLE(JIT)
-    jitStubs = adoptPtr(new JITThunks(this));
+    jitStubs = adoptPtr(new JITThunks());
+    performPlatformSpecificJITAssertions(this);
 #endif
     
     interpreter->initialize(this->canUseJIT());

Modified: trunk/Source/WTF/ChangeLog (139003 => 139004)


--- trunk/Source/WTF/ChangeLog	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/WTF/ChangeLog	2013-01-07 23:49:29 UTC (rev 139004)
@@ -1,3 +1,10 @@
+2013-01-07  Filip Pizlo  <[email protected]>
+
+        Unreviewed, it should be possible to build JSC on ARM.
+
+        * wtf/FastMalloc.cpp:
+        (WTF::TCMalloc_PageHeap::IncrementalScavenge):
+
 2013-01-07  Balazs Kilvady  <[email protected]>
 
         MIPS LLInt implementation.

Modified: trunk/Source/WTF/wtf/FastMalloc.cpp (139003 => 139004)


--- trunk/Source/WTF/wtf/FastMalloc.cpp	2013-01-07 23:35:40 UTC (rev 139003)
+++ trunk/Source/WTF/wtf/FastMalloc.cpp	2013-01-07 23:49:29 UTC (rev 139004)
@@ -2137,7 +2137,7 @@
     SpanList* slist = (index == kMaxPages) ? &large_ : &free_[index];
     if (!DLL_IsEmpty(&slist->normal)) {
       // Release the last span on the normal portion of this list
-      Span* s = slist->normal.prev;
+      Span* s = slist->normal.prev();
       DLL_Remove(s);
       TCMalloc_SystemRelease(reinterpret_cast<void*>(s->start << kPageShift),
                              static_cast<size_t>(s->length << kPageShift));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to