Changeset 223523 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Oct 17, 2017, 5:02:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r223318 r223523 239 239 bool handleDOMJITCall(Node* callee, int resultOperand, const DOMJIT::Signature*, int registerOffset, int argumentCountIncludingThis, SpeculatedType prediction, const ChecksFunctor& insertChecks); 240 240 template<typename ChecksFunctor> 241 bool handleIntrinsicGetter(int resultOperand, const GetByIdVariant& intrinsicVariant, Node* thisNode, const ChecksFunctor& insertChecks);241 bool handleIntrinsicGetter(int resultOperand, SpeculatedType prediction, const GetByIdVariant& intrinsicVariant, Node* thisNode, const ChecksFunctor& insertChecks); 242 242 template<typename ChecksFunctor> 243 243 bool handleTypedArrayConstructor(int resultOperand, InternalFunction*, int registerOffset, int argumentCountIncludingThis, TypedArrayType, const ChecksFunctor& insertChecks); … … 2600 2600 } 2601 2601 2602 case ObjectGetPrototypeOfIntrinsic: { 2603 if (argumentCountIncludingThis != 2) 2604 return false; 2605 2606 insertChecks(); 2607 set(VirtualRegister(resultOperand), addToGraph(GetPrototypeOf, OpInfo(0), OpInfo(prediction), get(virtualRegisterForArgument(1, registerOffset)))); 2608 return true; 2609 } 2610 2611 case ReflectGetPrototypeOfIntrinsic: { 2612 if (argumentCountIncludingThis != 2) 2613 return false; 2614 2615 insertChecks(); 2616 set(VirtualRegister(resultOperand), addToGraph(GetPrototypeOf, OpInfo(0), OpInfo(prediction), Edge(get(virtualRegisterForArgument(1, registerOffset)), ObjectUse))); 2617 return true; 2618 } 2619 2602 2620 case IsTypedArrayViewIntrinsic: { 2603 2621 ASSERT(argumentCountIncludingThis == 2); … … 2947 2965 2948 2966 template<typename ChecksFunctor> 2949 bool ByteCodeParser::handleIntrinsicGetter(int resultOperand, const GetByIdVariant& variant, Node* thisNode, const ChecksFunctor& insertChecks)2967 bool ByteCodeParser::handleIntrinsicGetter(int resultOperand, SpeculatedType prediction, const GetByIdVariant& variant, Node* thisNode, const ChecksFunctor& insertChecks) 2950 2968 { 2951 2969 switch (variant.intrinsic()) { … … 3011 3029 set(VirtualRegister(resultOperand), addToGraph(GetTypedArrayByteOffset, OpInfo(ArrayMode(arrayType).asWord()), thisNode)); 3012 3030 3031 return true; 3032 } 3033 3034 case UnderscoreProtoIntrinsic: { 3035 insertChecks(); 3036 3037 bool canFold = !variant.structureSet().isEmpty(); 3038 JSValue prototype; 3039 variant.structureSet().forEach([&] (Structure* structure) { 3040 auto getPrototypeMethod = structure->classInfo()->methodTable.getPrototype; 3041 MethodTable::GetPrototypeFunctionPtr defaultGetPrototype = JSObject::getPrototype; 3042 if (getPrototypeMethod != defaultGetPrototype) { 3043 canFold = false; 3044 return; 3045 } 3046 3047 if (structure->hasPolyProto()) { 3048 canFold = false; 3049 return; 3050 } 3051 if (!prototype) 3052 prototype = structure->storedPrototype(); 3053 else if (prototype != structure->storedPrototype()) 3054 canFold = false; 3055 }); 3056 3057 // OK, only one prototype is found. We perform constant folding here. 3058 // This information is important for super's constructor call to get new.target constant. 3059 if (prototype && canFold) { 3060 set(VirtualRegister(resultOperand), weakJSConstant(prototype)); 3061 return true; 3062 } 3063 3064 set(VirtualRegister(resultOperand), addToGraph(GetPrototypeOf, OpInfo(0), OpInfo(prediction), thisNode)); 3013 3065 return true; 3014 3066 } … … 3797 3849 Node* getter = addToGraph(GetGetter, loadedValue); 3798 3850 3799 if (handleIntrinsicGetter(destinationOperand, variant, base,3851 if (handleIntrinsicGetter(destinationOperand, prediction, variant, base, 3800 3852 [&] () { 3801 3853 addToGraph(CheckCell, OpInfo(m_graph.freeze(variant.intrinsicFunction())), getter);
Note:
See TracChangeset
for help on using the changeset viewer.