Changeset 94688 in webkit for trunk/Source/JavaScriptCore/dfg


Ignore:
Timestamp:
Sep 7, 2011, 10:55:50 AM (14 years ago)
Author:
[email protected]
Message:

Refactor JIT checks for ObjectType into helper functions.

Rubber stamped by Sam Weinig.

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::branchIfNotObject):

  • dfg/DFGNonSpeculativeJIT.cpp:

(JSC::DFG::NonSpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • jit/JIT.h:
  • jit/JITCall32_64.cpp:

(JSC::JIT::emit_op_ret_object_or_this):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitJumpIfNotObject):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_ret_object_or_this):
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_create_this):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_create_this):

Location:
trunk/Source/JavaScriptCore/dfg
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r94629 r94688  
    186186        return Address(GPRInfo::callFrameRegister, virtualRegister * sizeof(Register) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
    187187    }
    188    
     188
     189    Jump branchIfNotObject(GPRReg structureReg)
     190    {
     191        return branch8(NotEqual, Address(structureReg, Structure::typeInfoTypeOffset()), TrustedImm32(ObjectType));
     192    }
     193
    189194    // Notify the JIT of a call that does not require linking.
    190195    void notifyCall(Call call, unsigned exceptionInfo)
  • trunk/Source/JavaScriptCore/dfg/DFGNonSpeculativeJIT.cpp

    r93934 r94688  
    11621162        // Check that prototype is an object
    11631163        m_jit.loadPtr(MacroAssembler::Address(prototypeReg, JSCell::structureOffset()), scratchReg);
    1164         MacroAssembler::Jump protoNotObject = m_jit.branch8(MacroAssembler::NotEqual, MacroAssembler::Address(scratchReg, Structure::typeInfoTypeOffset()), MacroAssembler::TrustedImm32(ObjectType));
     1164        MacroAssembler::Jump protoNotObject = m_jit.branchIfNotObject(scratchReg);
    11651165
    11661166        // Initialize scratchReg with the value being checked.
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r94629 r94688  
    13041304        // Check that prototype is an object.
    13051305        m_jit.loadPtr(MacroAssembler::Address(prototypeReg, JSCell::structureOffset()), scratchReg);
    1306         speculationCheck(m_jit.branch8(MacroAssembler::NotEqual, MacroAssembler::Address(scratchReg, Structure::typeInfoTypeOffset()), MacroAssembler::TrustedImm32(ObjectType)));
     1306        speculationCheck(m_jit.branchIfNotObject(scratchReg));
    13071307
    13081308        // Initialize scratchReg with the value being checked.
Note: See TracChangeset for help on using the changeset viewer.