Title: [91482] trunk/Source/_javascript_Core
Revision
91482
Author
[email protected]
Date
2011-07-21 11:57:57 -0700 (Thu, 21 Jul 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=64964
DFG JIT - Enable support for eval code

Reviewed by Sam Weinig.

This is basically the same as program code, to the JIT!

* bytecode/Opcode.cpp:
* bytecode/Opcode.h:
    - Enable opcodeNames in !NDEBUG builds.
* dfg/DFGOperations.cpp:
    - Fix a bug exposed by eval support, throw correct type error for new.
* runtime/Executable.cpp:
(JSC::EvalExecutable::compileInternal):
    - Enable DFG JIT for eval code.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (91481 => 91482)


--- trunk/Source/_javascript_Core/ChangeLog	2011-07-21 18:45:44 UTC (rev 91481)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-07-21 18:57:57 UTC (rev 91482)
@@ -1,3 +1,21 @@
+2011-07-21  Gavin Barraclough  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=64964
+        DFG JIT - Enable support for eval code
+
+        Reviewed by Sam Weinig.
+
+        This is basically the same as program code, to the JIT!
+
+        * bytecode/Opcode.cpp:
+        * bytecode/Opcode.h:
+            - Enable opcodeNames in !NDEBUG builds.
+        * dfg/DFGOperations.cpp:
+            - Fix a bug exposed by eval support, throw correct type error for new.
+        * runtime/Executable.cpp:
+        (JSC::EvalExecutable::compileInternal):
+            - Enable DFG JIT for eval code.
+
 2011-07-20  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r91380.

Modified: trunk/Source/_javascript_Core/bytecode/Opcode.cpp (91481 => 91482)


--- trunk/Source/_javascript_Core/bytecode/Opcode.cpp	2011-07-21 18:45:44 UTC (rev 91481)
+++ trunk/Source/_javascript_Core/bytecode/Opcode.cpp	2011-07-21 18:57:57 UTC (rev 91482)
@@ -39,7 +39,7 @@
 
 namespace JSC {
 
-#if ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS)
+#if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS)
 
 const char* const opcodeNames[] = {
 #define OPCODE_NAME_ENTRY(opcode, size) #opcode,

Modified: trunk/Source/_javascript_Core/bytecode/Opcode.h (91481 => 91482)


--- trunk/Source/_javascript_Core/bytecode/Opcode.h	2011-07-21 18:45:44 UTC (rev 91481)
+++ trunk/Source/_javascript_Core/bytecode/Opcode.h	2011-07-21 18:57:57 UTC (rev 91482)
@@ -234,7 +234,7 @@
     typedef OpcodeID Opcode;
 #endif
 
-#if ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS)
+#if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS)
 
 #define PADDING_STRING "                                "
 #define PADDING_STRING_LENGTH static_cast<unsigned>(strlen(PADDING_STRING))

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (91481 => 91482)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2011-07-21 18:45:44 UTC (rev 91481)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2011-07-21 18:57:57 UTC (rev 91482)
@@ -482,32 +482,34 @@
         }
     
         ASSERT(callType == CallTypeNone);
-    } else {
-        ASSERT(kind == CodeForConstruct);
+        exec->globalData().exception = createNotAFunctionError(exec, callee);
+        return 0;
+    }
+
+    ASSERT(kind == CodeForConstruct);
+    
+    ConstructData constructData;
+    ConstructType constructType = getConstructData(callee, constructData);
+    
+    ASSERT(constructType != ConstructTypeJS);
+    
+    if (constructType == ConstructTypeHost) {
+        if (!globalData->interpreter->registerFile().grow(execCallee->registers())) {
+            globalData->exception = createStackOverflowError(exec);
+            return 0;
+        }
         
-        ConstructData constructData;
-        ConstructType constructType = getConstructData(callee, constructData);
+        execCallee->setScopeChain(exec->scopeChain());
         
-        ASSERT(constructType != ConstructTypeJS);
+        globalData->hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee));
         
-        if (constructType == ConstructTypeHost) {
-            if (!globalData->interpreter->registerFile().grow(execCallee->registers())) {
-                globalData->exception = createStackOverflowError(exec);
-                return 0;
-            }
-            
-            execCallee->setScopeChain(exec->scopeChain());
-            
-            globalData->hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee));
-            
-            if (globalData->exception)
-                return 0;
-            return reinterpret_cast<void*>(getHostCallReturnValue);
-        }
-        
-        ASSERT(constructType == ConstructTypeNone);
+        if (globalData->exception)
+            return 0;
+        return reinterpret_cast<void*>(getHostCallReturnValue);
     }
-    exec->globalData().exception = createNotAFunctionError(exec, callee);
+    
+    ASSERT(constructType == ConstructTypeNone);
+    exec->globalData().exception = createNotAConstructorError(exec, callee);
     return 0;
 }
 

Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (91481 => 91482)


--- trunk/Source/_javascript_Core/runtime/Executable.cpp	2011-07-21 18:45:44 UTC (rev 91481)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp	2011-07-21 18:57:57 UTC (rev 91482)
@@ -189,7 +189,9 @@
 
 #if ENABLE(JIT)
     if (exec->globalData().canUseJIT()) {
-        m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, m_evalCodeBlock.get());
+        bool dfgCompiled = tryDFGCompile(exec, m_evalCodeBlock.get(), m_jitCodeForCall);
+        if (!dfgCompiled)
+            m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, m_evalCodeBlock.get());
 #if !ENABLE(OPCODE_SAMPLING)
         if (!BytecodeGenerator::dumpsGeneratedCode())
             m_evalCodeBlock->discardBytecode();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to