Title: [168459] trunk/Source
Revision
168459
Author
fpi...@apple.com
Date
2014-05-07 19:35:22 -0700 (Wed, 07 May 2014)

Log Message

Source/_javascript_Core: Make Executable::clearCode() actually clear all of the entrypoints, and
clean up some other FTL-related calling convention stuff.
<rdar://problem/16720172>

Rubber stamped by Mark Hahnenberg.

* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::Worklist):
(JSC::DFG::Worklist::finishCreation):
(JSC::DFG::Worklist::create):
(JSC::DFG::ensureGlobalDFGWorklist):
(JSC::DFG::ensureGlobalFTLWorklist):
* dfg/DFGWorklist.h:
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::dump):
* heap/CodeBlockSet.h:
* runtime/Executable.cpp:
(JSC::ExecutableBase::clearCode):

Source/WTF: UNREACHABLE_FOR_PLATFORM() is meant to be a release crash.

Rubber stamped by Mark Hahnenberg..

* wtf/Assertions.h:
(UNREACHABLE_FOR_PLATFORM):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (168458 => 168459)


--- trunk/Source/_javascript_Core/ChangeLog	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-05-08 02:35:22 UTC (rev 168459)
@@ -1,3 +1,26 @@
+2014-05-07  Filip Pizlo  <fpi...@apple.com>
+
+        Make Executable::clearCode() actually clear all of the entrypoints, and
+        clean up some other FTL-related calling convention stuff.
+        <rdar://problem/16720172>
+
+        Rubber stamped by Mark Hahnenberg.
+
+        * dfg/DFGOperations.cpp:
+        * dfg/DFGOperations.h:
+        * dfg/DFGWorklist.cpp:
+        (JSC::DFG::Worklist::Worklist):
+        (JSC::DFG::Worklist::finishCreation):
+        (JSC::DFG::Worklist::create):
+        (JSC::DFG::ensureGlobalDFGWorklist):
+        (JSC::DFG::ensureGlobalFTLWorklist):
+        * dfg/DFGWorklist.h:
+        * heap/CodeBlockSet.cpp:
+        (JSC::CodeBlockSet::dump):
+        * heap/CodeBlockSet.h:
+        * runtime/Executable.cpp:
+        (JSC::ExecutableBase::clearCode):
+
 2014-05-07  Andreas Kling  <akl...@apple.com>
 
         [X86] Emit BT instruction for single-bit tests.

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (168458 => 168459)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2014-05-08 02:35:22 UTC (rev 168459)
@@ -1286,46 +1286,6 @@
         exec, codeBlock, jitCode->osrEntryBlock.get(), bytecodeIndex, streamIndex);
     return static_cast<char*>(address);
 }
-
-// FIXME: Make calls work well. Currently they're a pure regression.
-// https://bugs.webkit.org/show_bug.cgi?id=113621
-EncodedJSValue JIT_OPERATION operationFTLCall(ExecState* exec)
-{
-    ExecState* callerExec = exec->callerFrame();
-    
-    VM* vm = &callerExec->vm();
-    NativeCallFrameTracer tracer(vm, callerExec);
-    
-    JSValue callee = exec->calleeAsValue();
-    CallData callData;
-    CallType callType = getCallData(callee, callData);
-    if (callType == CallTypeNone) {
-        vm->throwException(callerExec, createNotAFunctionError(callerExec, callee));
-        return JSValue::encode(jsUndefined());
-    }
-    
-    return JSValue::encode(call(callerExec, callee, callType, callData, exec->thisValue(), exec));
-}
-
-// FIXME: Make calls work well. Currently they're a pure regression.
-// https://bugs.webkit.org/show_bug.cgi?id=113621
-EncodedJSValue JIT_OPERATION operationFTLConstruct(ExecState* exec)
-{
-    ExecState* callerExec = exec->callerFrame();
-    
-    VM* vm = &callerExec->vm();
-    NativeCallFrameTracer tracer(vm, callerExec);
-    
-    JSValue callee = exec->calleeAsValue();
-    ConstructData constructData;
-    ConstructType constructType = getConstructData(callee, constructData);
-    if (constructType == ConstructTypeNone) {
-        vm->throwException(callerExec, createNotAFunctionError(callerExec, callee));
-        return JSValue::encode(jsUndefined());
-    }
-    
-    return JSValue::encode(construct(callerExec, callee, constructType, constructData, exec));
-}
 #endif // ENABLE(FTL_JIT)
 
 } // extern "C"

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.h (168458 => 168459)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.h	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.h	2014-05-08 02:35:22 UTC (rev 168459)
@@ -126,13 +126,6 @@
 char* JIT_OPERATION operationSwitchString(ExecState*, size_t tableIndex, JSString*);
 void JIT_OPERATION operationNotifyWrite(ExecState*, VariableWatchpointSet*, EncodedJSValue);
 
-#if ENABLE(FTL_JIT)
-// FIXME: Make calls work well. Currently they're a pure regression.
-// https://bugs.webkit.org/show_bug.cgi?id=113621
-EncodedJSValue JIT_OPERATION operationFTLCall(ExecState*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationFTLConstruct(ExecState*) WTF_INTERNAL;
-#endif // ENABLE(FTL_JIT)
-
 // These operations implement the implicitly called ToInt32 and ToBoolean conversions from ES5.
 // This conversion returns an int32_t within a size_t such that the value is zero extended to fill the register.
 size_t JIT_OPERATION dfgConvertJSValueToInt32(ExecState*, EncodedJSValue) WTF_INTERNAL;

Modified: trunk/Source/_javascript_Core/dfg/DFGWorklist.cpp (168458 => 168459)


--- trunk/Source/_javascript_Core/dfg/DFGWorklist.cpp	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/dfg/DFGWorklist.cpp	2014-05-08 02:35:22 UTC (rev 168459)
@@ -37,8 +37,9 @@
 
 namespace JSC { namespace DFG {
 
-Worklist::Worklist()
-    : m_numberOfActiveThreads(0)
+Worklist::Worklist(CString worklistName)
+    : m_threadName(toCString(worklistName, " Worker Thread"))
+    , m_numberOfActiveThreads(0)
 {
 }
 
@@ -60,16 +61,16 @@
     RELEASE_ASSERT(numberOfThreads);
     for (unsigned i = numberOfThreads; i--;) {
         std::unique_ptr<ThreadData> data = ""
-        data->m_identifier = createThread(threadFunction, data.get(), "JSC Compilation Thread");
+        data->m_identifier = createThread(threadFunction, data.get(), m_threadName.data());
         if (relativePriority)
             changeThreadPriority(data->m_identifier, relativePriority);
         m_threads.append(std::move(data));
     }
 }
 
-PassRefPtr<Worklist> Worklist::create(unsigned numberOfThreads, int relativePriority)
+PassRefPtr<Worklist> Worklist::create(CString worklistName, unsigned numberOfThreads, int relativePriority)
 {
-    RefPtr<Worklist> result = adoptRef(new Worklist());
+    RefPtr<Worklist> result = adoptRef(new Worklist(worklistName));
     result->finishCreation(numberOfThreads, relativePriority);
     return result;
 }
@@ -405,7 +406,7 @@
 {
     static std::once_flag initializeGlobalWorklistOnceFlag;
     std::call_once(initializeGlobalWorklistOnceFlag, [] {
-        theGlobalDFGWorklist = Worklist::create(Options::numberOfDFGCompilerThreads(), Options::priorityDeltaOfDFGCompilerThreads()).leakRef();
+        theGlobalDFGWorklist = Worklist::create("DFG Worklist", Options::numberOfDFGCompilerThreads(), Options::priorityDeltaOfDFGCompilerThreads()).leakRef();
     });
     return theGlobalDFGWorklist;
 }
@@ -421,7 +422,7 @@
 {
     static std::once_flag initializeGlobalWorklistOnceFlag;
     std::call_once(initializeGlobalWorklistOnceFlag, [] {
-        theGlobalFTLWorklist = Worklist::create(Options::numberOfFTLCompilerThreads(), Options::priorityDeltaOfFTLCompilerThreads()).leakRef();
+        theGlobalFTLWorklist = Worklist::create("FTL Worklist", Options::numberOfFTLCompilerThreads(), Options::priorityDeltaOfFTLCompilerThreads()).leakRef();
     });
     return theGlobalFTLWorklist;
 }

Modified: trunk/Source/_javascript_Core/dfg/DFGWorklist.h (168458 => 168459)


--- trunk/Source/_javascript_Core/dfg/DFGWorklist.h	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/dfg/DFGWorklist.h	2014-05-08 02:35:22 UTC (rev 168459)
@@ -49,7 +49,7 @@
 
     ~Worklist();
     
-    static PassRefPtr<Worklist> create(unsigned numberOfThreads, int relativePriority = 0);
+    static PassRefPtr<Worklist> create(CString worklistName, unsigned numberOfThreads, int relativePriority = 0);
     
     void enqueue(PassRefPtr<Plan>);
     
@@ -78,7 +78,7 @@
     void dump(PrintStream&) const;
     
 private:
-    Worklist();
+    Worklist(CString worklistName);
     void finishCreation(unsigned numberOfThreads, int);
     
     void runThread(ThreadData*);
@@ -87,7 +87,9 @@
     void removeAllReadyPlansForVM(VM&, Vector<RefPtr<Plan>, 8>&);
 
     void dump(const MutexLocker&, PrintStream&) const;
-
+    
+    CString m_threadName;
+    
     // Used to inform the thread about what work there is left to do.
     Deque<RefPtr<Plan>> m_queue;
     

Modified: trunk/Source/_javascript_Core/heap/CodeBlockSet.cpp (168458 => 168459)


--- trunk/Source/_javascript_Core/heap/CodeBlockSet.cpp	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/heap/CodeBlockSet.cpp	2014-05-08 02:35:22 UTC (rev 168459)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,6 +29,7 @@
 #include "CodeBlock.h"
 #include "JSCInlines.h"
 #include "SlotVisitor.h"
+#include <wtf/CommaPrinter.h>
 
 namespace JSC {
 
@@ -157,5 +158,22 @@
 #endif // ENABLE(GGC)
 }
 
+void CodeBlockSet::dump(PrintStream& out) const
+{
+    CommaPrinter comma;
+    out.print("{old = [");
+    for (CodeBlock* codeBlock : m_oldCodeBlocks)
+        out.print(comma, pointerDump(codeBlock));
+    out.print("], new = [");
+    comma = CommaPrinter();
+    for (CodeBlock* codeBlock : m_newCodeBlocks)
+        out.print(comma, pointerDump(codeBlock));
+    out.print("], currentlyExecuting = [");
+    comma = CommaPrinter();
+    for (CodeBlock* codeBlock : m_currentlyExecuting)
+        out.print(comma, pointerDump(codeBlock));
+    out.print("]}");
+}
+
 } // namespace JSC
 

Modified: trunk/Source/_javascript_Core/heap/CodeBlockSet.h (168458 => 168459)


--- trunk/Source/_javascript_Core/heap/CodeBlockSet.h	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/heap/CodeBlockSet.h	2014-05-08 02:35:22 UTC (rev 168459)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,6 +31,7 @@
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/PassRefPtr.h>
+#include <wtf/PrintStream.h>
 #include <wtf/RefPtr.h>
 
 namespace JSC {
@@ -97,6 +98,8 @@
                 return;
         }
     }
+    
+    void dump(PrintStream&) const;
 
 private:
     void clearMarksForCodeBlocksInRememberedExecutables(const Vector<const JSCell*>&);

Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (168458 => 168459)


--- trunk/Source/_javascript_Core/runtime/Executable.cpp	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp	2014-05-08 02:35:22 UTC (rev 168459)
@@ -57,6 +57,8 @@
     m_jitCodeForConstruct.clear();
     m_jitCodeForCallWithArityCheck = MacroAssemblerCodePtr();
     m_jitCodeForConstructWithArityCheck = MacroAssemblerCodePtr();
+    m_jitCodeForCallWithArityCheckAndPreserveRegs = MacroAssemblerCodePtr();
+    m_jitCodeForConstructWithArityCheckAndPreserveRegs = MacroAssemblerCodePtr();
 #endif
     m_numParametersForCall = NUM_PARAMETERS_NOT_COMPILED;
     m_numParametersForConstruct = NUM_PARAMETERS_NOT_COMPILED;

Modified: trunk/Source/WTF/ChangeLog (168458 => 168459)


--- trunk/Source/WTF/ChangeLog	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/WTF/ChangeLog	2014-05-08 02:35:22 UTC (rev 168459)
@@ -1,3 +1,12 @@
+2014-05-07  Filip Pizlo  <fpi...@apple.com>
+
+        UNREACHABLE_FOR_PLATFORM() is meant to be a release crash.
+
+        Rubber stamped by Mark Hahnenberg..
+
+        * wtf/Assertions.h:
+        (UNREACHABLE_FOR_PLATFORM):
+
 2014-05-06  Alberto Garcia  <be...@igalia.com>
 
         There is no HW_AVAILCPU on FreeBSD, NetBSD, and OpenBSD

Modified: trunk/Source/WTF/wtf/Assertions.h (168458 => 168459)


--- trunk/Source/WTF/wtf/Assertions.h	2014-05-08 01:42:17 UTC (rev 168458)
+++ trunk/Source/WTF/wtf/Assertions.h	2014-05-08 02:35:22 UTC (rev 168459)
@@ -372,7 +372,7 @@
 #pragma clang diagnostic ignored "-Wmissing-noreturn"
 static inline void UNREACHABLE_FOR_PLATFORM()
 {
-    ASSERT_NOT_REACHED();
+    CRASH();
 }
 #pragma clang diagnostic pop
 #else
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to