Changeset 192034 in webkit for trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
- Timestamp:
- Nov 4, 2015, 1:46:10 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r191621 r192034 34 34 35 35 namespace JSC { namespace DFG { 36 37 SpeculatedType resultOfToPrimitive(SpeculatedType type)38 {39 if (type & SpecObject) {40 // Objects get turned into strings. So if the input has hints of objectness,41 // the output will have hinsts of stringiness.42 return mergeSpeculations(type & ~SpecObject, SpecString);43 }44 45 return type;46 }47 36 48 37 class PredictionPropagationPhase : public Phase { … … 909 898 m_changed |= m_graph.m_argumentPositions[i].mergeArgumentPredictionAwareness(); 910 899 } 900 901 SpeculatedType resultOfToPrimitive(SpeculatedType type) 902 { 903 if (type & SpecObject) { 904 // We try to be optimistic here about StringObjects since it's unlikely that 905 // someone overrides the valueOf or toString methods. 906 if (type & SpecStringObject && m_graph.canOptimizeStringObjectAccess(m_currentNode->origin.semantic)) 907 return mergeSpeculations(type & ~SpecObject, SpecString); 908 909 return mergeSpeculations(type & ~SpecObject, SpecPrimitive); 910 } 911 912 return type; 913 } 911 914 912 915 Node* m_currentNode;
Note:
See TracChangeset
for help on using the changeset viewer.