WebKit Bugzilla
Attachment 341732 Details for
Bug 186182
: [Baseline] Store constant directly in emit_op_mov
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186182-20180601131007.patch (text/plain), 3.04 KB, created by
Yusuke Suzuki
on 2018-05-31 21:10:07 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-05-31 21:10:07 PDT
Size:
3.04 KB
patch
obsolete
>Subversion Revision: 232383 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index c034df3646cfb9b74b41d0855784e64958330a41..ada1d20ac15d86d138a384670a80f3bd60d9df3f 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-31 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [Baseline] Store constant directly in emit_op_mov >+ https://bugs.webkit.org/show_bug.cgi?id=186182 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 Saam Barati <sbarati@apple.com> > > JSImmutableButterfly should align its variable storage >diff --git a/Source/JavaScriptCore/jit/JITInlines.h b/Source/JavaScriptCore/jit/JITInlines.h >index 30b0ddde2d70ba627d6089656187ab9c647aaae3..723b73ed35d06c5699a221ec7ab4d558402b33ff 100644 >--- a/Source/JavaScriptCore/jit/JITInlines.h >+++ b/Source/JavaScriptCore/jit/JITInlines.h >@@ -572,7 +572,6 @@ ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, RegisterID dst) > { > 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()) >diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp >index 38621d886e70c4158ecd7a8eaa9f6dc1105cb829..459d1a2db5a1dc1ad0c1b12203ee71fda2bca276 100644 >--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp >+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp >@@ -57,8 +57,17 @@ void JIT::emit_op_mov(Instruction* currentInstruction) > int dst = currentInstruction[1].u.operand; > int src = currentInstruction[2].u.operand; > >- 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)); > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
saam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186182
:
341729
|
341730
| 341732