Changeset 139004 in webkit


Ignore:
Timestamp:
Jan 7, 2013 3:49:29 PM (11 years ago)
Author:
fpizlo@apple.com
Message:

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

Source/JavaScriptCore:

  • 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):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.h

    r138664 r139004  
    142142/* Enable the Objective-C API for platforms with a modern runtime. */
    143143#undef JS_OBJC_API_ENABLED
    144 #define JS_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) && !defined(__i386__))
     144#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__))
    145145
    146146#endif /* JSBase_h */
  • trunk/Source/JavaScriptCore/ChangeLog

    r138970 r139004  
     12013-01-07  Filip Pizlo  <fpizlo@apple.com>
     2
     3        Unreviewed, it should be possible to build JSC on ARM.
     4
     5        * API/JSBase.h:
     6        * jit/JITStubs.cpp:
     7        (JSC::performPlatformSpecificJITAssertions):
     8        (JSC):
     9        * jit/JITStubs.h:
     10        (JSC):
     11        * jit/JITThunks.cpp:
     12        (JSC::JITThunks::JITThunks):
     13        * jit/JITThunks.h:
     14        (JITThunks):
     15        * offlineasm/armv7.rb:
     16        * runtime/JSGlobalData.cpp:
     17        (JSC::JSGlobalData::JSGlobalData):
     18
    1192013-01-07  Balazs Kilvady  <kilvadyb@homejinni.com>
    220
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r138970 r139004  
    789789    #define CTI_SAMPLER 0
    790790#endif
     791
     792void performPlatformSpecificJITAssertions(JSGlobalData* globalData)
     793{
     794    if (!globalData->canUseJIT())
     795        return;
     796
     797#if CPU(ARM_THUMB2)
     798    // Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it contains non POD types),
     799    // and the OBJECT_OFFSETOF macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT
     800    // macros.
     801    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
     802    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVED_R4_OFFSET);
     803    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR5) == PRESERVED_R5_OFFSET);
     804    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR6) == PRESERVED_R6_OFFSET);
     805    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR7) == PRESERVED_R7_OFFSET);
     806    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR8) == PRESERVED_R8_OFFSET);
     807    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR9) == PRESERVED_R9_OFFSET);
     808    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR10) == PRESERVED_R10_OFFSET);
     809    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR11) == PRESERVED_R11_OFFSET);
     810
     811    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
     812    // The fifth argument is the first item already on the stack.
     813    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, unused1) == FIRST_STACK_ARGUMENT);
     814
     815    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
     816
     817#elif CPU(ARM_TRADITIONAL)
     818
     819    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
     820    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVEDR4_OFFSET);
     821
     822
     823#elif CPU(MIPS)
     824    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == PRESERVED_GP_OFFSET);
     825    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == PRESERVED_S0_OFFSET);
     826    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == PRESERVED_S1_OFFSET);
     827    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == PRESERVED_S2_OFFSET);
     828    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
     829    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
     830    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
     831    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == GLOBAL_DATA_OFFSET);
     832
     833#endif
     834}
    791835
    792836NEVER_INLINE static void tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, ReturnAddressPtr returnAddress, JSValue baseValue, const PutPropertySlot& slot, StructureStubInfo* stubInfo, bool direct)
  • trunk/Source/JavaScriptCore/jit/JITStubs.h

    r138970 r139004  
    292292}
    293293#endif
     294
     295void performPlatformSpecificJITAssertions(JSGlobalData*);
    294296
    295297extern "C" {
  • trunk/Source/JavaScriptCore/jit/JITThunks.cpp

    r138516 r139004  
    3636namespace JSC {
    3737
    38 JITThunks::JITThunks(JSGlobalData* globalData)
     38JITThunks::JITThunks()
    3939    : m_hostFunctionStubMap(adoptPtr(new HostFunctionStubMap))
    4040{
    41     if (!globalData->canUseJIT())
    42         return;
    43 
    44 #if CPU(ARM_THUMB2)
    45     // Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it contains non POD types),
    46     // and the OBJECT_OFFSETOF macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT
    47     // macros.
    48     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
    49     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVED_R4_OFFSET);
    50     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR5) == PRESERVED_R5_OFFSET);
    51     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR6) == PRESERVED_R6_OFFSET);
    52     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR7) == PRESERVED_R7_OFFSET);
    53     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR8) == PRESERVED_R8_OFFSET);
    54     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR9) == PRESERVED_R9_OFFSET);
    55     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR10) == PRESERVED_R10_OFFSET);
    56     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR11) == PRESERVED_R11_OFFSET);
    57 
    58     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
    59     // The fifth argument is the first item already on the stack.
    60     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, unused1) == FIRST_STACK_ARGUMENT);
    61 
    62     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
    63 
    64 #elif CPU(ARM_TRADITIONAL)
    65 
    66     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
    67     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVEDR4_OFFSET);
    68 
    69 
    70 #elif CPU(MIPS)
    71     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == PRESERVED_GP_OFFSET);
    72     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == PRESERVED_S0_OFFSET);
    73     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == PRESERVED_S1_OFFSET);
    74     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == PRESERVED_S2_OFFSET);
    75     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
    76     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
    77     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, stack) == REGISTER_FILE_OFFSET);
    78     ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == GLOBAL_DATA_OFFSET);
    79 
    80 #endif
    8141}
    8242
  • trunk/Source/JavaScriptCore/jit/JITThunks.h

    r138516 r139004  
    4747class JITThunks {
    4848public:
    49     JITThunks(JSGlobalData*);
     49    JITThunks();
    5050    ~JITThunks();
    5151
  • trunk/Source/JavaScriptCore/offlineasm/armv7.rb

    r133551 r139004  
    202202        raise unless operands.size == 2
    203203        raise unless operands[1].register?
    204         if operands[0].is_a? Immediate
     204        if operands[0].immediate?
    205205            $asm.puts "#{opcode3} #{operands[1].armV7Operand}, #{operands[1].armV7Operand}, #{operands[0].armV7Operand}"
    206206        else
     
    236236    end
    237237   
    238     if mask.is_a? Immediate and mask.value == -1
     238    if mask.immediate? and mask.value == -1
    239239        $asm.puts "tst #{value.armV7Operand}, #{value.armV7Operand}"
    240     elsif mask.is_a? Immediate
     240    elsif mask.immediate?
    241241        $asm.puts "tst.w #{value.armV7Operand}, #{mask.armV7Operand}"
    242242    else
     
    271271                suffix = ""
    272272            end
    273             if operands.size == 3 and operands[0].is_a? Immediate
    274                 raise unless operands[1].is_a? RegisterID
    275                 raise unless operands[2].is_a? RegisterID
     273            if operands.size == 3 and operands[0].immediate?
     274                raise unless operands[1].register?
     275                raise unless operands[2].register?
    276276                if operands[0].value == 0 and suffix.empty?
    277277                    unless operands[1] == operands[2]
     
    281281                    $asm.puts "adds #{operands[2].armV7Operand}, #{operands[1].armV7Operand}, #{operands[0].armV7Operand}"
    282282                end
    283             elsif operands.size == 3 and operands[0].is_a? RegisterID
    284                 raise unless operands[1].is_a? RegisterID
    285                 raise unless operands[2].is_a? RegisterID
     283            elsif operands.size == 3 and operands[0].immediate?
     284                raise unless operands[1].register?
     285                raise unless operands[2].register?
    286286                $asm.puts "adds #{armV7FlippedOperands(operands)}"
    287287            else
    288                 if operands[0].is_a? Immediate
     288                if operands[0].immediate?
    289289                    unless Immediate.new(nil, 0) == operands[0]
    290290                        $asm.puts "adds #{armV7FlippedOperands(operands)}"
     
    403403            $asm.puts "push #{operands[0].armV7Operand}"
    404404        when "move"
    405             if operands[0].is_a? Immediate
     405            if operands[0].immediate?
    406406                armV7MoveImmediate(operands[0].value, operands[1])
    407407            else
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r138604 r139004  
    235235
    236236#if ENABLE(JIT)
    237     jitStubs = adoptPtr(new JITThunks(this));
     237    jitStubs = adoptPtr(new JITThunks());
     238    performPlatformSpecificJITAssertions(this);
    238239#endif
    239240   
  • trunk/Source/WTF/ChangeLog

    r138970 r139004  
     12013-01-07  Filip Pizlo  <fpizlo@apple.com>
     2
     3        Unreviewed, it should be possible to build JSC on ARM.
     4
     5        * wtf/FastMalloc.cpp:
     6        (WTF::TCMalloc_PageHeap::IncrementalScavenge):
     7
    182013-01-07  Balazs Kilvady  <kilvadyb@homejinni.com>
    29
  • trunk/Source/WTF/wtf/FastMalloc.cpp

    r138409 r139004  
    21382138    if (!DLL_IsEmpty(&slist->normal)) {
    21392139      // Release the last span on the normal portion of this list
    2140       Span* s = slist->normal.prev;
     2140      Span* s = slist->normal.prev();
    21412141      DLL_Remove(s);
    21422142      TCMalloc_SystemRelease(reinterpret_cast<void*>(s->start << kPageShift),
Note: See TracChangeset for help on using the changeset viewer.