Ignore:
Timestamp:
Jun 3, 2015, 1:04:00 PM (10 years ago)
Author:
[email protected]
Message:

GetById and PutById profiling should be more precise about it takes slow path
https://bugs.webkit.org/show_bug.cgi?id=145590

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

If a ById access ever takes slow path, we want the DFG and FTL to know this. Previously we
were relying on slow path counts, which conflate slow paths taken due to a megamorphic
access and slow paths taken due to IC building.

  • bytecode/GetByIdStatus.cpp:

(JSC::GetByIdStatus::computeFor):
(JSC::GetByIdStatus::computeForStubInfo):

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeFor):
(JSC::PutByIdStatus::computeForStubInfo):

  • bytecode/StructureStubInfo.h:

(JSC::StructureStubInfo::StructureStubInfo):

  • ftl/FTLIntrinsicRepository.h:
  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileGetById):

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:

LayoutTests:

Added just two more tests for getters and setters. I needed more microbenchmarks to track
down a regression in an earlier version of this patch.

  • js/regress/getter-prototype-expected.txt: Added.
  • js/regress/getter-prototype.html: Added.
  • js/regress/script-tests/getter-prototype.js: Added.
  • js/regress/script-tests/setter-prototype.js: Added.
  • js/regress/setter-prototype-expected.txt: Added.
  • js/regress/setter-prototype.html: Added.
File:
1 edited

Legend:

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

    r185109 r185160  
    148148}
    149149
    150 EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo*, EncodedJSValue base, UniquedStringImpl* uid)
     150EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
     151{
     152    VM* vm = &exec->vm();
     153    NativeCallFrameTracer tracer(vm, exec);
     154   
     155    stubInfo->tookSlowPath = true;
     156   
     157    JSValue baseValue = JSValue::decode(base);
     158    PropertySlot slot(baseValue);
     159    Identifier ident = Identifier::fromUid(vm, uid);
     160    return JSValue::encode(baseValue.get(exec, ident, slot));
     161}
     162
     163EncodedJSValue JIT_OPERATION operationGetByIdGeneric(ExecState* exec, EncodedJSValue base, UniquedStringImpl* uid)
    151164{
    152165    VM* vm = &exec->vm();
     
    222235}
    223236
    224 EncodedJSValue JIT_OPERATION operationIn(ExecState* exec, StructureStubInfo*, JSCell* base, UniquedStringImpl* key)
    225 {
    226     VM* vm = &exec->vm();
    227     NativeCallFrameTracer tracer(vm, exec);
     237EncodedJSValue JIT_OPERATION operationIn(ExecState* exec, StructureStubInfo* stubInfo, JSCell* base, UniquedStringImpl* key)
     238{
     239    VM* vm = &exec->vm();
     240    NativeCallFrameTracer tracer(vm, exec);
     241   
     242    stubInfo->tookSlowPath = true;
    228243
    229244    if (!base->isObject()) {
     
    244259}
    245260
    246 void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    247 {
    248     VM* vm = &exec->vm();
    249     NativeCallFrameTracer tracer(vm, exec);
     261void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
     262{
     263    VM* vm = &exec->vm();
     264    NativeCallFrameTracer tracer(vm, exec);
     265   
     266    stubInfo->tookSlowPath = true;
    250267   
    251268    Identifier ident = Identifier::fromUid(vm, uid);
     
    254271}
    255272
    256 void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    257 {
    258     VM* vm = &exec->vm();
    259     NativeCallFrameTracer tracer(vm, exec);
     273void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
     274{
     275    VM* vm = &exec->vm();
     276    NativeCallFrameTracer tracer(vm, exec);
     277   
     278    stubInfo->tookSlowPath = true;
    260279   
    261280    Identifier ident = Identifier::fromUid(vm, uid);
     
    264283}
    265284
    266 void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    267 {
    268     VM* vm = &exec->vm();
    269     NativeCallFrameTracer tracer(vm, exec);
     285void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
     286{
     287    VM* vm = &exec->vm();
     288    NativeCallFrameTracer tracer(vm, exec);
     289   
     290    stubInfo->tookSlowPath = true;
    270291   
    271292    Identifier ident = Identifier::fromUid(vm, uid);
     
    274295}
    275296
    276 void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    277 {
    278     VM* vm = &exec->vm();
    279     NativeCallFrameTracer tracer(vm, exec);
     297void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
     298{
     299    VM* vm = &exec->vm();
     300    NativeCallFrameTracer tracer(vm, exec);
     301   
     302    stubInfo->tookSlowPath = true;
    280303   
    281304    Identifier ident = Identifier::fromUid(vm, uid);
Note: See TracChangeset for help on using the changeset viewer.