Changeset 36766 in webkit for trunk/JavaScriptCore/VM/Machine.cpp


Ignore:
Timestamp:
Sep 22, 2008, 8:03:52 AM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-09-22 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.


  • speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag

Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>


2.2% speedup on EarleyBoyer benchmark.

  • API/JSCallbackConstructor.cpp:
  • API/JSCallbackConstructor.h: (JSC::JSCallbackConstructor::createStructureID):
  • API/JSCallbackFunction.cpp:
  • API/JSCallbackFunction.h: (JSC::JSCallbackFunction::createStructureID):
  • API/JSCallbackObject.h: (JSC::JSCallbackObject::createStructureID):
  • API/JSCallbackObjectFunctions.h: (JSC::::hasInstance):
  • API/JSValueRef.cpp: (JSValueIsInstanceOfConstructor):
  • JavaScriptCore.exp:
  • VM/Machine.cpp: (JSC::Machine::privateExecute): (JSC::Machine::cti_op_instanceof):
  • kjs/InternalFunction.cpp:
  • kjs/InternalFunction.h: (JSC::InternalFunction::createStructureID):
  • kjs/JSObject.cpp:
  • kjs/JSObject.h:
  • kjs/TypeInfo.h: (JSC::TypeInfo::implementsHasInstance):

WebCore:

2008-09-22 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.

  • speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag

Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>


2.2% speedup on EarleyBoyer benchmark.

  • bindings/js/JSQuarantinedObjectWrapper.cpp:
  • bindings/js/JSQuarantinedObjectWrapper.h: (WebCore::JSQuarantinedObjectWrapper::createStructureID):
  • bindings/scripts/CodeGeneratorJS.pm:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/Machine.cpp

    r36764 r36766  
    21242124
    21252125        JSObject* baseObj = static_cast<JSObject*>(baseVal);
    2126         r[dst] = jsBoolean(baseObj->implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec), r[baseProto].jsValue(exec)) : false);
     2126        r[dst] = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(exec, r[value].jsValue(exec), r[baseProto].jsValue(exec)) : false);
    21272127
    21282128        ++vPC;
     
    43054305    JSObject* baseObj = static_cast<JSObject*>(baseVal);
    43064306    JSValue* basePrototype = ARG_src3;
    4307     JSValue* result = jsBoolean(baseObj->implementsHasInstance() ? baseObj->hasInstance(exec,  ARG_src1, basePrototype) : false);
     4307    JSValue* result = jsBoolean(baseObj->structureID()->typeInfo().implementsHasInstance() ? baseObj->hasInstance(exec,  ARG_src1, basePrototype) : false);
    43084308    VM_CHECK_EXCEPTION_AT_END();
    43094309    return result;
Note: See TracChangeset for help on using the changeset viewer.