Ignore:
Timestamp:
Sep 30, 2020, 10:15:14 PM (5 years ago)
Author:
[email protected]
Message:

[JSC] We should not tag C function with JIT code related ptr tag
https://bugs.webkit.org/show_bug.cgi?id=217150

Reviewed by Mark Lam.

We are tagging getHostCallReturnValue function with JIT related PtrTag. As a part of JIT-caging effort, we are restricting our
PtrTag usage more for code types (e.g. JIT code should be tagged with JIT related PtrTag). So, we should not tag getHostCallReturnValue
with that. This patch implements getHostCallReturnValue in JIT code if JIT is enabled. If not, it is implemented by LLInt.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • bytecode/BytecodeList.rb:
  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::Footer::offsetOfVM):

  • heap/PreciseAllocation.h:

(JSC::PreciseAllocation::offsetOfWeakSet):

  • heap/WeakSet.h:

(JSC::WeakSet::offsetOfVM):

  • jit/HostCallReturnValue.cpp: Removed.
  • jit/HostCallReturnValue.h: Removed.
  • jit/JITOperations.cpp:
  • jit/JITOperationsMSVC64.cpp: Removed.
  • jit/JITStubsMSVC64.asm:
  • llint/LLIntEntrypoint.cpp:

(JSC::LLInt::getHostCallReturnValueEntrypoint):

  • llint/LLIntEntrypoint.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::handleHostCall):
(JSC::LLInt::commonCallEval):

  • llint/LLIntThunks.cpp:

(JSC::LLInt::getHostCallReturnValueThunk):

  • llint/LLIntThunks.h:
  • llint/LowLevelInterpreter.cpp:

(JSC::CLoop::execute):

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/JSCellInlines.h:

(JSC::tryAllocateCellHelper):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::offsetOfVM):

  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:

(JSC::VM::offsetOfEncodedHostCallReturnValue):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r267808 r267820  
    4141#include "FunctionCodeBlock.h"
    4242#include "GetterSetter.h"
    43 #include "HostCallReturnValue.h"
    4443#include "JITExceptions.h"
    4544#include "JITWorklist.h"
     
    16721671            SlowPathFrameTracer tracer(vm, calleeFrame);
    16731672            calleeFrame->setCallee(asObject(callee));
    1674             vm.hostCallReturnValue = JSValue::decode(callData.native.function(asObject(callee)->globalObject(vm), calleeFrame));
    1675             LLINT_CALL_RETURN(globalObject, calleeFrame, LLInt::getCodePtr(getHostCallReturnValue), CFunctionPtrTag);
     1673            vm.encodedHostCallReturnValue = callData.native.function(asObject(callee)->globalObject(vm), calleeFrame);
     1674            DisallowGC disallowGC;
     1675            LLINT_CALL_RETURN(globalObject, calleeFrame, LLInt::getHostCallReturnValueEntrypoint().code().executableAddress(), JSEntryPtrTag);
    16761676        }
    16771677       
     
    16901690        SlowPathFrameTracer tracer(vm, calleeFrame);
    16911691        calleeFrame->setCallee(asObject(callee));
    1692         vm.hostCallReturnValue = JSValue::decode(constructData.native.function(asObject(callee)->globalObject(vm), calleeFrame));
    1693         LLINT_CALL_RETURN(globalObject, calleeFrame, LLInt::getCodePtr(getHostCallReturnValue), CFunctionPtrTag);
     1692        vm.encodedHostCallReturnValue = constructData.native.function(asObject(callee)->globalObject(vm), calleeFrame);
     1693        DisallowGC disallowGC;
     1694        LLINT_CALL_RETURN(globalObject, calleeFrame, LLInt::getHostCallReturnValueEntrypoint().code().executableAddress(), JSEntryPtrTag);
    16941695    }
    16951696   
     
    19601961        RELEASE_AND_RETURN(throwScope, setUpCall(calleeFrame, CodeForCall, calleeAsValue));
    19611962   
    1962     vm.hostCallReturnValue = eval(globalObject, calleeFrame, bytecode.m_ecmaMode);
    1963     LLINT_CALL_RETURN(globalObject, calleeFrame, LLInt::getCodePtr(getHostCallReturnValue), CFunctionPtrTag);
     1963    vm.encodedHostCallReturnValue = JSValue::encode(eval(globalObject, calleeFrame, bytecode.m_ecmaMode));
     1964    DisallowGC disallowGC;
     1965    LLINT_CALL_RETURN(globalObject, calleeFrame, LLInt::getHostCallReturnValueEntrypoint().code().executableAddress(), JSEntryPtrTag);
    19641966}
    19651967   
Note: See TracChangeset for help on using the changeset viewer.