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/ProtoCallFrame.h

    r250803 r251584  
    11/*
    2  * Copyright (C) 2013-2018 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013-2019 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4848    JSGlobalObject* globalObject;
    4949
    50     void init(CodeBlock*, JSGlobalObject*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
     50    inline void init(CodeBlock*, JSGlobalObject*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
    5151
    52     CodeBlock* codeBlock() const { return codeBlockValue.Register::codeBlock(); }
    53     void setCodeBlock(CodeBlock* codeBlock) { codeBlockValue = codeBlock; }
     52    inline CodeBlock* codeBlock() const;
     53    inline void setCodeBlock(CodeBlock*);
    5454
    55     JSObject* callee() const { return calleeValue.Register::object(); }
    56     void setCallee(JSObject* callee)
    57     {
    58         calleeValue = callee;
    59     }
     55    inline JSObject* callee() const;
     56    inline void setCallee(JSObject*);
    6057    void setGlobalObject(JSGlobalObject* object)
    6158    {
     
    8784};
    8885
    89 inline void ProtoCallFrame::init(CodeBlock* codeBlock, JSGlobalObject* globalObject, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)
    90 {
    91     this->args = otherArgs;
    92     this->setCodeBlock(codeBlock);
    93     this->setCallee(callee);
    94     this->setGlobalObject(globalObject);
    95     this->setArgumentCountIncludingThis(argCountIncludingThis);
    96     if (codeBlock && argCountIncludingThis < codeBlock->numParameters())
    97         this->hasArityMismatch = true;
    98     else
    99         this->hasArityMismatch = false;
    100 
    101     // Round up argCountIncludingThis to keep the stack frame size aligned.
    102     size_t paddedArgsCount = roundArgumentCountToAlignFrame(argCountIncludingThis);
    103     this->setPaddedArgCount(paddedArgsCount);
    104     this->clearCurrentVPC();
    105     this->setThisValue(thisValue);
    106 }
    107 
    10886} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.