Ignore:
Timestamp:
Apr 29, 2015, 8:55:54 AM (10 years ago)
Author:
[email protected]
Message:

TypeOf should return SpecStringIdent and the DFG should know this
https://bugs.webkit.org/show_bug.cgi?id=144376

Reviewed by Andreas Kling.

Make TypeOf return atomic strings. That's a simple change in SmallStrings.

Make the DFG know this and use it for optimization. This makes Switch(TypeOf) a bit less
bad.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGAbstractValue.cpp:

(JSC::DFG::AbstractValue::setType):

  • dfg/DFGAbstractValue.h:

(JSC::DFG::AbstractValue::setType):

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::InPlaceAbstractState::initialize):

  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • runtime/SmallStrings.cpp:

(JSC::SmallStrings::initialize):

  • tests/stress/switch-typeof-indirect.js: Added.

(bar):
(foo):
(test):

  • tests/stress/switch-typeof-slightly-indirect.js: Added.

(foo):
(test):

  • tests/stress/switch-typeof.js: Added.

(foo):
(test):

File:
1 edited

Legend:

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

    r178984 r183548  
    131131void SmallStrings::initialize(VM* vm, JSString*& string, const char* value)
    132132{
    133     string = JSString::create(*vm, StringImpl::create(value));
     133    string = JSString::create(*vm, Identifier::fromString(vm, value).impl());
    134134    m_needsToBeVisited = true;
    135135}
Note: See TracChangeset for help on using the changeset viewer.