Ignore:
Timestamp:
Sep 30, 2013, 11:58:51 AM (12 years ago)
Author:
[email protected]
Message:

Pass VM instead of JSGlobalObject to RegExp constructor.
<https://webkit.org/b/122113>

Reviewed by Darin Adler.

RegExps don't need anything from the global object during their
construction and only use it to get to the VM. Reduce loads by
simply passing the VM around instead.

JSC release binary size -= 120 bytes(!)

File:
1 edited

Legend:

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

    r155143 r156668  
    6464*/
    6565
    66 RegExpObject::RegExpObject(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    67     : JSNonFinalObject(globalObject->vm(), structure)
    68     , m_regExp(globalObject->vm(), this, regExp)
     66RegExpObject::RegExpObject(VM& vm, Structure* structure, RegExp* regExp)
     67    : JSNonFinalObject(vm, structure)
     68    , m_regExp(vm, this, regExp)
    6969    , m_lastIndexIsWritable(true)
    7070{
     
    7272}
    7373
    74 void RegExpObject::finishCreation(JSGlobalObject* globalObject)
    75 {
    76     Base::finishCreation(globalObject->vm());
     74void RegExpObject::finishCreation(VM& vm)
     75{
     76    Base::finishCreation(vm);
    7777    ASSERT(inherits(info()));
    7878}
Note: See TracChangeset for help on using the changeset viewer.