Title: [232387] trunk/Source/_javascript_Core
- Revision
- 232387
- Author
- utatane....@gmail.com
- Date
- 2018-05-31 21:45:24 -0700 (Thu, 31 May 2018)
Log Message
[Baseline] Store constant directly in emit_op_mov
https://bugs.webkit.org/show_bug.cgi?id=186182
Reviewed by Saam Barati.
In the old code, we first move a constant to a register and store it to the specified address.
But in 64bit JSC, we can directly store a constant to the specified address. This reduces the
generated code size. Since the old code was emitting a constant in a code anyway, this change
never increases the size of the generated code.
* jit/JITInlines.h:
(JSC::JIT::emitGetVirtualRegister):
We remove this obsolete comment. Our OSR relies on the fact that values are stored and loaded
from the stack. If we transfer values in registers without loading values from the stack, it
breaks this assumption.
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_mov):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (232386 => 232387)
--- trunk/Source/_javascript_Core/ChangeLog 2018-06-01 03:30:22 UTC (rev 232386)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-06-01 04:45:24 UTC (rev 232387)
@@ -1,3 +1,24 @@
+2018-05-31 Yusuke Suzuki <utatane....@gmail.com>
+
+ [Baseline] Store constant directly in emit_op_mov
+ https://bugs.webkit.org/show_bug.cgi?id=186182
+
+ Reviewed by Saam Barati.
+
+ In the old code, we first move a constant to a register and store it to the specified address.
+ But in 64bit JSC, we can directly store a constant to the specified address. This reduces the
+ generated code size. Since the old code was emitting a constant in a code anyway, this change
+ never increases the size of the generated code.
+
+ * jit/JITInlines.h:
+ (JSC::JIT::emitGetVirtualRegister):
+ We remove this obsolete comment. Our OSR relies on the fact that values are stored and loaded
+ from the stack. If we transfer values in registers without loading values from the stack, it
+ breaks this assumption.
+
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_mov):
+
2018-05-31 Caio Lima <ticaiol...@gmail.com>
[ESNext][BigInt] Implement support for "=<" and ">=" relational operation
Modified: trunk/Source/_javascript_Core/jit/JITInlines.h (232386 => 232387)
--- trunk/Source/_javascript_Core/jit/JITInlines.h 2018-06-01 03:30:22 UTC (rev 232386)
+++ trunk/Source/_javascript_Core/jit/JITInlines.h 2018-06-01 04:45:24 UTC (rev 232387)
@@ -572,7 +572,6 @@
{
ASSERT(m_bytecodeOffset != std::numeric_limits<unsigned>::max()); // This method should only be called during hot/cold path generation, so that m_bytecodeOffset is set.
- // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
if (m_codeBlock->isConstantRegisterIndex(src)) {
JSValue value = m_codeBlock->getConstant(src);
if (!value.isNumber())
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (232386 => 232387)
--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2018-06-01 03:30:22 UTC (rev 232386)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2018-06-01 04:45:24 UTC (rev 232387)
@@ -57,8 +57,17 @@
int dst = currentInstruction[1].u.operand;
int src = ""
- emitGetVirtualRegister(src, regT0);
- emitPutVirtualRegister(dst);
+ if (m_codeBlock->isConstantRegisterIndex(src)) {
+ JSValue value = m_codeBlock->getConstant(src);
+ if (!value.isNumber())
+ store64(TrustedImm64(JSValue::encode(value)), addressFor(dst));
+ else
+ store64(Imm64(JSValue::encode(value)), addressFor(dst));
+ return;
+ }
+
+ load64(addressFor(src), regT0);
+ store64(regT0, addressFor(dst));
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes