Ignore:
Timestamp:
Oct 23, 2019, 6:00:07 PM (6 years ago)
Author:
[email protected]
Message:

[JSC] Figure out missing prepareCallOperation
https://bugs.webkit.org/show_bug.cgi?id=203285

Reviewed by Mark Lam.

Source/JavaScriptCore:

We start using builtin_frame_address to get CallFrame* in JIT operations. For the platform which is not supporting this API (MSVC),
we put frame-pointer to vm.topCallFrame in the caller side. The problem is that all Apple platform is now using
builtin_frame_address,
and we are not testing vm.topCallFrame version at all.

To find missing prepareCallOperation call, we introduce JITOperationPrologueCallFrameTracer. When USE(BUILTIN_FRAME_ADDRESS) is enabled and
if it is debug build, we anyway put frame-pointer to vm.topCallFrame. And after that, we ensure that vm.topCallFrame is the same to the
CallFrame* gained by builtin_frame_address. By doing this, we can find places missing this call in debug build of Apple ports.

We also found that FTL's custom getter calling is putting wrong value to vm.topCallFrame. This patch fixes it too.

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::emitRestoreArguments):
(JSC::DFG::operationCompileOSRExit):
(JSC::DFG::OSRExit::compileExit):
(JSC::DFG::operationDebugPrintSpeculationFailure):
(JSC::DFG::OSRExit::compileOSRExit): Deleted.
(JSC::DFG::OSRExit::debugOperationPrintSpeculationFailure): Deleted.

  • dfg/DFGOSRExit.h:
  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::handleExitCounts):
(JSC::DFG::osrWriteBarrier):

  • dfg/DFGOSRExitCompilerCommon.h:
  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitThunkGenerator):
(JSC::DFG::osrExitGenerationThunkGenerator):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):
(JSC::FTL::DFG::LowerDFGToB3::callCheck):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):
(JSC::FTL::operationCompileFTLOSRExit):
(JSC::FTL::compileFTLOSRExit): Deleted.

  • ftl/FTLOSRExitCompiler.h:
  • ftl/FTLOperations.cpp:

(JSC::FTL::operationPopulateObjectInOSR):
(JSC::FTL::operationMaterializeObjectInOSR):
(JSC::FTL::operationCompileFTLLazySlowPath):
(JSC::FTL::compileFTLLazySlowPath): Deleted.

  • ftl/FTLOperations.h:
  • ftl/FTLSlowPathCall.cpp:

(JSC::FTL::SlowPathCallContext::makeCall):

  • ftl/FTLThunks.cpp:

(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::osrExitGenerationThunkGenerator):
(JSC::FTL::lazySlowPathGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):

  • ftl/FTLThunks.h:

(JSC::FTL::generateIfNecessary):
(JSC::FTL::Thunks::getSlowPathCallThunk):

  • interpreter/FrameTracers.h:

(JSC::SlowPathFrameTracer::SlowPathFrameTracer):
(JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer):
(JSC::JITOperationPrologueCallFrameTracer::~JITOperationPrologueCallFrameTracer):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::AssemblyHelpers::debugCall):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::prepareCallOperation):

  • jit/CCallHelpers.cpp:

(JSC::CCallHelpers::ensureShadowChickenPacket):

  • jit/CCallHelpers.h:

(JSC::CCallHelpers::prepareCallOperation): Deleted.

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
  • jit/Repatch.cpp:

(JSC::ftlThunkAwareRepatchCall):

  • jit/ThunkGenerators.cpp:

(JSC::boundThisNoArgsFunctionCallGenerator):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::handleHostCall):

  • runtime/AtomicsObject.cpp:

(JSC::operationAtomicsAdd):
(JSC::operationAtomicsAnd):
(JSC::operationAtomicsCompareExchange):
(JSC::operationAtomicsExchange):
(JSC::operationAtomicsIsLockFree):
(JSC::operationAtomicsLoad):
(JSC::operationAtomicsOr):
(JSC::operationAtomicsStore):
(JSC::operationAtomicsSub):
(JSC::operationAtomicsXor):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/StringPrototype.cpp:

(JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
(JSC::operationStringProtoFuncReplaceRegExpString):
(JSC::operationStringProtoFuncReplaceGeneric):

  • tools/JSDollarVM.cpp:

(IGNORE_WARNINGS_BEGIN):

  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::emitLoopTierUpCheck):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::emitLoopTierUpCheck):

  • wasm/WasmOperations.cpp:

(JSC::Wasm::operationWasmThrowBadI64):
(JSC::Wasm::operationWasmTriggerOSREntryNow):
(JSC::Wasm::operationWasmTriggerTierUpNow):
(JSC::Wasm::operationThrowBadI64): Deleted.
(JSC::Wasm::triggerOSREntryNow): Deleted.
(JSC::Wasm::triggerTierUpNow): Deleted.

  • wasm/WasmOperations.h:
  • wasm/WasmThunks.cpp:

(JSC::Wasm::triggerOMGEntryTierUpThunkGenerator):

  • wasm/js/JSWebAssembly.cpp:

(JSC::instantiate):

  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::operationWasmToJSException):
(JSC::Wasm::emitThrowWasmToJSException):
(JSC::Wasm::wasmToJSException): Deleted.

  • wasm/js/WasmToJS.h:
  • wasm/js/WebAssemblyInstanceConstructor.cpp:

(JSC::constructJSWebAssemblyInstance):

Source/WebCore:

Use JITOperationPrologueCallFrameTracer instead of NativeCallFrameTracer.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateOperationDefinition):

  • bindings/scripts/test/JS/JSTestDOMJIT.cpp:

(WebCore::jsTestDOMJITPrototypeFunctionGetAttributeWithoutTypeCheck):
(WebCore::jsTestDOMJITPrototypeFunctionItemWithoutTypeCheck):
(WebCore::jsTestDOMJITPrototypeFunctionHasAttributeWithoutTypeCheck):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdWithoutTypeCheck):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameWithoutTypeCheck):

  • domjit/DOMJITHelpers.h:

(WebCore::DOMJIT::toWrapperSlow):

Source/WTF:

Enable USE(BUILTIN_FRAME_ADDRESS) regardless of platform is the compilers and architectures match.

  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp

    r251457 r251518  
    758758            VM& vm = globalObject->vm();
    759759            CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
    760             NativeCallFrameTracer tracer(vm, callFrame);
     760            JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
    761761            return JSValue::encode(jsNumber(static_cast<DOMJITGetter*>(pointer)->value()));
    762762        }
     
    852852            VM& vm = globalObject->vm();
    853853            CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
    854             NativeCallFrameTracer tracer(vm, callFrame);
     854            JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
    855855            auto scope = DECLARE_THROW_SCOPE(vm);
    856856            auto* object = static_cast<DOMJITNode*>(pointer);
     
    959959        DollarVMAssertScope assertScope;
    960960        VM& vm = globalObject->vm();
    961         NativeCallFrameTracer tracer(vm, callFrame);
    962961        auto scope = DECLARE_THROW_SCOPE(vm);
    963962
     
    973972        VM& vm = globalObject->vm();
    974973        CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
    975         NativeCallFrameTracer tracer(vm, callFrame);
     974        JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
    976975        return JSValue::encode(jsNumber(node->value()));
    977976    }
     
    10521051        VM& vm = globalObject->vm();
    10531052        CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
    1054         NativeCallFrameTracer tracer(vm, callFrame);
     1053        JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
    10551054        return JSValue::encode(jsNumber(node->value()));
    10561055    }
     
    11151114            VM& vm = globalObject->vm();
    11161115            CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
    1117             NativeCallFrameTracer tracer(vm, callFrame);
     1116            JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
    11181117            JSObject* object = static_cast<JSObject*>(pointer);
    11191118            return JSValue::encode(object->getPrototypeDirect(vm));
Note: See TracChangeset for help on using the changeset viewer.