Changeset 220770 in webkit


Ignore:
Timestamp:
Aug 15, 2017 3:54:50 PM (7 years ago)
Author:
keith_miller@apple.com
Message:

JSC named bytecode offsets should use references rather than pointers
https://bugs.webkit.org/show_bug.cgi?id=175601

Reviewed by Saam Barati.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r220753 r220770  
     12017-08-15  Keith Miller  <keith_miller@apple.com>
     2
     3        JSC named bytecode offsets should use references rather than pointers
     4        https://bugs.webkit.org/show_bug.cgi?id=175601
     5
     6        Reviewed by Saam Barati.
     7
     8        * dfg/DFGByteCodeParser.cpp:
     9        (JSC::DFG::ByteCodeParser::parseBlock):
     10        * jit/JITOpcodes.cpp:
     11        (JSC::JIT::emit_op_overrides_has_instance):
     12        (JSC::JIT::emit_op_instanceof):
     13        (JSC::JIT::emitSlow_op_instanceof):
     14        (JSC::JIT::emitSlow_op_instanceof_custom):
     15        * jit/JITOpcodes32_64.cpp:
     16        (JSC::JIT::emit_op_overrides_has_instance):
     17        (JSC::JIT::emit_op_instanceof):
     18        (JSC::JIT::emitSlow_op_instanceof):
     19        (JSC::JIT::emitSlow_op_instanceof_custom):
     20
    1212017-08-15  Keith Miller  <keith_miller@apple.com>
    222
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r220753 r220770  
    44524452
    44534453        case op_overrides_has_instance: {
    4454             auto bytecode = reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
     4454            auto& bytecode = *reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
    44554455            JSFunction* defaultHasInstanceSymbolFunction = m_inlineStackTop->m_codeBlock->globalObjectFor(currentCodeOrigin())->functionProtoHasInstanceSymbolFunction();
    44564456
    4457             Node* constructor = get(VirtualRegister(bytecode->constructor()));
    4458             Node* hasInstanceValue = get(VirtualRegister(bytecode->hasInstanceValue()));
    4459 
    4460             set(VirtualRegister(bytecode->dst()), addToGraph(OverridesHasInstance, OpInfo(m_graph.freeze(defaultHasInstanceSymbolFunction)), constructor, hasInstanceValue));
     4457            Node* constructor = get(VirtualRegister(bytecode.constructor()));
     4458            Node* hasInstanceValue = get(VirtualRegister(bytecode.hasInstanceValue()));
     4459
     4460            set(VirtualRegister(bytecode.dst()), addToGraph(OverridesHasInstance, OpInfo(m_graph.freeze(defaultHasInstanceSymbolFunction)), constructor, hasInstanceValue));
    44614461            NEXT_OPCODE(op_overrides_has_instance);
    44624462        }
     
    44704470
    44714471        case op_instanceof: {
    4472             auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
    4473             Node* value = get(VirtualRegister(bytecode->value()));
    4474             Node* prototype = get(VirtualRegister(bytecode->prototype()));
    4475             set(VirtualRegister(bytecode->dst()), addToGraph(InstanceOf, value, prototype));
     4472            auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
     4473            Node* value = get(VirtualRegister(bytecode.value()));
     4474            Node* prototype = get(VirtualRegister(bytecode.prototype()));
     4475            set(VirtualRegister(bytecode.dst()), addToGraph(InstanceOf, value, prototype));
    44764476            NEXT_OPCODE(op_instanceof);
    44774477        }
    44784478
    44794479        case op_instanceof_custom: {
    4480             auto bytecode = reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
    4481             Node* value = get(VirtualRegister(bytecode->value()));
    4482             Node* constructor = get(VirtualRegister(bytecode->constructor()));
    4483             Node* hasInstanceValue = get(VirtualRegister(bytecode->hasInstanceValue()));
    4484             set(VirtualRegister(bytecode->dst()), addToGraph(InstanceOfCustom, value, constructor, hasInstanceValue));
     4480            auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
     4481            Node* value = get(VirtualRegister(bytecode.value()));
     4482            Node* constructor = get(VirtualRegister(bytecode.constructor()));
     4483            Node* hasInstanceValue = get(VirtualRegister(bytecode.hasInstanceValue()));
     4484            set(VirtualRegister(bytecode.dst()), addToGraph(InstanceOfCustom, value, constructor, hasInstanceValue));
    44854485            NEXT_OPCODE(op_instanceof_custom);
    44864486        }
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r220753 r220770  
    114114void JIT::emit_op_overrides_has_instance(Instruction* currentInstruction)
    115115{
    116     auto bytecode = reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
    117     int dst = bytecode->dst();
    118     int constructor = bytecode->constructor();
    119     int hasInstanceValue = bytecode->hasInstanceValue();
     116    auto& bytecode = *reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
     117    int dst = bytecode.dst();
     118    int constructor = bytecode.constructor();
     119    int hasInstanceValue = bytecode.hasInstanceValue();
    120120
    121121    emitGetVirtualRegister(hasInstanceValue, regT0);
     
    140140void JIT::emit_op_instanceof(Instruction* currentInstruction)
    141141{
    142     auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
    143     int dst = bytecode->dst();
    144     int value = bytecode->value();
    145     int proto = bytecode->prototype();
     142    auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
     143    int dst = bytecode.dst();
     144    int value = bytecode.value();
     145    int proto = bytecode.prototype();
    146146
    147147    // Load the operands (baseVal, proto, and value respectively) into registers.
     
    864864void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    865865{
    866     auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
    867     int dst = bytecode->dst();
    868     int value = bytecode->value();
    869     int proto = bytecode->prototype();
     866    auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
     867    int dst = bytecode.dst();
     868    int value = bytecode.value();
     869    int proto = bytecode.prototype();
    870870
    871871    linkSlowCaseIfNotJSCell(iter, value);
     
    880880void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    881881{
    882     auto bytecode = reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
    883     int dst = bytecode->dst();
    884     int value = bytecode->value();
    885     int constructor = bytecode->constructor();
    886     int hasInstanceValue = bytecode->hasInstanceValue();
     882    auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
     883    int dst = bytecode.dst();
     884    int value = bytecode.value();
     885    int constructor = bytecode.constructor();
     886    int hasInstanceValue = bytecode.hasInstanceValue();
    887887
    888888    linkSlowCase(iter);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r220753 r220770  
    194194void JIT::emit_op_overrides_has_instance(Instruction* currentInstruction)
    195195{
    196     auto bytecode = reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
    197     int dst = bytecode->dst();
    198     int constructor = bytecode->constructor();
    199     int hasInstanceValue = bytecode->hasInstanceValue();
     196    auto& bytecode = *reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
     197    int dst = bytecode.dst();
     198    int constructor = bytecode.constructor();
     199    int hasInstanceValue = bytecode.hasInstanceValue();
    200200
    201201    emitLoadPayload(hasInstanceValue, regT0);
     
    222222void JIT::emit_op_instanceof(Instruction* currentInstruction)
    223223{
    224     auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
    225     int dst = bytecode->dst();
    226     int value = bytecode->value();
    227     int proto = bytecode->prototype();
     224    auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
     225    int dst = bytecode.dst();
     226    int value = bytecode.value();
     227    int proto = bytecode.prototype();
    228228
    229229    // Load the operands into registers.
     
    270270void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    271271{
    272     auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
    273     int dst = bytecode->dst();
    274     int value = bytecode->value();
    275     int proto = bytecode->prototype();
     272    auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
     273    int dst = bytecode.dst();
     274    int value = bytecode.value();
     275    int proto = bytecode.prototype();
    276276
    277277    linkSlowCaseIfNotJSCell(iter, value);
     
    287287void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    288288{
    289     auto bytecode = reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
    290     int dst = bytecode->dst();
    291     int value = bytecode->value();
    292     int constructor = bytecode->constructor();
    293     int hasInstanceValue = bytecode->hasInstanceValue();
     289    auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
     290    int dst = bytecode.dst();
     291    int value = bytecode.value();
     292    int constructor = bytecode.constructor();
     293    int hasInstanceValue = bytecode.hasInstanceValue();
    294294
    295295    linkSlowCase(iter);
Note: See TracChangeset for help on using the changeset viewer.