We should hard code the poly proto offset
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Oct 2017 22:23:58 +0000 (22:23 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Oct 2017 22:23:58 +0000 (22:23 +0000)
commitd92f532f3e2774796e9399598900d07414317bc2
tree5ee2773a9a79394810eeeec75bb31223f74b2209
parent032daf3ccaea2bcdb582ef789eac5d0167270012
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/AccessCase.cpp
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/PropertyOffset.h
Source/JavaScriptCore/runtime/Structure.cpp
Source/JavaScriptCore/runtime/Structure.h
Source/JavaScriptCore/runtime/StructureInlines.h