Title: [96419] trunk/Source/_javascript_Core
Revision
96419
Author
[email protected]
Date
2011-09-30 13:36:08 -0700 (Fri, 30 Sep 2011)

Log Message

Fix bug in getHostCallReturnValue of DFG JIT on X86
https://bugs.webkit.org/show_bug.cgi?id=69133

Patch by Yuqiang Xian <[email protected]> on 2011-09-30
Reviewed by Gavin Barraclough.

We need to insert the additional argument in the stack slot before
return address instead of simply pushing it afterwards.
Also getHostCallReturnValue* should be attributed as stdcall
to make the stack cleaned up by the callee.

* dfg/DFGOperations.cpp:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (96418 => 96419)


--- trunk/Source/_javascript_Core/ChangeLog	2011-09-30 20:22:20 UTC (rev 96418)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-09-30 20:36:08 UTC (rev 96419)
@@ -1,3 +1,17 @@
+2011-09-30  Yuqiang Xian  <[email protected]>
+
+        Fix bug in getHostCallReturnValue of DFG JIT on X86
+        https://bugs.webkit.org/show_bug.cgi?id=69133
+
+        Reviewed by Gavin Barraclough.
+
+        We need to insert the additional argument in the stack slot before
+        return address instead of simply pushing it afterwards.
+        Also getHostCallReturnValue* should be attributed as stdcall
+        to make the stack cleaned up by the callee.
+
+        * dfg/DFGOperations.cpp:
+
 2011-09-30  Pierre Rossi  <[email protected]>
 
         [Qt] wtf header files are unknown to Qt Creator

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (96418 => 96419)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2011-09-30 20:22:20 UTC (rev 96418)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2011-09-30 20:36:08 UTC (rev 96419)
@@ -532,8 +532,8 @@
     return JSValue::strictEqual(exec, JSValue::decode(encodedOp1), JSValue::decode(encodedOp2));
 }
 
-EncodedJSValue getHostCallReturnValue();
-EncodedJSValue getHostCallReturnValueWithExecState(ExecState*);
+EncodedJSValue DFG_OPERATION getHostCallReturnValue();
+EncodedJSValue DFG_OPERATION getHostCallReturnValueWithExecState(ExecState*);
 
 #if CPU(X86_64)
 asm (
@@ -548,12 +548,15 @@
 ".globl " SYMBOL_STRING(getHostCallReturnValue) "\n"
 SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
     "mov -40(%edi), %edi\n"
-    "push %edi\n"
+    "mov (%esp), %ecx\n"
+    "mov %edi, (%esp)\n"
+    "lea -4(%esp), %esp\n"
+    "mov %ecx, (%esp)\n"
     "jmp " SYMBOL_STRING(getHostCallReturnValueWithExecState) "\n"
 );
 #endif
 
-EncodedJSValue getHostCallReturnValueWithExecState(ExecState* exec)
+EncodedJSValue DFG_OPERATION getHostCallReturnValueWithExecState(ExecState* exec)
 {
     return JSValue::encode(exec->globalData().hostCallReturnValue);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to