Changeset 199863 in webkit
- Timestamp:
- Apr 21, 2016 7:28:00 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r199861 r199863 1 2016-04-21 Keith Miller <keith_miller@apple.com> 2 3 FTL should handle exceptions in operationInOptimize 4 https://bugs.webkit.org/show_bug.cgi?id=156885 5 6 Reviewed by Michael Saboff. 7 8 For some reasone we didn't handle any exceptions in "in" when we called 9 operationInOptimize in the FTL. 10 11 * bytecode/CodeBlock.cpp: 12 (JSC::CodeBlock::dumpAssumingJITType): 13 * ftl/FTLCapabilities.cpp: 14 (JSC::FTL::canCompile): 15 * ftl/FTLLowerDFGToB3.cpp: 16 (JSC::FTL::DFG::LowerDFGToB3::compileIn): 17 * ftl/FTLPatchpointExceptionHandle.h: Add comments explaining which 18 function to use for different exception types. 19 20 * jsc.cpp: 21 (GlobalObject::finishCreation): 22 (functionNoFTL): 23 * runtime/Executable.cpp: 24 (JSC::ScriptExecutable::ScriptExecutable): 25 * runtime/Executable.h: 26 (JSC::ScriptExecutable::setNeverFTLOptimize): 27 (JSC::ScriptExecutable::neverFTLOptimize): 28 * tests/stress/in-ftl-exception-check.js: Added. 29 (foo): 30 (bar): 31 (catch): 32 1 33 2016-04-21 Filip Pizlo <fpizlo@apple.com> 2 34 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r199731 r199863 1997 1997 DC17E8191C9C91DB008A6AB3 /* ShadowChickenInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = DC17E8151C9C7FD4008A6AB3 /* ShadowChickenInlines.h */; }; 1998 1998 DC17E81A1C9C91E9008A6AB3 /* CCallHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DC17E8161C9C802B008A6AB3 /* CCallHelpers.cpp */; }; 1999 DC2143071CA32E55000A8869 /* ICStats.h in Headers */ = {isa = PBXBuildFile; fileRef = DC2143061CA32E52000A8869 /* ICStats.h */; }; 2000 DC2143081CA32E58000A8869 /* ICStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DC2143051CA32E52000A8869 /* ICStats.cpp */; }; 1999 2001 DE26E9031CB5DD0500D2BE82 /* BuiltinExecutableCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = DE26E9021CB5DD0500D2BE82 /* BuiltinExecutableCreator.h */; }; 2000 2002 DE26E9071CB5DEFB00D2BE82 /* BuiltinExecutableCreator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE26E9061CB5DD9600D2BE82 /* BuiltinExecutableCreator.cpp */; }; … … 2002 2004 DEA7E2441BBC677200D78440 /* JSTypedArrayViewPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */; }; 2003 2005 DEA7E2451BBC677F00D78440 /* JSTypedArrayViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 53917E7C1B791106000EBD33 /* JSTypedArrayViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2004 DC2143071CA32E55000A8869 /* ICStats.h in Headers */ = {isa = PBXBuildFile; fileRef = DC2143061CA32E52000A8869 /* ICStats.h */; };2005 DC2143081CA32E58000A8869 /* ICStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DC2143051CA32E52000A8869 /* ICStats.cpp */; };2006 2006 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2007 2007 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; }; … … 4205 4205 D21202290AD4310C00ED79B6 /* DateConversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DateConversion.h; sourceTree = "<group>"; }; 4206 4206 DC00039019D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPreciseLocalClobberize.h; path = dfg/DFGPreciseLocalClobberize.h; sourceTree = "<group>"; }; 4207 DC2143051CA32E52000A8869 /* ICStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ICStats.cpp; sourceTree = "<group>"; };4208 DC2143061CA32E52000A8869 /* ICStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICStats.h; sourceTree = "<group>"; };4209 4207 DC17E8131C9C7FD4008A6AB3 /* ShadowChicken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowChicken.cpp; sourceTree = "<group>"; }; 4210 4208 DC17E8141C9C7FD4008A6AB3 /* ShadowChicken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowChicken.h; sourceTree = "<group>"; }; 4211 4209 DC17E8151C9C7FD4008A6AB3 /* ShadowChickenInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowChickenInlines.h; sourceTree = "<group>"; }; 4212 4210 DC17E8161C9C802B008A6AB3 /* CCallHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCallHelpers.cpp; sourceTree = "<group>"; }; 4211 DC2143051CA32E52000A8869 /* ICStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ICStats.cpp; sourceTree = "<group>"; }; 4212 DC2143061CA32E52000A8869 /* ICStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICStats.h; sourceTree = "<group>"; }; 4213 4213 DE26E9021CB5DD0500D2BE82 /* BuiltinExecutableCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltinExecutableCreator.h; sourceTree = "<group>"; }; 4214 4214 DE26E9061CB5DD9600D2BE82 /* BuiltinExecutableCreator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltinExecutableCreator.cpp; sourceTree = "<group>"; }; -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r199724 r199863 231 231 if (ownerScriptExecutable()->neverOptimize()) 232 232 out.print(" (NeverOptimize)"); 233 else if (ownerScriptExecutable()->neverFTLOptimize()) 234 out.print(" (NeverFTLOptimize)"); 233 235 if (ownerScriptExecutable()->didTryToEnterInLoop()) 234 236 out.print(" (DidTryToEnterInLoop)"); -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r199748 r199863 440 440 return CannotCompile; 441 441 } 442 443 if (UNLIKELY(graph.m_codeBlock->ownerScriptExecutable()->neverFTLOptimize())) { 444 if (verboseCapabilities()) 445 dataLog("FTL rejecting ", *graph.m_codeBlock, " because it is marked as never FTL compile.\n"); 446 return CannotCompile; 447 } 442 448 443 449 CapabilityLevel result = CanCompileAndOSREnter; -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r199748 r199863 5984 5984 patchpoint->clobber(RegisterSet::macroScratchRegisters()); 5985 5985 5986 RefPtr<PatchpointExceptionHandle> exceptionHandle = preparePatchpointForExceptions(patchpoint); 5987 5986 5988 State* state = &m_ftlState; 5987 5989 patchpoint->setGenerator( 5988 5990 [=] (CCallHelpers& jit, const StackmapGenerationParams& params) { 5989 5991 AllowMacroScratchRegisterUsage allowScratch(jit); 5992 5993 // This is the direct exit target for operation calls. We don't need a JS exceptionHandle because we don't 5994 // cache Proxy objects. 5995 Box<CCallHelpers::JumpList> exceptions = exceptionHandle->scheduleExitCreation(params)->jumps(jit); 5990 5996 5991 5997 GPRReg baseGPR = params[1].gpr(); … … 6012 6018 CCallHelpers::Call slowPathCall = callOperation( 6013 6019 *state, params.unavailableRegisters(), jit, 6014 node->origin.semantic, nullptr, operationInOptimize,6020 node->origin.semantic, exceptions.get(), operationInOptimize, 6015 6021 resultGPR, CCallHelpers::TrustedImmPtr(stubInfo), baseGPR, 6016 6022 CCallHelpers::TrustedImmPtr(str)).call(); -
trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h
r196729 r199863 79 79 // created, but it will happen before linking. You can link jumps to it during link time. That's 80 80 // why this returns an ExceptionTarget. That will contain the jump destination (target->label()) 81 // at link time. 81 // at link time. This function should be used for exceptions from C calls. 82 82 RefPtr<ExceptionTarget> scheduleExitCreation(const B3::StackmapGenerationParams&); 83 83 84 84 // Schedules the creation of an OSR exit jump destination, and ensures that it gets associated 85 // with the handler for some callsite index. 85 // with the handler for some callsite index. This function should be used for exceptions from JS. 86 86 void scheduleExitCreationForUnwind(const B3::StackmapGenerationParams&, CallSiteIndex); 87 87 -
trunk/Source/JavaScriptCore/jsc.cpp
r199800 r199863 591 591 static EncodedJSValue JSC_HOST_CALL functionNeverInlineFunction(ExecState*); 592 592 static EncodedJSValue JSC_HOST_CALL functionNoDFG(ExecState*); 593 static EncodedJSValue JSC_HOST_CALL functionNoFTL(ExecState*); 593 594 static EncodedJSValue JSC_HOST_CALL functionOptimizeNextInvocation(ExecState*); 594 595 static EncodedJSValue JSC_HOST_CALL functionNumberOfDFGCompiles(ExecState*); … … 767 768 addFunction(vm, "noInline", functionNeverInlineFunction, 1); 768 769 addFunction(vm, "noDFG", functionNoDFG, 1); 770 addFunction(vm, "noFTL", functionNoFTL, 1); 769 771 addFunction(vm, "numberOfDFGCompiles", functionNumberOfDFGCompiles, 1); 770 772 addFunction(vm, "optimizeNextInvocation", functionOptimizeNextInvocation, 1); … … 1522 1524 } 1523 1525 1526 EncodedJSValue JSC_HOST_CALL functionNoFTL(ExecState* exec) 1527 { 1528 if (JSFunction* function = jsDynamicCast<JSFunction*>(exec->argument(0))) { 1529 FunctionExecutable* executable = function->jsExecutable(); 1530 executable->setNeverFTLOptimize(true); 1531 } 1532 1533 return JSValue::encode(jsUndefined()); 1534 } 1535 1524 1536 EncodedJSValue JSC_HOST_CALL functionOptimizeNextInvocation(ExecState* exec) 1525 1537 { -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r198980 r199863 118 118 , m_neverInline(false) 119 119 , m_neverOptimize(false) 120 , m_neverFTLOptimize(false) 120 121 , m_isArrowFunctionContext(isInArrowFunctionContext) 121 122 , m_derivedContextType(static_cast<unsigned>(derivedContextType)) -
trunk/Source/JavaScriptCore/runtime/Executable.h
r198980 r199863 358 358 void setNeverInline(bool value) { m_neverInline = value; } 359 359 void setNeverOptimize(bool value) { m_neverOptimize = value; } 360 void setNeverFTLOptimize(bool value) { m_neverFTLOptimize = value; } 360 361 void setDidTryToEnterInLoop(bool value) { m_didTryToEnterInLoop = value; } 361 362 bool neverInline() const { return m_neverInline; } 362 363 bool neverOptimize() const { return m_neverOptimize; } 364 bool neverFTLOptimize() const { return m_neverFTLOptimize; } 363 365 bool didTryToEnterInLoop() const { return m_didTryToEnterInLoop; } 364 366 bool isInliningCandidate() const { return !neverInline(); } … … 420 422 bool m_neverInline : 1; 421 423 bool m_neverOptimize : 1; 424 bool m_neverFTLOptimize : 1; 422 425 bool m_isArrowFunctionContext : 1; 423 426 unsigned m_derivedContextType : 2; // DerivedContextType
Note: See TracChangeset
for help on using the changeset viewer.