Title: [189444] trunk/Source/_javascript_Core
- Revision
- 189444
- Author
- commit-qu...@webkit.org
- Date
- 2015-09-06 07:38:12 -0700 (Sun, 06 Sep 2015)
Log Message
Simplify JIT::emit_op_mod()
https://bugs.webkit.org/show_bug.cgi?id=148908
Patch by Sukolsak Sakshuwong <sukol...@gmail.com> on 2015-09-06
Reviewed by Michael Saboff.
The IDIV instruction on x86 divides the value in the EDX:EAX registers
by the source operand and stores the quotient in EAX and the remainder
in EDX. Therefore, we store the values that we don't want to be
overwritten by IDIV in registers that are not EAX or EDX. This patch
makes the intention clearer and makes the code easier to read.
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_mod):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (189443 => 189444)
--- trunk/Source/_javascript_Core/ChangeLog 2015-09-06 06:30:44 UTC (rev 189443)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-09-06 14:38:12 UTC (rev 189444)
@@ -1,3 +1,19 @@
+2015-09-06 Sukolsak Sakshuwong <sukol...@gmail.com>
+
+ Simplify JIT::emit_op_mod()
+ https://bugs.webkit.org/show_bug.cgi?id=148908
+
+ Reviewed by Michael Saboff.
+
+ The IDIV instruction on x86 divides the value in the EDX:EAX registers
+ by the source operand and stores the quotient in EAX and the remainder
+ in EDX. Therefore, we store the values that we don't want to be
+ overwritten by IDIV in registers that are not EAX or EDX. This patch
+ makes the intention clearer and makes the code easier to read.
+
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emit_op_mod):
+
2015-09-05 Mark Lam <mark....@apple.com>
Fix JSDollarVMPrototype after r189160.
Modified: trunk/Source/_javascript_Core/jit/JITArithmetic.cpp (189443 => 189444)
--- trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2015-09-06 06:30:44 UTC (rev 189443)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2015-09-06 14:38:12 UTC (rev 189444)
@@ -611,19 +611,11 @@
int op2 = currentInstruction[3].u.operand;
// Make sure registers are correct for x86 IDIV instructions.
-#if CPU(X86)
- auto edx = regT1;
- auto ecx = regT2;
-#elif OS(WINDOWS)
- auto edx = regT1;
- auto ecx = regT5;
-#else
- auto edx = regT2;
- auto ecx = regT3;
-#endif
ASSERT(regT0 == X86Registers::eax);
- ASSERT(edx == X86Registers::edx);
- ASSERT(ecx == X86Registers::ecx);
+ auto edx = X86Registers::edx;
+ auto ecx = X86Registers::ecx;
+ ASSERT(regT4 != edx);
+ ASSERT(regT4 != ecx);
emitGetVirtualRegisters(op1, regT4, op2, ecx);
emitJumpSlowCaseIfNotImmediateInteger(regT4);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes