Changeset 157932 in webkit


Ignore:
Timestamp:
Oct 24, 2013, 9:10:59 AM (12 years ago)
Author:
mark.lam@apple.com
Message:

Fix broken C Loop LLINT build.
https://bugs.webkit.org/show_bug.cgi?id=123271.

Reviewed by Michael Saboff.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::printGetByIdCacheStatus): Added an UNUSED_PARAM().
(JSC::CodeBlock::dumpBytecode): Added #if ENABLE(JIT) to JIT only code.

  • bytecode/GetByIdStatus.cpp:

(JSC::GetByIdStatus::computeFor): Added an UNUSED_PARAM().

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeFor): Added an UNUSED_PARAM().

  • bytecode/StructureStubInfo.h:
  • Added a stub StubInfoMap for non-JIT builds. StubInfoMap is still used in function prototypes even when !ENABLE(JIT). Rather that adding #if's in many places, we just provide a stub/placeholder implementation that is unused but keeps the compiler happy.
  • jit/JITOperations.h: Added #if ENABLE(JIT).
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • The putByVal() macro reifies a slow path which is never taken in one case. This translates into a label that is never used in the C Loop LLINT. The C++ compiler doesn't like unused labels. So, we fix this by adding a cloopUnusedLabel offline asm instruction that synthesizes the following:

if (false) goto unusedLabel;

This keeps the C++ compiler happy without changing code behavior.

  • offlineasm/cloop.rb: Implementing cloopUnusedLabel.
  • offlineasm/instructions.rb: Declaring cloopUnusedLabel.
  • runtime/Executable.cpp:

(JSC::setupJIT): Added UNUSED_PARAM()s.
(JSC::ScriptExecutable::prepareForExecutionImpl):

  • run-javascriptcore-tests have phases that forces the LLINT to be off which in turn asserts that the JIT is enabled. With the C Loop LLINT, this combination is illegal. So, we override the setup code here to always use the LLINT if !ENABLE(JIT) regardless of what options are passed in.
Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r157930 r157932  
     12013-10-24  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix broken C Loop LLINT build.
     4        https://bugs.webkit.org/show_bug.cgi?id=123271.
     5
     6        Reviewed by Michael Saboff.
     7
     8        * bytecode/CodeBlock.cpp:
     9        (JSC::CodeBlock::printGetByIdCacheStatus): Added an UNUSED_PARAM().
     10        (JSC::CodeBlock::dumpBytecode): Added #if ENABLE(JIT) to JIT only code.
     11        * bytecode/GetByIdStatus.cpp:
     12        (JSC::GetByIdStatus::computeFor): Added an UNUSED_PARAM().
     13        * bytecode/PutByIdStatus.cpp:
     14        (JSC::PutByIdStatus::computeFor): Added an UNUSED_PARAM().
     15        * bytecode/StructureStubInfo.h:
     16        - Added a stub StubInfoMap for non-JIT builds. StubInfoMap is still used
     17          in function prototypes even when !ENABLE(JIT). Rather that adding #if's
     18          in many places, we just provide a stub/placeholder implementation that
     19          is unused but keeps the compiler happy.
     20        * jit/JITOperations.h: Added #if ENABLE(JIT).
     21        * llint/LowLevelInterpreter32_64.asm:
     22        * llint/LowLevelInterpreter64.asm:
     23        - The putByVal() macro reifies a slow path which is never taken in one case.
     24          This translates into a label that is never used in the C Loop LLINT. The
     25          C++ compiler doesn't like unused labels. So, we fix this by adding a
     26          cloopUnusedLabel offline asm instruction that synthesizes the following:
     27
     28              if (false) goto unusedLabel;
     29
     30          This keeps the C++ compiler happy without changing code behavior.
     31        * offlineasm/cloop.rb: Implementing cloopUnusedLabel.
     32        * offlineasm/instructions.rb: Declaring cloopUnusedLabel.
     33        * runtime/Executable.cpp:
     34        (JSC::setupJIT): Added UNUSED_PARAM()s.
     35        (JSC::ScriptExecutable::prepareForExecutionImpl):
     36        - run-javascriptcore-tests have phases that forces the LLINT to be off
     37          which in turn asserts that the JIT is enabled. With the C Loop LLINT,
     38          this combination is illegal. So, we override the setup code here to
     39          always use the LLINT if !ENABLE(JIT) regardless of what options are
     40          passed in.
     41
    1422013-10-24  peavo@outlook.com  <peavo@outlook.com>
    243
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r157660 r157932  
    445445        }
    446446    }
     447#else
     448    UNUSED_PARAM(map);
    447449#endif
    448450}
     
    523525   
    524526    StubInfoMap stubInfos;
     527#if ENABLE(JIT)
    525528    {
    526529        ConcurrentJITLocker locker(m_lock);
    527530        getStubInfoMap(locker, stubInfos);
    528531    }
     532#endif
    529533   
    530534    const Instruction* begin = instructions().begin();
  • trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp

    r157660 r157932  
    247247    return result;
    248248#else // ENABLE(JIT)
     249    UNUSED_PARAM(map);
    249250    return GetByIdStatus(NoInformation, false);
    250251#endif // ENABLE(JIT)
  • trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp

    r157660 r157932  
    144144    }
    145145#else // ENABLE(JIT)
     146    UNUSED_PARAM(map);
    146147    return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset);
    147148#endif // ENABLE(JIT)
  • trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h

    r157707 r157932  
    2929#include <wtf/Platform.h>
    3030
    31 #if ENABLE(JIT)
    32 
    3331#include "CodeOrigin.h"
    3432#include "Instruction.h"
     
    4341
    4442namespace JSC {
     43
     44#if ENABLE(JIT)
    4545
    4646class PolymorphicPutByIdList;
     
    302302typedef HashMap<CodeOrigin, StructureStubInfo*> StubInfoMap;
    303303
     304#else
     305
     306typedef HashMap<int, void*> StubInfoMap;
     307
     308#endif // ENABLE(JIT)
     309
    304310} // namespace JSC
    305311
    306 #endif // ENABLE(JIT)
    307 
    308312#endif // StructureStubInfo_h
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r157660 r157932  
    2626#ifndef JITOperations_h
    2727#define JITOperations_h
     28
     29#if ENABLE(JIT)
    2830
    2931#include "CallFrame.h"
     
    276278} // namespace JSC
    277279
     280#endif // ENABLE(JIT)
     281
    278282#endif // JITOperations_h
    279283
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

    r157875 r157932  
    13901390_llint_op_put_by_val_direct:
    13911391    putByVal(macro(addr, slowPath)
     1392        if C_LOOP
     1393            cloopUnusedLabel slowPath
     1394        end
    13921395    end, _llint_slow_path_put_by_val_direct)
    13931396
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r157875 r157932  
    12491249_llint_op_put_by_val_direct:
    12501250    putByVal(macro(slot, slowPath)
     1251        if C_LOOP
     1252            cloopUnusedLabel slowPath
     1253        end
    12511254    end, _llint_slow_path_put_by_val_direct)
    12521255
  • trunk/Source/JavaScriptCore/offlineasm/cloop.rb

    r157572 r157932  
    11111111            cloopEmitCallSlowPath(operands)
    11121112
     1113        when "cloopUnusedLabel"
     1114            $asm.putc "if (false) goto #{operands[0].cLabel};"
     1115
    11131116        # For debugging only. This is used to insert instrumentation into the
    11141117        # generated LLIntAssembly.h during llint development only. Do not use
  • trunk/Source/JavaScriptCore/offlineasm/instructions.rb

    r157474 r157932  
    296296     "cloopCallNative",      # operands: callee
    297297     "cloopCallSlowPath",    # operands: callTarget, currentFrame, currentPC
     298     "cloopUnusedLabel",     # operands: label
    298299
    299300     # For debugging only:
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r157559 r157932  
    278278    RELEASE_ASSERT(result == CompilationSuccessful);
    279279#else
     280    UNUSED_PARAM(vm);
     281    UNUSED_PARAM(codeBlock);
    280282    UNREACHABLE_FOR_PLATFORM();
    281283#endif
     
    296298   
    297299    bool shouldUseLLInt;
    298 #if ENABLE(LLINT)
     300#if !ENABLE(JIT)
     301    // No JIT implies use of the C Loop LLINT. Override the options to reflect this.
     302    Options::useLLInt() = true;
     303    shouldUseLLInt = true;
     304#elif ENABLE(LLINT)
    299305    shouldUseLLInt = Options::useLLInt();
    300306#else
Note: See TracChangeset for help on using the changeset viewer.