Title: [229852] trunk/Source/_javascript_Core
Revision
229852
Author
[email protected]
Date
2018-03-22 08:40:57 -0700 (Thu, 22 Mar 2018)

Log Message

[JSC] Drop op_put_by_index
https://bugs.webkit.org/show_bug.cgi?id=183899

Reviewed by Mark Lam.

This patch drops op_put_by_index.

1. This functionality can be just covered by direct put_by_val.
2. put_by_index is not well optimized. It is just calling a C
function. And it does not have DFG handling.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPutByIndex): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
(JSC::ArrayPatternNode::emitDirectBinding):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_index): Deleted.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_by_index): Deleted.
* llint/LLIntSlowPaths.cpp:
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (229851 => 229852)


--- trunk/Source/_javascript_Core/ChangeLog	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-03-22 15:40:57 UTC (rev 229852)
@@ -1,3 +1,39 @@
+2018-03-22  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Drop op_put_by_index
+        https://bugs.webkit.org/show_bug.cgi?id=183899
+
+        Reviewed by Mark Lam.
+
+        This patch drops op_put_by_index.
+
+        1. This functionality can be just covered by direct put_by_val.
+        2. put_by_index is not well optimized. It is just calling a C
+        function. And it does not have DFG handling.
+
+        * bytecode/BytecodeDumper.cpp:
+        (JSC::BytecodeDumper<Block>::dumpBytecode):
+        * bytecode/BytecodeList.json:
+        * bytecode/BytecodeUseDef.h:
+        (JSC::computeUsesForBytecodeOffset):
+        (JSC::computeDefsForBytecodeOffset):
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::emitPutByIndex): Deleted.
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::ArrayNode::emitBytecode):
+        (JSC::ArrayPatternNode::emitDirectBinding):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompileMainPass):
+        * jit/JIT.h:
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::emit_op_put_by_index): Deleted.
+        * jit/JITPropertyAccess32_64.cpp:
+        (JSC::JIT::emit_op_put_by_index): Deleted.
+        * llint/LLIntSlowPaths.cpp:
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter.asm:
+
 2018-03-22  Michael Saboff  <[email protected]>
 
         Race Condition in arrayProtoFuncReverse() causes wrong results or crash

Modified: trunk/Source/_javascript_Core/bytecode/BytecodeDumper.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/bytecode/BytecodeDumper.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeDumper.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -1187,14 +1187,6 @@
         out.printf("%s, %s, %s", registerName(r0).data(), registerName(r1).data(), registerName(r2).data());
         break;
     }
-    case op_put_by_index: {
-        int r0 = (++it)->u.operand;
-        unsigned n0 = (++it)->u.operand;
-        int r1 = (++it)->u.operand;
-        printLocationAndOp(out, location, it, "put_by_index");
-        out.printf("%s, %u, %s", registerName(r0).data(), n0, registerName(r1).data());
-        break;
-    }
     case op_jmp: {
         int offset = (++it)->u.operand;
         printLocationAndOp(out, location, it, "jmp");

Modified: trunk/Source/_javascript_Core/bytecode/BytecodeList.json (229851 => 229852)


--- trunk/Source/_javascript_Core/bytecode/BytecodeList.json	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeList.json	2018-03-22 15:40:57 UTC (rev 229852)
@@ -96,7 +96,6 @@
             { "name" : "op_put_by_val_with_this", "length" : 5 },
             { "name" : "op_put_by_val_direct", "length" : 5 },
             { "name" : "op_del_by_val", "length" : 4 },
-            { "name" : "op_put_by_index", "length" : 4 },
             { "name" : "op_put_getter_by_id", "length" : 5 },
             { "name" : "op_put_setter_by_id", "length" : 5 },
             { "name" : "op_put_getter_setter_by_id", "length" : 6 },

Modified: trunk/Source/_javascript_Core/bytecode/BytecodeUseDef.h (229851 => 229852)


--- trunk/Source/_javascript_Core/bytecode/BytecodeUseDef.h	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeUseDef.h	2018-03-22 15:40:57 UTC (rev 229852)
@@ -102,7 +102,6 @@
         functor(codeBlock, instruction, opcodeID, instruction[3].u.operand);
         return;
     }
-    case op_put_by_index:
     case op_put_by_id:
     case op_put_to_scope:
     case op_put_to_arguments: {
@@ -364,7 +363,6 @@
     case op_put_setter_by_val:
     case op_put_by_val:
     case op_put_by_val_direct:
-    case op_put_by_index:
     case op_define_data_property:
     case op_define_accessor_property:
     case op_profile_type:

Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -2951,15 +2951,6 @@
     return dst;
 }
 
-RegisterID* BytecodeGenerator::emitPutByIndex(RegisterID* base, unsigned index, RegisterID* value)
-{
-    emitOpcode(op_put_by_index);
-    instructions().append(base->index());
-    instructions().append(index);
-    instructions().append(value->index());
-    return value;
-}
-
 void BytecodeGenerator::emitSuperSamplerBegin()
 {
     emitOpcode(op_super_sampler_begin);

Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h (229851 => 229852)


--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h	2018-03-22 15:40:57 UTC (rev 229852)
@@ -698,7 +698,6 @@
         RegisterID* emitPutByVal(RegisterID* base, RegisterID* thisValue, RegisterID* property, RegisterID* value);
         RegisterID* emitDirectPutByVal(RegisterID* base, RegisterID* property, RegisterID* value);
         RegisterID* emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
-        RegisterID* emitPutByIndex(RegisterID* base, unsigned index, RegisterID* value);
 
         void emitSuperSamplerBegin();
         void emitSuperSamplerEnd();

Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -417,9 +417,11 @@
     for (; n; n = n->next()) {
         if (n->value()->isSpreadExpression())
             goto handleSpread;
-        RegisterID* value = generator.emitNode(n->value());
+        RefPtr<RegisterID> value = generator.emitNode(n->value());
         length += n->elision();
-        generator.emitPutByIndex(array.get(), length++, value);
+
+        RefPtr<RegisterID> index = generator.emitLoad(nullptr, jsNumber(length++));
+        generator.emitDirectPutByVal(array.get(), index.get(), value.get());
     }
 
     if (m_elision) {
@@ -4141,8 +4143,10 @@
         generator.emitNode(registers.last().get(), elements[i]);
         if (m_targetPatterns[i].defaultValue)
             assignDefaultValueIfUndefined(generator, registers.last().get(), m_targetPatterns[i].defaultValue);
-        if (resultRegister)
-            generator.emitPutByIndex(resultRegister.get(), i, registers.last().get());
+        if (resultRegister) {
+            RefPtr<RegisterID> index = generator.emitLoad(nullptr, jsNumber(i));
+            generator.emitDirectPutByVal(resultRegister.get(), index.get(), registers.last().get());
+        }
     }
     
     for (size_t i = 0; i < m_targetPatterns.size(); i++) {

Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/jit/JIT.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -391,7 +391,6 @@
         DEFINE_OP(op_profile_control_flow)
         DEFINE_OP(op_get_parent_scope)
         DEFINE_OP(op_put_by_id)
-        DEFINE_OP(op_put_by_index)
         case op_put_by_val_direct:
         DEFINE_OP(op_put_by_val)
         DEFINE_OP(op_put_getter_by_id)

Modified: trunk/Source/_javascript_Core/jit/JIT.h (229851 => 229852)


--- trunk/Source/_javascript_Core/jit/JIT.h	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/jit/JIT.h	2018-03-22 15:40:57 UTC (rev 229852)
@@ -558,7 +558,6 @@
         void emit_op_profile_control_flow(Instruction*);
         void emit_op_get_parent_scope(Instruction*);
         void emit_op_put_by_id(Instruction*);
-        void emit_op_put_by_index(Instruction*);
         void emit_op_put_by_val(Instruction*);
         void emit_op_put_getter_by_id(Instruction*);
         void emit_op_put_setter_by_id(Instruction*);

Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -499,13 +499,6 @@
     m_byValInstructionIndex++;
 }
 
-void JIT::emit_op_put_by_index(Instruction* currentInstruction)
-{
-    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
-    emitGetVirtualRegister(currentInstruction[3].u.operand, regT1);
-    callOperation(operationPutByIndex, regT0, currentInstruction[2].u.operand, regT1);
-}
-
 void JIT::emit_op_put_getter_by_id(Instruction* currentInstruction)
 {
     emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);

Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -46,17 +46,6 @@
 
 namespace JSC {
     
-void JIT::emit_op_put_by_index(Instruction* currentInstruction)
-{
-    int base = currentInstruction[1].u.operand;
-    int property = currentInstruction[2].u.operand;
-    int value = currentInstruction[3].u.operand;
-
-    emitLoad(base, regT1, regT0);
-    emitLoad(value, regT3, regT2);
-    callOperation(operationPutByIndex, JSValueRegs(regT1, regT0), property, JSValueRegs(regT3, regT2));
-}
-
 void JIT::emit_op_put_getter_by_id(Instruction* currentInstruction)
 {
     int base = currentInstruction[1].u.operand;

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (229851 => 229852)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2018-03-22 15:40:57 UTC (rev 229852)
@@ -995,15 +995,6 @@
     LLINT_RETURN(jsBoolean(couldDelete));
 }
 
-LLINT_SLOW_PATH_DECL(slow_path_put_by_index)
-{
-    LLINT_BEGIN();
-    JSValue arrayValue = LLINT_OP_C(1).jsValue();
-    ASSERT(isJSArray(arrayValue));
-    asArray(arrayValue)->putDirectIndex(exec, pc[2].u.operand, LLINT_OP_C(3).jsValue());
-    LLINT_END();
-}
-
 LLINT_SLOW_PATH_DECL(slow_path_put_getter_by_id)
 {
     LLINT_BEGIN();

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h (229851 => 229852)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h	2018-03-22 15:40:57 UTC (rev 229852)
@@ -77,7 +77,6 @@
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_val);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_val_direct);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_val);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_index);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_getter_by_id);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_setter_by_id);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_getter_setter_by_id);

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm (229851 => 229852)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2018-03-22 15:26:38 UTC (rev 229851)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2018-03-22 15:40:57 UTC (rev 229852)
@@ -1520,12 +1520,6 @@
     dispatch(constexpr op_del_by_val_length)
 
 
-_llint_op_put_by_index:
-    traceExecution()
-    callSlowPath(_llint_slow_path_put_by_index)
-    dispatch(constexpr op_put_by_index_length)
-
-
 _llint_op_put_getter_by_id:
     traceExecution()
     callSlowPath(_llint_slow_path_put_getter_by_id)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to