Changeset 229302 in webkit


Ignore:
Timestamp:
Mar 5, 2018 7:03:01 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

JITThunk functions should only be called when the JIT is enabled.
https://bugs.webkit.org/show_bug.cgi?id=183351
<rdar://problem/38160091>

Reviewed by Keith Miller.

  • jit/JITThunks.cpp:

(JSC::JITThunks::ctiNativeCall):
(JSC::JITThunks::ctiNativeConstruct):
(JSC::JITThunks::ctiInternalFunctionCall):
(JSC::JITThunks::ctiInternalFunctionConstruct):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::getCTIInternalFunctionTrampolineFor):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r229293 r229302  
     12018-03-05  Mark Lam  <mark.lam@apple.com>
     2
     3        JITThunk functions should only be called when the JIT is enabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=183351
     5        <rdar://problem/38160091>
     6
     7        Reviewed by Keith Miller.
     8
     9        * jit/JITThunks.cpp:
     10        (JSC::JITThunks::ctiNativeCall):
     11        (JSC::JITThunks::ctiNativeConstruct):
     12        (JSC::JITThunks::ctiInternalFunctionCall):
     13        (JSC::JITThunks::ctiInternalFunctionConstruct):
     14        * runtime/VM.cpp:
     15        (JSC::VM::VM):
     16        (JSC::VM::getCTIInternalFunctionTrampolineFor):
     17
    1182018-03-05  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/jit/JITThunks.cpp

    r226011 r229302  
    11/*
    2  * Copyright (C) 2012, 2013, 2015-2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4848MacroAssemblerCodePtr JITThunks::ctiNativeCall(VM* vm)
    4949{
    50     if (!VM::canUseJIT())
    51         return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_call_trampoline);
     50    ASSERT(VM::canUseJIT());
    5251    return ctiStub(vm, nativeCallGenerator).code();
    5352}
     
    5554MacroAssemblerCodePtr JITThunks::ctiNativeConstruct(VM* vm)
    5655{
    57     if (!VM::canUseJIT())
    58         return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_construct_trampoline);
     56    ASSERT(VM::canUseJIT());
    5957    return ctiStub(vm, nativeConstructGenerator).code();
    6058}
     
    7472MacroAssemblerCodePtr JITThunks::ctiInternalFunctionCall(VM* vm)
    7573{
    76     if (!VM::canUseJIT())
    77         return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_call_trampoline);
     74    ASSERT(VM::canUseJIT());
    7875    return ctiStub(vm, internalFunctionCallGenerator).code();
    7976}
     
    8178MacroAssemblerCodePtr JITThunks::ctiInternalFunctionConstruct(VM* vm)
    8279{
    83     if (!VM::canUseJIT())
    84         return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_construct_trampoline);
     80    ASSERT(VM::canUseJIT());
    8581    return ctiStub(vm, internalFunctionConstructGenerator).code();
    8682}
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r229209 r229302  
    454454    }
    455455
     456#if ENABLE(JIT)
    456457    // Make sure that any stubs that the JIT is going to use are initialized in non-compilation threads.
    457     getCTIInternalFunctionTrampolineFor(CodeForCall);
    458     getCTIInternalFunctionTrampolineFor(CodeForConstruct);
     458    if (canUseJIT()) {
     459        getCTIInternalFunctionTrampolineFor(CodeForCall);
     460        getCTIInternalFunctionTrampolineFor(CodeForConstruct);
     461    }
     462#endif
    459463
    460464    VMInspector::instance().add(this);
     
    693697{
    694698#if ENABLE(JIT)
    695     if (kind == CodeForCall)
    696         return jitStubs->ctiInternalFunctionCall(this);
    697     return jitStubs->ctiInternalFunctionConstruct(this);
    698 #else
     699    if (canUseJIT()) {
     700        if (kind == CodeForCall)
     701            return jitStubs->ctiInternalFunctionCall(this);
     702        return jitStubs->ctiInternalFunctionConstruct(this);
     703    }
     704#endif
    699705    if (kind == CodeForCall)
    700706        return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_call_trampoline);
    701707    return MacroAssemblerCodePtr::createLLIntCodePtr(llint_internal_function_construct_trampoline);
    702 #endif
    703708}
    704709
Note: See TracChangeset for help on using the changeset viewer.