Title: [160499] branches/jsCStack/Source/_javascript_Core
Revision
160499
Author
[email protected]
Date
2013-12-12 11:37:21 -0800 (Thu, 12 Dec 2013)

Log Message

CStack Branch: Change the disabling of DFG OSR entry to be based on an option
https://bugs.webkit.org/show_bug.cgi?id=125645

Rubber stamped by Filip Pizlo.

Added a new enableOSREntryToDFG option and set the default value to false.
If the option is false, prepareOSREntry() will return 0 which disables OSR
entry, as the return value is the address to jump to or 0 if we can't OSR enter.
Restored the code in emitEnterOptimizationCheck() and emitSlow_op_loop_hint()
that checks the exit value from operationOptimize().

Per a discussion with Filip, removed the enableOSREntryInLoops option and
associated use.  All OSR entry to the DFG is now controlled with the new option.

* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_loop_hint):
(JSC::JIT::emitSlow_op_loop_hint):
* runtime/Options.h:

Modified Paths

Diff

Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (160498 => 160499)


--- branches/jsCStack/Source/_javascript_Core/ChangeLog	2013-12-12 19:22:55 UTC (rev 160498)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog	2013-12-12 19:37:21 UTC (rev 160499)
@@ -1,3 +1,28 @@
+2013-12-12  Michael Saboff  <[email protected]>
+
+        CStack Branch: Change the disabling of DFG OSR entry to be based on an option
+        https://bugs.webkit.org/show_bug.cgi?id=125645
+
+        Rubber stamped by Filip Pizlo.
+
+        Added a new enableOSREntryToDFG option and set the default value to false.
+        If the option is false, prepareOSREntry() will return 0 which disables OSR
+        entry, as the return value is the address to jump to or 0 if we can't OSR enter.
+        Restored the code in emitEnterOptimizationCheck() and emitSlow_op_loop_hint()
+        that checks the exit value from operationOptimize().
+
+        Per a discussion with Filip, removed the enableOSREntryInLoops option and
+        associated use.  All OSR entry to the DFG is now controlled with the new option.
+
+        * dfg/DFGOSREntry.cpp:
+        (JSC::DFG::prepareOSREntry):
+        * jit/JIT.cpp:
+        (JSC::JIT::emitEnterOptimizationCheck):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_loop_hint):
+        (JSC::JIT::emitSlow_op_loop_hint):
+        * runtime/Options.h:
+
 2013-12-12  Mark Lam  <[email protected]>
 
         Rename returnFromJavaScript to handleUncaughtException.

Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGOSREntry.cpp (160498 => 160499)


--- branches/jsCStack/Source/_javascript_Core/dfg/DFGOSREntry.cpp	2013-12-12 19:22:55 UTC (rev 160498)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGOSREntry.cpp	2013-12-12 19:37:21 UTC (rev 160499)
@@ -44,7 +44,10 @@
     ASSERT(codeBlock->alternative());
     ASSERT(codeBlock->alternative()->jitType() == JITCode::BaselineJIT);
     ASSERT(!codeBlock->jitCodeMap());
-    
+
+    if (!Options::enableOSREntryToDFG())
+        return 0;
+
     if (Options::verboseOSR()) {
         dataLog(
             "DFG OSR in ", *codeBlock->alternative(), " -> ", *codeBlock,

Modified: branches/jsCStack/Source/_javascript_Core/jit/JIT.cpp (160498 => 160499)


--- branches/jsCStack/Source/_javascript_Core/jit/JIT.cpp	2013-12-12 19:22:55 UTC (rev 160498)
+++ branches/jsCStack/Source/_javascript_Core/jit/JIT.cpp	2013-12-12 19:37:21 UTC (rev 160499)
@@ -99,11 +99,9 @@
     skipOptimize.append(branchAdd32(Signed, TrustedImm32(Options::executionCounterIncrementForEntry()), AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
     ASSERT(!m_bytecodeOffset);
     callOperation(operationOptimize, m_bytecodeOffset);
-#if 0 // FIXME: CStack - need to fix OSR entry
     skipOptimize.append(branchTestPtr(Zero, returnValueGPR));
     jump(returnValueGPR);
     skipOptimize.link(this);
-#endif
 }
 #endif
 

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITOpcodes.cpp (160498 => 160499)


--- branches/jsCStack/Source/_javascript_Core/jit/JITOpcodes.cpp	2013-12-12 19:22:55 UTC (rev 160498)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITOpcodes.cpp	2013-12-12 19:37:21 UTC (rev 160499)
@@ -1093,20 +1093,8 @@
 {
     // Emit the JIT optimization check: 
     if (canBeOptimized()) {
-        if (Options::enableOSREntryInLoops()) {
-            addSlowCase(branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
-                AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
-        } else {
-            // Add with saturation.
-            move(TrustedImmPtr(m_codeBlock->addressOfJITExecuteCounter()), regT3);
-            load32(regT3, regT2);
-            Jump dontAdd = branch32(
-                GreaterThan, regT2,
-                TrustedImm32(std::numeric_limits<int32_t>::max() - Options::executionCounterIncrementForLoop()));
-            add32(TrustedImm32(Options::executionCounterIncrementForLoop()), regT2);
-            store32(regT2, regT3);
-            dontAdd.link(this);
-        }
+        addSlowCase(branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
+            AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
     }
 
     // Emit the watchdog timer check:
@@ -1118,15 +1106,13 @@
 {
 #if ENABLE(DFG_JIT)
     // Emit the slow path for the JIT optimization check:
-    if (canBeOptimized() && Options::enableOSREntryInLoops()) {
+    if (canBeOptimized()) {
         linkSlowCase(iter);
         
         callOperation(operationOptimize, m_bytecodeOffset);
-#if 0 // FIXME: CStack - need to fix OSR entry
         Jump noOptimizedEntry = branchTestPtr(Zero, returnValueGPR);
         jump(returnValueGPR);
         noOptimizedEntry.link(this);
-#endif
 
         emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
     }

Modified: branches/jsCStack/Source/_javascript_Core/runtime/Options.h (160498 => 160499)


--- branches/jsCStack/Source/_javascript_Core/runtime/Options.h	2013-12-12 19:22:55 UTC (rev 160498)
+++ branches/jsCStack/Source/_javascript_Core/runtime/Options.h	2013-12-12 19:37:21 UTC (rev 160499)
@@ -120,7 +120,7 @@
     v(bool, reportCompileTimes, false) \
     v(bool, verboseCFA, false) \
     \
-    v(bool, enableOSREntryInLoops, true) \
+    v(bool, enableOSREntryToDFG, false) \
     \
     v(bool, useExperimentalFTL, false) \
     v(bool, useFTLTBAA, true) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to