Changeset 201322 in webkit
- Timestamp:
- May 23, 2016 11:24:44 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r198023 r201322 212 212 213 213 JSValue getStaticValue(ExecState*, PropertyName); 214 static EncodedJSValue staticFunctionGetter(ExecState*, EncodedJSValue, PropertyName );215 static EncodedJSValue callbackGetter(ExecState*, EncodedJSValue, PropertyName );214 static EncodedJSValue staticFunctionGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 215 static EncodedJSValue callbackGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 216 216 217 217 std::unique_ptr<JSCallbackObjectData> m_callbackObjectData; -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r198023 r201322 600 600 601 601 template <class Parent> 602 EncodedJSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )602 EncodedJSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 603 603 { 604 604 JSCallbackObject* thisObj = asCallbackObject(thisValue); … … 628 628 629 629 template <class Parent> 630 EncodedJSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )630 EncodedJSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 631 631 { 632 632 JSCallbackObject* thisObj = asCallbackObject(thisValue); -
trunk/Source/JavaScriptCore/ChangeLog
r201315 r201322 1 2016-05-23 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver 4 https://bugs.webkit.org/show_bug.cgi?id=157080 5 6 Reviewed by Saam Barati. 7 8 In custom accessor getter, the argument "thisValue" can be altered by using `Reflect.get`. 9 In this patch, we add a new parameter, "slotBase". This represents the base value offering 10 this custom getter. And use it in ProxyObject's performGet custom accessor getter. 11 12 * API/JSCallbackObject.h: 13 * API/JSCallbackObjectFunctions.h: 14 (JSC::JSCallbackObject<Parent>::staticFunctionGetter): 15 (JSC::JSCallbackObject<Parent>::callbackGetter): 16 * bytecode/PolymorphicAccess.cpp: 17 (JSC::AccessCase::generateImpl): 18 In PolymorphicAccess case, the thisValue and the slotBase are always cells. 19 This is because IC is enabled in the case that the base value is a cell. 20 And slotBase is always on the prototype chain from this base value. 21 22 * jit/CCallHelpers.h: 23 (JSC::CCallHelpers::setupArgumentsWithExecState): 24 * jsc.cpp: 25 (WTF::CustomGetter::customGetter): 26 (WTF::RuntimeArray::lengthGetter): 27 * runtime/CustomGetterSetter.cpp: 28 (JSC::callCustomSetter): 29 * runtime/JSBoundSlotBaseFunction.cpp: 30 (JSC::boundSlotBaseFunctionCall): 31 * runtime/JSFunction.cpp: 32 (JSC::JSFunction::argumentsGetter): 33 (JSC::JSFunction::callerGetter): 34 * runtime/JSFunction.h: 35 * runtime/JSModuleNamespaceObject.cpp: 36 (JSC::callbackGetter): 37 * runtime/PropertySlot.cpp: 38 (JSC::PropertySlot::customGetter): 39 * runtime/PropertySlot.h: 40 * runtime/ProxyObject.cpp: 41 (JSC::performProxyGet): 42 * runtime/RegExpConstructor.cpp: 43 (JSC::regExpConstructorDollar): 44 (JSC::regExpConstructorInput): 45 (JSC::regExpConstructorMultiline): 46 (JSC::regExpConstructorLastMatch): 47 (JSC::regExpConstructorLastParen): 48 (JSC::regExpConstructorLeftContext): 49 (JSC::regExpConstructorRightContext): 50 (JSC::regExpConstructorDollar1): Deleted. 51 (JSC::regExpConstructorDollar2): Deleted. 52 (JSC::regExpConstructorDollar3): Deleted. 53 (JSC::regExpConstructorDollar4): Deleted. 54 (JSC::regExpConstructorDollar5): Deleted. 55 (JSC::regExpConstructorDollar6): Deleted. 56 (JSC::regExpConstructorDollar7): Deleted. 57 (JSC::regExpConstructorDollar8): Deleted. 58 (JSC::regExpConstructorDollar9): Deleted. 59 * tests/stress/proxy-get-with-primitive-receiver.js: Added. 60 (shouldBe): 61 1 62 2016-05-23 Geoffrey Garen <ggaren@apple.com> 2 63 -
trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
r201161 r201322 1085 1085 jit.makeSpaceOnStackForCCall(); 1086 1086 1087 // getter: EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue thisValue, PropertyName );1087 // getter: EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue thisValue, PropertyName, JSObject* slotBase); 1088 1088 // setter: void (*PutValueFunc)(ExecState*, EncodedJSValue thisObject, EncodedJSValue value); 1089 1089 // Custom values are passed the slotBase (the property holder), custom accessors are passed the thisVaule (reciever). 1090 // FIXME: Remove this differences in custom values and custom accessors. 1091 // https://bugs.webkit.org/show_bug.cgi?id=158014 1090 1092 GPRReg baseForCustomValue = m_type == CustomValueGetter || m_type == CustomValueSetter ? baseForAccessGPR : baseForGetGPR; 1091 1093 #if USE(JSVALUE64) … … 1093 1095 jit.setupArgumentsWithExecState( 1094 1096 baseForCustomValue, 1095 CCallHelpers::TrustedImmPtr(ident.impl())); 1097 CCallHelpers::TrustedImmPtr(ident.impl()), 1098 baseForAccessGPR); 1096 1099 } else 1097 1100 jit.setupArgumentsWithExecState(baseForCustomValue, valueRegs.gpr()); … … 1101 1104 EABI_32BIT_DUMMY_ARG baseForCustomValue, 1102 1105 CCallHelpers::TrustedImm32(JSValue::CellTag), 1103 CCallHelpers::TrustedImmPtr(ident.impl())); 1106 CCallHelpers::TrustedImmPtr(ident.impl()), 1107 baseForAccessGPR); 1104 1108 } else { 1105 1109 jit.setupArgumentsWithExecState( -
trunk/Source/JavaScriptCore/jit/CCallHelpers.h
r201161 r201322 708 708 709 709 ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImmPtr arg1, GPRReg arg2, TrustedImm32 arg3, TrustedImmPtr arg4) 710 { 711 resetCallArguments(); 712 addCallArgument(GPRInfo::callFrameRegister); 713 addCallArgument(arg1); 714 addCallArgument(arg2); 715 addCallArgument(arg3); 716 addCallArgument(arg4); 717 } 718 719 ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm32 arg2, TrustedImmPtr arg3, GPRReg arg4) 710 720 { 711 721 resetCallArguments(); … … 1685 1695 } 1686 1696 1697 ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm32 arg2, TrustedImmPtr arg3, GPRReg arg4) 1698 { 1699 poke(arg4, POKE_ARGUMENT_OFFSET); 1700 setupArgumentsWithExecState(arg1, arg2, arg3); 1701 } 1702 1687 1703 ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32 arg3, TrustedImm32 arg4, TrustedImm32 arg5) 1688 1704 { … … 2035 2051 2036 2052 ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, GPRReg arg2, TrustedImm32 arg3, GPRReg arg4, TrustedImm32 arg5) 2053 { 2054 poke(arg5, POKE_ARGUMENT_OFFSET + 1); 2055 poke(arg4, POKE_ARGUMENT_OFFSET); 2056 setupArgumentsWithExecState(arg1, arg2, arg3); 2057 } 2058 2059 ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, GPRReg arg2, TrustedImm32 arg3, TrustedImmPtr arg4, GPRReg arg5) 2037 2060 { 2038 2061 poke(arg5, POKE_ARGUMENT_OFFSET + 1); -
trunk/Source/JavaScriptCore/jsc.cpp
r201237 r201322 359 359 360 360 private: 361 static EncodedJSValue customGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName )361 static EncodedJSValue customGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 362 362 { 363 363 CustomGetter* thisObject = jsDynamicCast<CustomGetter*>(JSValue::decode(thisValue)); … … 464 464 } 465 465 466 static EncodedJSValue lengthGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName )466 static EncodedJSValue lengthGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 467 467 { 468 468 RuntimeArray* thisObject = jsDynamicCast<RuntimeArray*>(JSValue::decode(thisValue)); -
trunk/Source/JavaScriptCore/runtime/CustomGetterSetter.cpp
r198023 r201322 54 54 if (!setter) 55 55 return false; 56 // FIXME: Remove this differences in custom values and custom accessors. 57 // https://bugs.webkit.org/show_bug.cgi?id=158014 56 58 if (!isAccessor) 57 59 thisValue = base; -
trunk/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp
r200430 r201322 52 52 53 53 const String& name = boundSlotBaseFunction->name(); 54 return getter(exec, JSValue::encode(exec->thisValue()), PropertyName(Identifier::fromString(exec, name)) );54 return getter(exec, JSValue::encode(exec->thisValue()), PropertyName(Identifier::fromString(exec, name)), baseObject); 55 55 } 56 56 -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r200694 r201322 265 265 } 266 266 267 EncodedJSValue JSFunction::argumentsGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName )267 EncodedJSValue JSFunction::argumentsGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 268 268 { 269 269 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(thisValue)); … … 327 327 } 328 328 329 EncodedJSValue JSFunction::callerGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName )329 EncodedJSValue JSFunction::callerGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 330 330 { 331 331 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(thisValue)); -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r198288 r201322 199 199 friend class LLIntOffsetsExtractor; 200 200 201 static EncodedJSValue argumentsGetter(ExecState*, EncodedJSValue, PropertyName); 202 static EncodedJSValue callerGetter(ExecState*, EncodedJSValue, PropertyName); 203 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, PropertyName); 204 static EncodedJSValue nameGetter(ExecState*, EncodedJSValue, PropertyName); 201 static EncodedJSValue argumentsGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 202 static EncodedJSValue callerGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 205 203 206 204 WriteBarrier<ExecutableBase> m_executable; -
trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp
r198023 r201322 98 98 } 99 99 100 static EncodedJSValue callbackGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )100 static EncodedJSValue callbackGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 101 101 { 102 102 JSModuleNamespaceObject* thisObject = jsCast<JSModuleNamespaceObject*>(JSValue::decode(thisValue)); -
trunk/Source/JavaScriptCore/runtime/PropertySlot.cpp
r199170 r201322 36 36 JSValue PropertySlot::customGetter(ExecState* exec, PropertyName propertyName) const 37 37 { 38 // FIXME: Remove this differences in custom values and custom accessors. 39 // https://bugs.webkit.org/show_bug.cgi?id=158014 38 40 JSValue thisValue = m_attributes & CustomAccessor ? m_thisValue : JSValue(slotBase()); 39 return JSValue::decode(m_data.custom.getValue(exec, JSValue::encode(thisValue), propertyName ));41 return JSValue::decode(m_data.custom.getValue(exec, JSValue::encode(thisValue), propertyName, slotBase())); 40 42 } 41 43 -
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r200430 r201322 95 95 } 96 96 97 typedef EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue thisValue, PropertyName); 97 // There are two types of custom properties: custom values and custom accessors. 98 // For the second argument, custom values are passed the slotBase (the property holder), custom accessors are passed the thisVaule (reciever). 99 // And when getting the property descriptor from these properties, custom values return the data descriptor while custom accessors return the accessor descriptor. 100 // FIXME: Remove this slotBase / receiver behavior difference in custom values and custom accessors. 101 // https://bugs.webkit.org/show_bug.cgi?id=158014 102 typedef EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue thisValue, PropertyName, JSObject* slotBase); 98 103 99 104 JSValue getValue(ExecState*, PropertyName) const; -
trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp
r199170 r201322 93 93 static const char* s_proxyAlreadyRevokedErrorMessage = "Proxy has already been revoked. No more operations are allowed to be performed on it"; 94 94 95 static EncodedJSValue performProxyGet(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )95 static EncodedJSValue performProxyGet(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject* slotBase) 96 96 { 97 97 VM& vm = exec->vm(); … … 101 101 } 102 102 103 JSObject* thisObject = jsCast<JSObject*>(JSValue::decode(thisValue)); // This might be a value where somewhere in __proto__ chain lives a ProxyObject. 104 JSObject* proxyObjectAsObject = thisObject; 105 // FIXME: make it so that custom getters take both the |this| value and the slotBase (property holder). 106 // https://bugs.webkit.org/show_bug.cgi?id=154320 107 while (true) { 108 if (LIKELY(proxyObjectAsObject->type() == ProxyObjectType)) 109 break; 110 111 JSValue prototype = proxyObjectAsObject->getPrototypeDirect(); 112 RELEASE_ASSERT(prototype.isObject()); 113 proxyObjectAsObject = asObject(prototype); 114 } 115 116 ProxyObject* proxyObject = jsCast<ProxyObject*>(proxyObjectAsObject); 103 ProxyObject* proxyObject = jsCast<ProxyObject*>(slotBase); 117 104 JSObject* target = proxyObject->target(); 118 105 … … 144 131 arguments.append(target); 145 132 arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&vm, propertyName.uid()))); 146 arguments.append( thisObject);133 arguments.append(JSValue::decode(thisValue)); 147 134 JSValue trapResult = call(exec, getHandler, callType, callData, handler, arguments); 148 135 if (exec->hadException()) -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r199144 r201322 32 32 namespace JSC { 33 33 34 static EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue, PropertyName); 35 static EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue, PropertyName); 36 static EncodedJSValue regExpConstructorLastMatch(ExecState*, EncodedJSValue, PropertyName); 37 static EncodedJSValue regExpConstructorLastParen(ExecState*, EncodedJSValue, PropertyName); 38 static EncodedJSValue regExpConstructorLeftContext(ExecState*, EncodedJSValue, PropertyName); 39 static EncodedJSValue regExpConstructorRightContext(ExecState*, EncodedJSValue, PropertyName); 40 static EncodedJSValue regExpConstructorDollar1(ExecState*, EncodedJSValue, PropertyName); 41 static EncodedJSValue regExpConstructorDollar2(ExecState*, EncodedJSValue, PropertyName); 42 static EncodedJSValue regExpConstructorDollar3(ExecState*, EncodedJSValue, PropertyName); 43 static EncodedJSValue regExpConstructorDollar4(ExecState*, EncodedJSValue, PropertyName); 44 static EncodedJSValue regExpConstructorDollar5(ExecState*, EncodedJSValue, PropertyName); 45 static EncodedJSValue regExpConstructorDollar6(ExecState*, EncodedJSValue, PropertyName); 46 static EncodedJSValue regExpConstructorDollar7(ExecState*, EncodedJSValue, PropertyName); 47 static EncodedJSValue regExpConstructorDollar8(ExecState*, EncodedJSValue, PropertyName); 48 static EncodedJSValue regExpConstructorDollar9(ExecState*, EncodedJSValue, PropertyName); 34 static EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue, PropertyName, JSObject*); 35 static EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue, PropertyName, JSObject*); 36 static EncodedJSValue regExpConstructorLastMatch(ExecState*, EncodedJSValue, PropertyName, JSObject*); 37 static EncodedJSValue regExpConstructorLastParen(ExecState*, EncodedJSValue, PropertyName, JSObject*); 38 static EncodedJSValue regExpConstructorLeftContext(ExecState*, EncodedJSValue, PropertyName, JSObject*); 39 static EncodedJSValue regExpConstructorRightContext(ExecState*, EncodedJSValue, PropertyName, JSObject*); 40 template<int N> 41 static EncodedJSValue regExpConstructorDollar(ExecState*, EncodedJSValue, PropertyName, JSObject*); 49 42 50 43 static bool setRegExpConstructorInput(ExecState*, EncodedJSValue, EncodedJSValue); … … 73 66 rightContext regExpConstructorRightContext DontDelete|ReadOnly 74 67 $' regExpConstructorRightContext DontDelete|ReadOnly|DontEnum 75 $1 regExpConstructorDollar 1DontDelete|ReadOnly76 $2 regExpConstructorDollar 2DontDelete|ReadOnly77 $3 regExpConstructorDollar 3DontDelete|ReadOnly78 $4 regExpConstructorDollar 4DontDelete|ReadOnly79 $5 regExpConstructorDollar 5DontDelete|ReadOnly80 $6 regExpConstructorDollar 6DontDelete|ReadOnly81 $7 regExpConstructorDollar 7DontDelete|ReadOnly82 $8 regExpConstructorDollar 8DontDelete|ReadOnly83 $9 regExpConstructorDollar 9DontDelete|ReadOnly68 $1 regExpConstructorDollar<1> DontDelete|ReadOnly 69 $2 regExpConstructorDollar<2> DontDelete|ReadOnly 70 $3 regExpConstructorDollar<3> DontDelete|ReadOnly 71 $4 regExpConstructorDollar<4> DontDelete|ReadOnly 72 $5 regExpConstructorDollar<5> DontDelete|ReadOnly 73 $6 regExpConstructorDollar<6> DontDelete|ReadOnly 74 $7 regExpConstructorDollar<7> DontDelete|ReadOnly 75 $8 regExpConstructorDollar<8> DontDelete|ReadOnly 76 $9 regExpConstructorDollar<9> DontDelete|ReadOnly 84 77 @end 85 78 */ … … 158 151 return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, regExpConstructorTable, jsCast<RegExpConstructor*>(object), propertyName, slot); 159 152 } 160 161 EncodedJSValue regExpConstructorDollar1(ExecState* exec, EncodedJSValue thisValue, PropertyName) 162 { 163 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 1)); 164 } 165 166 EncodedJSValue regExpConstructorDollar2(ExecState* exec, EncodedJSValue thisValue, PropertyName) 167 { 168 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 2)); 169 } 170 171 EncodedJSValue regExpConstructorDollar3(ExecState* exec, EncodedJSValue thisValue, PropertyName) 172 { 173 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 3)); 174 } 175 176 EncodedJSValue regExpConstructorDollar4(ExecState* exec, EncodedJSValue thisValue, PropertyName) 177 { 178 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 4)); 179 } 180 181 EncodedJSValue regExpConstructorDollar5(ExecState* exec, EncodedJSValue thisValue, PropertyName) 182 { 183 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 5)); 184 } 185 186 EncodedJSValue regExpConstructorDollar6(ExecState* exec, EncodedJSValue thisValue, PropertyName) 187 { 188 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 6)); 189 } 190 191 EncodedJSValue regExpConstructorDollar7(ExecState* exec, EncodedJSValue thisValue, PropertyName) 192 { 193 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 7)); 194 } 195 196 EncodedJSValue regExpConstructorDollar8(ExecState* exec, EncodedJSValue thisValue, PropertyName) 197 { 198 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 8)); 199 } 200 201 EncodedJSValue regExpConstructorDollar9(ExecState* exec, EncodedJSValue thisValue, PropertyName) 202 { 203 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 9)); 204 } 205 206 EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue thisValue, PropertyName) 153 154 template<int N> 155 EncodedJSValue regExpConstructorDollar(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 156 { 157 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, N)); 158 } 159 160 EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue thisValue, PropertyName, JSObject*) 207 161 { 208 162 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->input()); 209 163 } 210 164 211 EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue thisValue, PropertyName )165 EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue thisValue, PropertyName, JSObject*) 212 166 { 213 167 return JSValue::encode(jsBoolean(asRegExpConstructor(JSValue::decode(thisValue))->multiline())); 214 168 } 215 169 216 EncodedJSValue regExpConstructorLastMatch(ExecState* exec, EncodedJSValue thisValue, PropertyName )170 EncodedJSValue regExpConstructorLastMatch(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 217 171 { 218 172 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getBackref(exec, 0)); 219 173 } 220 174 221 EncodedJSValue regExpConstructorLastParen(ExecState* exec, EncodedJSValue thisValue, PropertyName )175 EncodedJSValue regExpConstructorLastParen(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 222 176 { 223 177 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getLastParen(exec)); 224 178 } 225 179 226 EncodedJSValue regExpConstructorLeftContext(ExecState* exec, EncodedJSValue thisValue, PropertyName )180 EncodedJSValue regExpConstructorLeftContext(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 227 181 { 228 182 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getLeftContext(exec)); 229 183 } 230 184 231 EncodedJSValue regExpConstructorRightContext(ExecState* exec, EncodedJSValue thisValue, PropertyName )185 EncodedJSValue regExpConstructorRightContext(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 232 186 { 233 187 return JSValue::encode(asRegExpConstructor(JSValue::decode(thisValue))->getRightContext(exec)); -
trunk/Source/WebCore/ChangeLog
r201318 r201322 1 2016-05-23 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver 4 https://bugs.webkit.org/show_bug.cgi?id=157080 5 6 Reviewed by Saam Barati. 7 8 * bindings/js/JSDOMBinding.h: 9 (WebCore::nonCachingStaticFunctionGetter): 10 * bindings/js/JSDOMWindowCustom.cpp: 11 (WebCore::jsDOMWindowWebKit): 12 * bindings/js/JSPluginElementFunctions.cpp: 13 (WebCore::pluginElementPropertyGetter): 14 * bindings/js/JSPluginElementFunctions.h: 15 * bindings/scripts/CodeGeneratorJS.pm: 16 (GenerateHeader): 17 (GenerateImplementation): 18 * bridge/runtime_array.cpp: 19 (JSC::RuntimeArray::lengthGetter): 20 * bridge/runtime_array.h: 21 * bridge/runtime_method.cpp: 22 (JSC::RuntimeMethod::lengthGetter): 23 * bridge/runtime_method.h: 24 * bridge/runtime_object.cpp: 25 (JSC::Bindings::RuntimeObject::fallbackObjectGetter): 26 (JSC::Bindings::RuntimeObject::fieldGetter): 27 (JSC::Bindings::RuntimeObject::methodGetter): 28 * bridge/runtime_object.h: 29 1 30 2016-05-23 Alex Christensen <achristensen@webkit.org> 2 31 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r201253 r201322 306 306 307 307 template<typename DOMClass> const JSC::HashTableValue* getStaticValueSlotEntryWithoutCaching(JSC::ExecState*, JSC::PropertyName); 308 template<JSC::NativeFunction, int length> JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName );308 template<JSC::NativeFunction, int length> JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*); 309 309 310 310 // Inline functions and template definitions. … … 785 785 } 786 786 787 template<JSC::NativeFunction nativeFunction, int length> JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState* exec, JSC::EncodedJSValue, JSC::PropertyName propertyName )787 template<JSC::NativeFunction nativeFunction, int length> JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState* exec, JSC::EncodedJSValue, JSC::PropertyName propertyName, JSC::JSObject*) 788 788 { 789 789 return JSC::JSValue::encode(JSC::JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction)); -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r200788 r201322 63 63 64 64 #if ENABLE(USER_MESSAGE_HANDLERS) 65 static EncodedJSValue jsDOMWindowWebKit(ExecState* exec, EncodedJSValue thisValue, PropertyName )65 static EncodedJSValue jsDOMWindowWebKit(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 66 66 { 67 67 JSDOMWindow* castedThis = toJSDOMWindow(JSValue::decode(thisValue)); -
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
r198023 r201322 95 95 } 96 96 97 EncodedJSValue pluginElementPropertyGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )97 EncodedJSValue pluginElementPropertyGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 98 98 { 99 99 -
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.h
r198023 r201322 39 39 WEBCORE_EXPORT JSC::JSObject* pluginScriptObject(JSC::ExecState*, JSHTMLElement*); 40 40 41 JSC::EncodedJSValue pluginElementPropertyGetter(JSC::ExecState*, 42 JSC::EncodedJSValue, JSC::PropertyName); 41 JSC::EncodedJSValue pluginElementPropertyGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*); 43 42 bool pluginElementCustomGetOwnPropertySlot(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&, JSHTMLElement*); 44 43 bool pluginElementCustomPut(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSHTMLElement*, JSC::PutPropertySlot&, bool& putResult); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r201318 r201322 1508 1508 push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; 1509 1509 my $getter = GetAttributeGetterName($interface, $className, $attribute); 1510 push(@headerContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName );\n");1510 push(@headerContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*);\n"); 1511 1511 if (!IsReadonly($attribute)) { 1512 1512 my $setter = GetAttributeSetterName($interface, $className, $attribute); … … 2069 2069 push(@implContent, "#if ${conditionalString}\n") if $conditionalString; 2070 2070 my $getter = GetAttributeGetterName($interface, $className, $attribute); 2071 push(@implContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName );\n");2071 push(@implContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*);\n"); 2072 2072 if (!IsReadonly($attribute)) { 2073 2073 my $setter = GetAttributeSetterName($interface, $className, $attribute); … … 2079 2079 if (NeedsConstructorProperty($interface)) { 2080 2080 my $getter = "js" . $interfaceName . "Constructor"; 2081 push(@implContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName );\n");2081 push(@implContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*);\n"); 2082 2082 } 2083 2083 … … 2539 2539 push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; 2540 2540 2541 push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName )\n");2541 push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName, JSObject* slotBase)\n"); 2542 2542 push(@implContent, "{\n"); 2543 2543 2544 2544 push(@implContent, " UNUSED_PARAM(state);\n"); 2545 2545 push(@implContent, " UNUSED_PARAM(thisValue);\n"); 2546 push(@implContent, " UNUSED_PARAM(slotBase);\n"); 2546 2547 2547 2548 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { … … 2742 2743 my $constructorFunctionName = "js" . $interfaceName . "Constructor"; 2743 2744 2744 push(@implContent, "EncodedJSValue ${constructorFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName )\n");2745 push(@implContent, "EncodedJSValue ${constructorFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName, JSObject*)\n"); 2745 2746 push(@implContent, "{\n"); 2746 2747 push(@implContent, " ${className}Prototype* domObject = jsDynamicCast<${className}Prototype*>(JSValue::decode(thisValue));\n"); -
trunk/Source/WebCore/bridge/runtime_array.cpp
r198023 r201322 61 61 } 62 62 63 EncodedJSValue RuntimeArray::lengthGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName )63 EncodedJSValue RuntimeArray::lengthGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 64 64 { 65 65 RuntimeArray* thisObject = jsDynamicCast<RuntimeArray*>(JSValue::decode(thisValue)); -
trunk/Source/WebCore/bridge/runtime_array.h
r199164 r201322 84 84 private: 85 85 RuntimeArray(ExecState*, Structure*); 86 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, PropertyName );86 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 87 87 88 88 BindingsArray* m_array; -
trunk/Source/WebCore/bridge/runtime_method.cpp
r197614 r201322 55 55 } 56 56 57 EncodedJSValue RuntimeMethod::lengthGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName )57 EncodedJSValue RuntimeMethod::lengthGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName, JSObject*) 58 58 { 59 59 RuntimeMethod* thisObject = jsDynamicCast<RuntimeMethod*>(JSValue::decode(thisValue)); -
trunk/Source/WebCore/bridge/runtime_method.h
r196331 r201322 67 67 68 68 private: 69 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, PropertyName );69 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 70 70 71 71 Bindings::Method* m_method; -
trunk/Source/WebCore/bridge/runtime_object.cpp
r198023 r201322 63 63 } 64 64 65 EncodedJSValue RuntimeObject::fallbackObjectGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )65 EncodedJSValue RuntimeObject::fallbackObjectGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 66 66 { 67 67 RuntimeObject* thisObj = jsCast<RuntimeObject*>(JSValue::decode(thisValue)); … … 81 81 } 82 82 83 EncodedJSValue RuntimeObject::fieldGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )83 EncodedJSValue RuntimeObject::fieldGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 84 84 { 85 85 RuntimeObject* thisObj = jsCast<RuntimeObject*>(JSValue::decode(thisValue)); … … 100 100 } 101 101 102 EncodedJSValue RuntimeObject::methodGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )102 EncodedJSValue RuntimeObject::methodGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 103 103 { 104 104 RuntimeObject* thisObj = jsCast<RuntimeObject*>(JSValue::decode(thisValue)); -
trunk/Source/WebCore/bridge/runtime_object.h
r198023 r201322 79 79 80 80 private: 81 static EncodedJSValue fallbackObjectGetter(ExecState*, EncodedJSValue, PropertyName );82 static EncodedJSValue fieldGetter(ExecState*, EncodedJSValue, PropertyName );83 static EncodedJSValue methodGetter(ExecState*, EncodedJSValue, PropertyName );81 static EncodedJSValue fallbackObjectGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 82 static EncodedJSValue fieldGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 83 static EncodedJSValue methodGetter(ExecState*, EncodedJSValue, PropertyName, JSObject*); 84 84 85 85 RefPtr<Instance> m_instance; -
trunk/Source/WebKit2/ChangeLog
r201305 r201322 1 2016-05-23 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver 4 https://bugs.webkit.org/show_bug.cgi?id=157080 5 6 Reviewed by Saam Barati. 7 8 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 9 (WebKit::JSNPObject::propertyGetter): 10 (WebKit::JSNPObject::methodGetter): 11 * WebProcess/Plugins/Netscape/JSNPObject.h: 12 1 13 2016-05-23 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r198023 r201322 436 436 } 437 437 438 EncodedJSValue JSNPObject::propertyGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )438 EncodedJSValue JSNPObject::propertyGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 439 439 { 440 440 JSNPObject* thisObj = jsCast<JSNPObject*>(JSValue::decode(thisValue)); … … 476 476 } 477 477 478 EncodedJSValue JSNPObject::methodGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName )478 EncodedJSValue JSNPObject::methodGetter(ExecState* exec, EncodedJSValue thisValue, PropertyName propertyName, JSObject*) 479 479 { 480 480 JSNPObject* thisObj = jsCast<JSNPObject*>(JSValue::decode(thisValue)); -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r198023 r201322 95 95 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode); 96 96 97 static JSC::EncodedJSValue propertyGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName );98 static JSC::EncodedJSValue methodGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName );97 static JSC::EncodedJSValue propertyGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*); 98 static JSC::EncodedJSValue methodGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName, JSC::JSObject*); 99 99 static JSC::JSObject* throwInvalidAccessError(JSC::ExecState*); 100 100
Note: See TracChangeset
for help on using the changeset viewer.