Changeset 184340 in webkit
- Timestamp:
- May 14, 2015 10:36:12 AM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r184337 r184340 1 2015-05-14 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Introduce SymbolType into SpeculativeTypes 4 https://bugs.webkit.org/show_bug.cgi?id=142651 5 6 Reviewed by Filip Pizlo. 7 8 Introduce SpecSymbol type into speculative types. 9 Previously symbol type is categorized into SpecCellOther. 10 But SpecCellOther is not intended to be used for such cells. 11 12 This patch just introduces SpecSymbol. 13 It represents the type of target value is definitely the symbol type. 14 It is the part of SpecCell. 15 16 In this patch, we do not introduce SymbolUse tracking. 17 It will be added in the separate patch. 18 19 * bytecode/SpeculatedType.cpp: 20 (JSC::dumpSpeculation): 21 (JSC::speculationFromStructure): 22 * bytecode/SpeculatedType.h: 23 (JSC::isSymbolSpeculation): 24 * dfg/DFGAbstractInterpreterInlines.h: 25 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): 26 * dfg/DFGAbstractValue.cpp: 27 (JSC::DFG::AbstractValue::setType): 28 * dfg/DFGConstantFoldingPhase.cpp: 29 (JSC::DFG::ConstantFoldingPhase::foldConstants): 30 * tests/stress/typeof-symbol.js: Added. 31 1 32 2015-05-14 Yusuke Suzuki <utatane.tea@gmail.com> 2 33 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
r183963 r184340 157 157 isTop = false; 158 158 } 159 160 if (value & SpecSymbol) 161 myOut.print("Symbol"); 162 else 163 isTop = false; 159 164 } 160 165 … … 338 343 if (structure->typeInfo().type() == StringType) 339 344 return SpecString; 345 if (structure->typeInfo().type() == SymbolType) 346 return SpecSymbol; 340 347 return speculationFromClassInfo(structure->classInfo()); 341 348 } -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r183963 r184340 61 61 static const SpeculatedType SpecStringVar = 0x00020000; // It's definitely a JSString, and it's not an identifier. 62 62 static const SpeculatedType SpecString = 0x00030000; // It's definitely a JSString. 63 static const SpeculatedType SpecCellOther = 0x00040000; // It's definitely a JSCell but not a subclass of JSObject and definitely not a JSString. FIXME: This shouldn't be part of heap-top or bytecode-top. https://bugs.webkit.org/show_bug.cgi?id=133078 64 static const SpeculatedType SpecCell = 0x0007ffff; // It's definitely a JSCell. 63 static const SpeculatedType SpecSymbol = 0x00040000; // It's definitely a Symbol. 64 static const SpeculatedType SpecCellOther = 0x00080000; // It's definitely a JSCell but not a subclass of JSObject and definitely not a JSString or a Symbol. FIXME: This shouldn't be part of heap-top or bytecode-top. https://bugs.webkit.org/show_bug.cgi?id=133078 65 static const SpeculatedType SpecCell = 0x000fffff; // It's definitely a JSCell. 65 66 static const SpeculatedType SpecInt32 = 0x00200000; // It's definitely an Int32. 66 67 static const SpeculatedType SpecInt52 = 0x00400000; // It's definitely an Int52 and we intend it to unbox it. … … 140 141 } 141 142 143 inline bool isSymbolSpeculation(SpeculatedType value) 144 { 145 return value == SpecSymbol; 146 } 147 142 148 inline bool isArraySpeculation(SpeculatedType value) 143 149 { -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r184318 r184340 1071 1071 } 1072 1072 1073 if (isSymbolSpeculation(abstractChild.m_type)) { 1074 setConstant(node, *m_graph.freeze(vm->smallStrings.symbolString())); 1075 break; 1076 } 1077 1073 1078 forNode(node).setType(m_graph, SpecStringIdent); 1074 1079 break; … … 1421 1426 } 1422 1427 1423 if (!(forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean | SpecString | Spec CellOther))) {1428 if (!(forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean | SpecString | SpecSymbol))) { 1424 1429 m_state.setFoundConstants(true); 1425 1430 forNode(node) = forNode(node->child1()); … … 1429 1434 clobberWorld(node->origin.semantic, clobberLimit); 1430 1435 1431 forNode(node).setType(m_graph, (SpecHeapTop & ~SpecCell) | SpecString | Spec CellOther);1436 forNode(node).setType(m_graph, (SpecHeapTop & ~SpecCell) | SpecString | SpecSymbol); 1432 1437 break; 1433 1438 } -
trunk/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
r184318 r184340 125 125 if (!(cellType & ~SpecString)) 126 126 m_structure = graph.m_vm.stringStructure.get(); 127 else if (isSymbolSpeculation(cellType)) 128 m_structure = graph.m_vm.symbolStructure.get(); 127 129 else 128 130 m_structure.makeTop(); -
trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
r183497 r184340 452 452 453 453 case ToPrimitive: { 454 if (m_state.forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean | SpecString | Spec CellOther))454 if (m_state.forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean | SpecString | SpecSymbol)) 455 455 break; 456 456
Note: See TracChangeset
for help on using the changeset viewer.