<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[277716] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/277716">277716</a></dd>
<dt>Author</dt> <dd>ross.kirsling@sony.com</dd>
<dt>Date</dt> <dd>2021-05-18 22:21:57 -0700 (Tue, 18 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[JSC] Prune CommonSlowPaths of JITPropertyAccess functions
https://bugs.webkit.org/show_bug.cgi?id=225953

Reviewed by Mark Lam.

A few bytecode operations with slow paths in JITPropertyAccess appear to have either redundant or unnecessary
"common" slow paths; namely, get_private_name and del_by_val already have LLInt slow paths, while in_by_id
and get_by_id_with_this can have their "common" slow path moved to be LLInt-specific.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
* runtime/CommonSlowPaths.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathsh">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathsh">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (277715 => 277716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2021-05-19 04:21:12 UTC (rev 277715)
+++ trunk/Source/JavaScriptCore/ChangeLog       2021-05-19 05:21:57 UTC (rev 277716)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2021-05-18  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [JSC] Prune CommonSlowPaths of JITPropertyAccess functions
+        https://bugs.webkit.org/show_bug.cgi?id=225953
+
+        Reviewed by Mark Lam.
+
+        A few bytecode operations with slow paths in JITPropertyAccess appear to have either redundant or unnecessary
+        "common" slow paths; namely, get_private_name and del_by_val already have LLInt slow paths, while in_by_id
+        and get_by_id_with_this can have their "common" slow path moved to be LLInt-specific.
+
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter.asm:
+        * runtime/CommonSlowPaths.cpp:
+        * runtime/CommonSlowPaths.h:
+
</ins><span class="cx"> 2021-05-18  Robin Morisset  <rmorisset@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make AirAllocateRegistersByGraphColoring use less memory
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (277715 => 277716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp     2021-05-19 04:21:12 UTC (rev 277715)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2021-05-19 05:21:57 UTC (rev 277716)
</span><span class="lines">@@ -692,6 +692,17 @@
</span><span class="cx">     LLINT_RETURN_PROFILED(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LLINT_SLOW_PATH_DECL(slow_path_get_by_id_with_this)
+{
+    LLINT_BEGIN();
+    auto bytecode = pc->as<OpGetByIdWithThis>();
+    const Identifier& ident = codeBlock->identifier(bytecode.m_property);
+    JSValue baseValue = getOperand(callFrame, bytecode.m_base);
+    JSValue thisVal = getOperand(callFrame, bytecode.m_thisValue);
+    PropertySlot slot(thisVal, PropertySlot::PropertySlot::InternalMethodType::Get);
+    JSValue result = baseValue.get(globalObject, ident, slot);
+    LLINT_RETURN_PROFILED(result);
+}
</ins><span class="cx"> 
</span><span class="cx"> static void setupGetByIdPrototypeCache(JSGlobalObject* globalObject, VM& vm, CodeBlock* codeBlock, const Instruction* pc, GetByIdModeMetadata& metadata, JSCell* baseCell, PropertySlot& slot, const Identifier& ident)
</span><span class="cx"> {
</span><span class="lines">@@ -1402,6 +1413,18 @@
</span><span class="cx">     LLINT_RETURN(jsBoolean(couldDelete));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LLINT_SLOW_PATH_DECL(slow_path_in_by_id)
+{
+    LLINT_BEGIN();
+
+    auto bytecode = pc->as<OpInById>();
+    JSValue baseValue = getOperand(callFrame, bytecode.m_base);
+    if (!baseValue.isObject())
+        LLINT_THROW(createInvalidInParameterError(globalObject, baseValue));
+
+    LLINT_RETURN(jsBoolean(asObject(baseValue)->hasProperty(globalObject, codeBlock->identifier(bytecode.m_property))));
+}
+
</ins><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_put_getter_by_id)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h (277715 => 277716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h       2021-05-19 04:21:12 UTC (rev 277715)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h  2021-05-19 05:21:57 UTC (rev 277716)
</span><span class="lines">@@ -69,7 +69,9 @@
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_try_get_by_id);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id_direct);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id);
</span><ins>+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id_with_this);
</ins><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_id);
</span><ins>+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_in_by_id);
</ins><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_id);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_val);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_private_name);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (277715 => 277716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2021-05-19 04:21:12 UTC (rev 277715)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm   2021-05-19 05:21:57 UTC (rev 277716)
</span><span class="lines">@@ -1994,7 +1994,6 @@
</span><span class="cx"> slowPathOp(define_data_property)
</span><span class="cx"> slowPathOp(enumerator_generic_pname)
</span><span class="cx"> slowPathOp(enumerator_structure_pname)
</span><del>-slowPathOp(get_by_id_with_this)
</del><span class="cx"> slowPathOp(get_by_val_with_this)
</span><span class="cx"> slowPathOp(get_direct_pname)
</span><span class="cx"> slowPathOp(get_enumerable_length)
</span><span class="lines">@@ -2011,7 +2010,6 @@
</span><span class="cx">     slowPathOp(get_prototype_of)
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-slowPathOp(in_by_id)
</del><span class="cx"> slowPathOp(in_by_val)
</span><span class="cx"> slowPathOp(is_callable)
</span><span class="cx"> slowPathOp(is_constructor)
</span><span class="lines">@@ -2043,6 +2041,7 @@
</span><span class="cx">     end)
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+llintSlowPathOp(in_by_id)
</ins><span class="cx"> llintSlowPathOp(del_by_id)
</span><span class="cx"> llintSlowPathOp(del_by_val)
</span><span class="cx"> llintSlowPathOp(instanceof)
</span><span class="lines">@@ -2069,6 +2068,7 @@
</span><span class="cx"> llintSlowPathOp(super_sampler_end)
</span><span class="cx"> llintSlowPathOp(throw)
</span><span class="cx"> llintSlowPathOp(try_get_by_id)
</span><ins>+llintSlowPathOp(get_by_id_with_this)
</ins><span class="cx"> 
</span><span class="cx"> llintOp(op_switch_string, unused, macro (unused, unused, unused)
</span><span class="cx">     callSlowPath(_llint_slow_path_switch_string)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (277715 => 277716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp  2021-05-19 04:21:12 UTC (rev 277715)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp     2021-05-19 05:21:57 UTC (rev 277716)
</span><span class="lines">@@ -838,18 +838,6 @@
</span><span class="cx">     RETURN(jsBoolean(CommonSlowPaths::opInByVal(globalObject, GET_C(bytecode.m_base).jsValue(), GET_C(bytecode.m_property).jsValue(), &metadata.m_arrayProfile)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC_DEFINE_COMMON_SLOW_PATH(slow_path_in_by_id)
-{
-    BEGIN();
-
-    auto bytecode = pc->as<OpInById>();
-    JSValue baseValue = GET_C(bytecode.m_base).jsValue();
-    if (!baseValue.isObject())
-        THROW(createInvalidInParameterError(globalObject, baseValue));
-
-    RETURN(jsBoolean(asObject(baseValue)->hasProperty(globalObject, codeBlock->identifier(bytecode.m_property))));
-}
-
</del><span class="cx"> template<OpcodeSize width>
</span><span class="cx"> ALWAYS_INLINE SlowPathReturnType iteratorOpenTryFastImpl(VM& vm, JSGlobalObject* globalObject, CodeBlock* codeBlock, CallFrame* callFrame, const Instruction* pc)
</span><span class="cx"> {
</span><span class="lines">@@ -954,35 +942,6 @@
</span><span class="cx">     return iteratorNextTryFastImpl<Wide32>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC_DEFINE_COMMON_SLOW_PATH(slow_path_del_by_val)
-{
-    BEGIN();
-    auto bytecode = pc->as<OpDelByVal>();
-    JSValue baseValue = GET_C(bytecode.m_base).jsValue();
-    JSObject* baseObject = baseValue.toObject(globalObject);
-    CHECK_EXCEPTION();
-    
-    JSValue subscript = GET_C(bytecode.m_property).jsValue();
-    
-    bool couldDelete;
-    
-    uint32_t i;
-    if (subscript.getUInt32(i))
-        couldDelete = baseObject->methodTable(vm)->deletePropertyByIndex(baseObject, globalObject, i);
-    else {
-        CHECK_EXCEPTION();
-        auto property = subscript.toPropertyKey(globalObject);
-        CHECK_EXCEPTION();
-        couldDelete = JSCell::deleteProperty(baseObject, globalObject, property);
-    }
-    CHECK_EXCEPTION();
-    
-    if (!couldDelete && bytecode.m_ecmaMode.isStrict())
-        THROW(createTypeError(globalObject, UnableToDeletePropertyError));
-    
-    RETURN(jsBoolean(couldDelete));
-}
-
</del><span class="cx"> JSC_DEFINE_COMMON_SLOW_PATH(slow_path_strcat)
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="lines">@@ -1275,18 +1234,6 @@
</span><span class="cx">     RETURN(constructArray(globalObject, structure, argumentsToCopyRegion, arraySize));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC_DEFINE_COMMON_SLOW_PATH(slow_path_get_by_id_with_this)
-{
-    BEGIN();
-    auto bytecode = pc->as<OpGetByIdWithThis>();
-    const Identifier& ident = codeBlock->identifier(bytecode.m_property);
-    JSValue baseValue = GET_C(bytecode.m_base).jsValue();
-    JSValue thisVal = GET_C(bytecode.m_thisValue).jsValue();
-    PropertySlot slot(thisVal, PropertySlot::PropertySlot::InternalMethodType::Get);
-    JSValue result = baseValue.get(globalObject, ident, slot);
-    RETURN_PROFILED(result);
-}
-
</del><span class="cx"> JSC_DEFINE_COMMON_SLOW_PATH(slow_path_get_by_val_with_this)
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h (277715 => 277716)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h    2021-05-19 04:21:12 UTC (rev 277715)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h       2021-05-19 05:21:57 UTC (rev 277716)
</span><span class="lines">@@ -251,9 +251,7 @@
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_typeof_is_function);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_is_callable);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_is_constructor);
</span><del>-JSC_DECLARE_COMMON_SLOW_PATH(slow_path_in_by_id);
</del><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_in_by_val);
</span><del>-JSC_DECLARE_COMMON_SLOW_PATH(slow_path_del_by_val);
</del><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_strcat);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_to_primitive);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_to_property_key);
</span><span class="lines">@@ -278,9 +276,7 @@
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_create_generator);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_create_async_generator);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_create_rest);
</span><del>-JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_by_id_with_this);
</del><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_by_val_with_this);
</span><del>-JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_private_name);
</del><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_get_prototype_of);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_put_by_id_with_this);
</span><span class="cx"> JSC_DECLARE_COMMON_SLOW_PATH(slow_path_put_by_val_with_this);
</span></span></pre>
</div>
</div>

</body>
</html>