Ignore:
Timestamp:
Oct 19, 2017, 3:23:58 PM (8 years ago)
Author:
[email protected]
Message:

We should hard code the poly proto offset
https://bugs.webkit.org/show_bug.cgi?id=178531

Reviewed by Filip Pizlo.

This patch embraces that the poly proto offset is always zero. It's already
the case that we would always get the inline offset zero for poly proto just
by construction. This just hardcodes this assumption throughout the codebase.
This appears to be a 1% speedometer progression in my testing.

The downside of this patch is that it may require changing how we do
things when we implement poly proto when inheriting from builtin
types. I think we can face this problem when we decide to implement
that.

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateWithGuard):

  • dfg/DFGOperations.cpp:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
(JSC::DFG::SpeculativeJIT::compileGetPrototypeOf):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileGetPrototypeOf):
(JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_instanceof):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_instanceof):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/JSObject.cpp:

(JSC::JSObject::setPrototypeDirect):

  • runtime/JSObject.h:

(JSC::JSObject::locationForOffset const):
(JSC::JSObject::locationForOffset):
(JSC::JSObject::getDirect const):

  • runtime/PropertyOffset.h:
  • runtime/Structure.cpp:

(JSC::Structure::create):
(JSC::Structure::dump const):

  • runtime/Structure.h:
  • runtime/StructureInlines.h:

(JSC::Structure::storedPrototype const):
(JSC::Structure::storedPrototypeObject const):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r223161 r223715  
    309309        [&] (const GCSafeConcurrentJSLocker&, PropertyOffset offset, PropertyOffset newLastOffset) {
    310310            RELEASE_ASSERT(Structure::outOfLineCapacity(newLastOffset) == oldOutOfLineCapacity);
    311             RELEASE_ASSERT(isInlineOffset(offset));
    312             result->m_prototype.set(vm, result, jsNumber(offset));
     311            RELEASE_ASSERT(offset == knownPolyProtoOffset);
     312            RELEASE_ASSERT(isInlineOffset(knownPolyProtoOffset));
     313            result->m_prototype.setWithoutWriteBarrier(JSValue());
    313314            result->setLastOffset(newLastOffset);
    314315        });
     
    11731174   
    11741175    if (hasPolyProto())
    1175         out.print(", PolyProto offset:", polyProtoOffset());
     1176        out.print(", PolyProto offset:", knownPolyProtoOffset);
    11761177    else if (m_prototype.get().isCell())
    11771178        out.print(", Proto:", RawPointer(m_prototype.get().asCell()));
Note: See TracChangeset for help on using the changeset viewer.