Ignore:
Timestamp:
Oct 24, 2019, 11:59:36 PM (6 years ago)
Author:
[email protected]
Message:

Move JSC::Register inline methods into RegisterInlines.h.
https://bugs.webkit.org/show_bug.cgi?id=203391

Reviewed by Yusuke Suzuki and Keith Miller.

Source/JavaScriptCore:

We're doing this because:

  1. RegisterInlines.h is the canonical place to put inline Register methods.
  2. It helps reduce build time. e.g. build-jsc went from 208.02 to 196.81 seconds (about a 5% reduction).
  3. This enables experimental work to box JSCells in JSValue.

This patch also handles the fallout of this change, which necessitates more
inline methods being moved from <file>.h to their respective <file>Inlines.h.

JSArray.h used to include ButterflyInlines.h and JSCellInlines.h. This is a
violation of inclusion ordering (.h should not #include Inlines.h). This
violation has been removed.

  • API/JSAPIGlobalObject.mm:
  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/CodeBlock.h:

(JSC::CallFrame::r): Deleted.
(JSC::CallFrame::uncheckedR): Deleted.

  • bytecode/MetadataTable.cpp:
  • ftl/FTLLowerDFGToB3.cpp:
  • interpreter/CallFrame.h:

(JSC::CallFrame::guaranteedJSValueCallee const): Deleted.
(JSC::CallFrame::jsCallee const): Deleted.
(JSC::CallFrame::codeBlock const): Deleted.
(JSC::CallFrame::unsafeCodeBlock const): Deleted.
(JSC::CallFrame::scope const): Deleted.
(JSC::CallFrame::topOfFrame): Deleted.
(JSC::CallFrame::setScope): Deleted.
(JSC::CallFrame::setCallee): Deleted.
(JSC::CallFrame::setCodeBlock): Deleted.

  • interpreter/CallFrameInlines.h:

(JSC::CallFrame::r):
(JSC::CallFrame::uncheckedR):
(JSC::CallFrame::guaranteedJSValueCallee const):
(JSC::CallFrame::jsCallee const):
(JSC::CallFrame::codeBlock const):
(JSC::CallFrame::unsafeCodeBlock const):
(JSC::CallFrame::lexicalGlobalObject const):
(JSC::CallFrame::setCallee):
(JSC::CallFrame::setCodeBlock):
(JSC::CallFrame::setScope):
(JSC::CallFrame::scope const):
(JSC::CallFrame::topOfFrame):

  • interpreter/Interpreter.cpp:
  • interpreter/ProtoCallFrame.h:

(JSC::ProtoCallFrame::init): Deleted.

  • interpreter/ProtoCallFrameInlines.h: Added.

(JSC::ProtoCallFrame::init):
(JSC::ProtoCallFrame::callee const):
(JSC::ProtoCallFrame::setCallee):
(JSC::ProtoCallFrame::codeBlock const):
(JSC::ProtoCallFrame::setCodeBlock):

  • interpreter/Register.h:

(JSC::Register::callFrame const): Deleted.
(JSC::Register::codeBlock const): Deleted.
(JSC::Register::asanUnsafeCodeBlock const): Deleted.

  • interpreter/RegisterInlines.h: Added.

(JSC::Register::callFrame const):
(JSC::Register::codeBlock const):
(JSC::Register::asanUnsafeCodeBlock const):
(JSC::Register::object const):
(JSC::Register::operator=):
(JSC::Register::scope const):

  • interpreter/StackVisitor.cpp:
  • jit/AssemblyHelpers.h:
  • llint/LLIntSlowPaths.cpp:
  • runtime/ArrayStorage.h:

(JSC::ArrayStorage::optimalVectorLength): Deleted.

  • runtime/ArrayStorageInlines.h: Added.

(JSC::ArrayStorage::availableVectorLength):
(JSC::ArrayStorage::optimalVectorLength):
(JSC::ArrayStorage::totalSize const):

  • runtime/ButterflyInlines.h:
  • runtime/ClassInfo.h:
  • runtime/GetVM.h: Added.
  • runtime/JSArray.h:
  • runtime/JSArrayInlines.h:
  • runtime/JSCellInlines.h:
  • runtime/JSGlobalObject.h:
  • runtime/JSObject.h:

(JSC::Register::object const): Deleted.
(JSC::Register::operator=): Deleted.

  • runtime/JSObjectInlines.h:
  • runtime/JSScope.h:

(JSC::Register::operator=): Deleted.
(JSC::Register::scope const): Deleted.
(JSC::CallFrame::lexicalGlobalObject const): Deleted.

  • runtime/JSString.h:
  • runtime/PropertyNameArray.h:
  • runtime/PropertySlot.h:
  • runtime/VMInlines.h:
  • tools/HeapVerifier.cpp:
  • wasm/js/WebAssemblyFunction.cpp:

Source/WebCore:

No new tests needed because there is no behavior change.

  • platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r251529 r251584  
    22 *  Copyright (C) 1999-2001 Harri Porten ([email protected])
    33 *  Copyright (C) 2001 Peter Kelly ([email protected])
    4  *  Copyright (C) 2003-2018 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2003-2019 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    105105        // to be a cell, however, there is a brief window where we need to check
    106106        // to see if it's a cell, and if it's not, we throw an exception.
    107         JSValue guaranteedJSValueCallee() const
    108         {
    109             ASSERT(!callee().isWasm());
    110             return this[CallFrameSlot::callee].jsValue();
    111         }
    112         JSObject* jsCallee() const
    113         {
    114             ASSERT(!callee().isWasm());
    115             return this[CallFrameSlot::callee].object();
    116         }
     107        inline JSValue guaranteedJSValueCallee() const;
     108        inline JSObject* jsCallee() const;
    117109        CalleeBits callee() const { return CalleeBits(this[CallFrameSlot::callee].pointer()); }
    118110        SUPPRESS_ASAN CalleeBits unsafeCallee() const { return CalleeBits(this[CallFrameSlot::callee].asanUnsafePointer()); }
    119         CodeBlock* codeBlock() const { return this[CallFrameSlot::codeBlock].Register::codeBlock(); }
     111        CodeBlock* codeBlock() const;
    120112        CodeBlock** addressOfCodeBlock() const { return bitwise_cast<CodeBlock**>(this + CallFrameSlot::codeBlock); }
    121         SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const { return this[CallFrameSlot::codeBlock].Register::asanUnsafeCodeBlock(); }
    122         JSScope* scope(int scopeRegisterOffset) const
    123         {
    124             ASSERT(this[scopeRegisterOffset].Register::scope());
    125             return this[scopeRegisterOffset].Register::scope();
    126         }
     113        inline SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const;
     114        inline JSScope* scope(int scopeRegisterOffset) const;
    127115
    128116        JS_EXPORT_PRIVATE bool isAnyWasmCallee();
     
    184172        JS_EXPORT_PRIVATE CodeOrigin codeOrigin();
    185173
    186         Register* topOfFrame()
    187         {
    188             if (!codeBlock())
    189                 return registers();
    190             return topOfFrameInternal();
    191         }
     174        inline Register* topOfFrame();
    192175   
    193176        const Instruction* currentVPC() const; // This only makes sense in the LLInt and baseline.
     
    195178
    196179        void setCallerFrame(CallFrame* frame) { callerFrameAndPC().callerFrame = frame; }
    197         void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast<Register*>(this)[scopeRegisterOffset] = scope; }
     180        inline void setScope(int scopeRegisterOffset, JSScope*);
    198181
    199182        static void initDeprecatedCallFrameForDebugger(CallFrame* globalExec, JSCallee* globalCallee);
     
    270253
    271254        void setArgumentCountIncludingThis(int count) { static_cast<Register*>(this)[CallFrameSlot::argumentCount].payload() = count; }
    272         void setCallee(JSObject* callee) { static_cast<Register*>(this)[CallFrameSlot::callee] = callee; }
    273         void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[CallFrameSlot::codeBlock] = codeBlock; }
     255        inline void setCallee(JSObject*);
     256        inline void setCodeBlock(CodeBlock*);
    274257        void setReturnPC(void* value) { callerFrameAndPC().returnPC = reinterpret_cast<const Instruction*>(value); }
    275258
     
    324307    };
    325308
    326 // Helper function to get VM& from JSGlobalObject* if JSGlobalObject.h is not included.
    327 VM& getVM(JSGlobalObject*);
    328309JS_EXPORT_PRIVATE bool isFromJSCode(void* returnAddress);
    329310
Note: See TracChangeset for help on using the changeset viewer.