Changeset 223584 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Oct 17, 2017, 4:34:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r223523 r223584 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, SpeculatedType prediction,const GetByIdVariant& intrinsicVariant, Node* thisNode, const ChecksFunctor& insertChecks);241 bool handleIntrinsicGetter(int resultOperand, 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 2620 2602 case IsTypedArrayViewIntrinsic: { 2621 2603 ASSERT(argumentCountIncludingThis == 2); … … 2965 2947 2966 2948 template<typename ChecksFunctor> 2967 bool ByteCodeParser::handleIntrinsicGetter(int resultOperand, SpeculatedType prediction,const GetByIdVariant& variant, Node* thisNode, const ChecksFunctor& insertChecks)2949 bool ByteCodeParser::handleIntrinsicGetter(int resultOperand, const GetByIdVariant& variant, Node* thisNode, const ChecksFunctor& insertChecks) 2968 2950 { 2969 2951 switch (variant.intrinsic()) { … … 3029 3011 set(VirtualRegister(resultOperand), addToGraph(GetTypedArrayByteOffset, OpInfo(ArrayMode(arrayType).asWord()), thisNode)); 3030 3012 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));3065 3013 return true; 3066 3014 } … … 3849 3797 Node* getter = addToGraph(GetGetter, loadedValue); 3850 3798 3851 if (handleIntrinsicGetter(destinationOperand, prediction,variant, base,3799 if (handleIntrinsicGetter(destinationOperand, variant, base, 3852 3800 [&] () { 3853 3801 addToGraph(CheckCell, OpInfo(m_graph.freeze(variant.intrinsicFunction())), getter);
Note:
See TracChangeset
for help on using the changeset viewer.