Changeset 162718 in webkit for trunk/Source/JavaScriptCore/jit


Ignore:
Timestamp:
Jan 24, 2014, 1:23:17 PM (11 years ago)
Author:
[email protected]
Message:

Generic JSObject::put should handle static properties in the classinfo hierarchy
https://bugs.webkit.org/show_bug.cgi?id=127523

Patch by Oliver Hunt <[email protected]> on 2014-01-24
Reviewed by Geoffrey Garen.

This patch makes JSObject::put correctly call static setters
defined by the ClassInfo.

To make this not clobber performance, the ClassInfo HashTable
now includes a flag to indicate that it contains setters. This
required updating the lut generator so that it tracked (and emitted)
this.

The rest of the change was making a number of the methods take
a VM rather than an ExecState*, so that Structure could set the
getter/setter flags during construction (if necessary).

This also means most objects do not need to perform a lookupPut
manually anymore, so most custom ::put's are no longer needed.
DOMWindow is the only exception as it has interesting security
related semantics.

  • create_hash_table:
  • interpreter/CallFrame.h:

(JSC::ExecState::arrayConstructorTable):
(JSC::ExecState::arrayPrototypeTable):
(JSC::ExecState::booleanPrototypeTable):
(JSC::ExecState::dataViewTable):
(JSC::ExecState::dateTable):
(JSC::ExecState::dateConstructorTable):
(JSC::ExecState::errorPrototypeTable):
(JSC::ExecState::globalObjectTable):
(JSC::ExecState::jsonTable):
(JSC::ExecState::numberConstructorTable):
(JSC::ExecState::numberPrototypeTable):
(JSC::ExecState::objectConstructorTable):
(JSC::ExecState::privateNamePrototypeTable):
(JSC::ExecState::regExpTable):
(JSC::ExecState::regExpConstructorTable):
(JSC::ExecState::regExpPrototypeTable):
(JSC::ExecState::stringConstructorTable):
(JSC::ExecState::promisePrototypeTable):
(JSC::ExecState::promiseConstructorTable):

  • runtime/ArrayConstructor.cpp:

(JSC::ArrayConstructor::getOwnPropertySlot):

  • runtime/ArrayPrototype.cpp:

(JSC::ArrayPrototype::getOwnPropertySlot):

  • runtime/BooleanPrototype.cpp:

(JSC::BooleanPrototype::getOwnPropertySlot):

  • runtime/ClassInfo.h:

(JSC::ClassInfo::propHashTable):

  • runtime/DateConstructor.cpp:

(JSC::DateConstructor::getOwnPropertySlot):

  • runtime/DatePrototype.cpp:

(JSC::DatePrototype::getOwnPropertySlot):

  • runtime/ErrorPrototype.cpp:

(JSC::ErrorPrototype::getOwnPropertySlot):

  • runtime/JSDataViewPrototype.cpp:

(JSC::JSDataViewPrototype::getOwnPropertySlot):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::getOwnPropertySlot):

  • runtime/JSONObject.cpp:

(JSC::JSONObject::getOwnPropertySlot):

  • runtime/JSObject.cpp:

(JSC::JSObject::put):
(JSC::JSObject::deleteProperty):

  • runtime/JSPromiseConstructor.cpp:

(JSC::JSPromiseConstructor::getOwnPropertySlot):

  • runtime/JSPromisePrototype.cpp:

(JSC::JSPromisePrototype::getOwnPropertySlot):

  • runtime/Lookup.h:

(JSC::HashTable::copy):
(JSC::putEntry):
(JSC::lookupPut):

  • runtime/NamePrototype.cpp:

(JSC::NamePrototype::getOwnPropertySlot):

  • runtime/NumberConstructor.cpp:

(JSC::NumberConstructor::getOwnPropertySlot):

  • runtime/NumberConstructor.h:
  • runtime/NumberPrototype.cpp:

(JSC::NumberPrototype::getOwnPropertySlot):

  • runtime/ObjectConstructor.cpp:

(JSC::ObjectConstructor::getOwnPropertySlot):

  • runtime/RegExpConstructor.cpp:

(JSC::RegExpConstructor::getOwnPropertySlot):

  • runtime/RegExpConstructor.h:
  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnPropertySlot):
(JSC::RegExpObject::put):

  • runtime/RegExpPrototype.cpp:

(JSC::RegExpPrototype::getOwnPropertySlot):

  • runtime/StringConstructor.cpp:

(JSC::StringConstructor::getOwnPropertySlot):

  • runtime/Structure.cpp:

(JSC::Structure::Structure):
(JSC::Structure::freezeTransition):
(JSC::ClassInfo::hasStaticSetterOrReadonlyProperties):

Location:
trunk/Source/JavaScriptCore/jit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r162711 r162718  
    887887void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
    888888{
     889    Jump profilerDone = branchTestPtr(Zero, AbsoluteAddress(m_vm->enabledProfilerAddress()));
    889890    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
    890891    callOperation(operationProfileWillCall, regT0);
     892    profilerDone.link(this);
    891893}
    892894
    893895void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
    894896{
     897    Jump profilerDone = branchTestPtr(Zero, AbsoluteAddress(m_vm->enabledProfilerAddress()));
    895898    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
    896899    callOperation(operationProfileDidCall, regT0);
     900    profilerDone.link(this);
    897901}
    898902
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r162711 r162718  
    11151115void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
    11161116{
     1117    load32(m_vm->enabledProfilerAddress(), regT0);
     1118    Jump profilerDone = branchTestPtr(Zero, regT0);
    11171119    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
    11181120    callOperation(operationProfileWillCall, regT1, regT0);
     1121    profilerDone.link(this);
    11191122}
    11201123
    11211124void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
    11221125{
     1126    load32(m_vm->enabledProfilerAddress(), regT0);
     1127    Jump profilerDone = branchTestPtr(Zero, regT0);
    11231128    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
    11241129    callOperation(operationProfileDidCall, regT1, regT0);
     1130    profilerDone.link(this);
    11251131}
    11261132
Note: See TracChangeset for help on using the changeset viewer.