Changeset 160133 in webkit
- Timestamp:
- Dec 4, 2013 3:20:48 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r157044 r160133 206 206 207 207 static JSCallbackObject* asCallbackObject(JSValue); 208 static JSCallbackObject* asCallbackObject(EncodedJSValue); 208 209 209 210 static EncodedJSValue JSC_HOST_CALL call(ExecState*); … … 211 212 212 213 JSValue getStaticValue(ExecState*, PropertyName); 213 static JSValue staticFunctionGetter(ExecState*,JSValue, PropertyName);214 static JSValue callbackGetter(ExecState*,JSValue, PropertyName);214 static EncodedJSValue staticFunctionGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 215 static EncodedJSValue callbackGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 215 216 216 217 OwnPtr<JSCallbackObjectData> m_callbackObjectData; -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r156964 r160133 51 51 52 52 template <class Parent> 53 inline JSCallbackObject<Parent>* JSCallbackObject<Parent>::asCallbackObject(EncodedJSValue value) 54 { 55 ASSERT(asObject(JSValue::decode(value))->inherits(info())); 56 return jsCast<JSCallbackObject*>(asObject(JSValue::decode(value))); 57 } 58 59 template <class Parent> 53 60 JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, Structure* structure, JSClassRef jsClass, void* data) 54 61 : Parent(exec->vm(), structure) … … 585 592 586 593 template <class Parent> 587 JSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, JSValue slotParent, PropertyName propertyName)594 EncodedJSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, EncodedJSValue slotParent, EncodedJSValue, PropertyName propertyName) 588 595 { 589 596 JSCallbackObject* thisObj = asCallbackObject(slotParent); … … 592 599 PropertySlot slot2(thisObj); 593 600 if (Parent::getOwnPropertySlot(thisObj, exec, propertyName, slot2)) 594 return slot2.getValue(exec, propertyName);601 return JSValue::encode(slot2.getValue(exec, propertyName)); 595 602 596 603 if (StringImpl* name = propertyName.publicName()) { … … 602 609 JSObject* o = JSCallbackFunction::create(vm, thisObj->globalObject(), callAsFunction, name); 603 610 thisObj->putDirect(vm, propertyName, o, entry->attributes); 604 return o;611 return JSValue::encode(o); 605 612 } 606 613 } … … 609 616 } 610 617 611 return exec->vm().throwException(exec, createReferenceError(exec, ASCIILiteral("Static function property defined with NULL callAsFunction callback.")));612 } 613 614 template <class Parent> 615 JSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, JSValue slotParent, PropertyName propertyName)618 return JSValue::encode(exec->vm().throwException(exec, createReferenceError(exec, ASCIILiteral("Static function property defined with NULL callAsFunction callback.")))); 619 } 620 621 template <class Parent> 622 EncodedJSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, EncodedJSValue slotParent, EncodedJSValue, PropertyName propertyName) 616 623 { 617 624 JSCallbackObject* thisObj = asCallbackObject(slotParent); … … 633 640 if (exception) { 634 641 exec->vm().throwException(exec, toJS(exec, exception)); 635 return jsUndefined();642 return JSValue::encode(jsUndefined()); 636 643 } 637 644 if (value) 638 return toJS(exec, value);639 } 640 } 641 } 642 643 return exec->vm().throwException(exec, createReferenceError(exec, ASCIILiteral("hasProperty callback returned true for a property that doesn't exist.")));645 return JSValue::encode(toJS(exec, value)); 646 } 647 } 648 } 649 650 return JSValue::encode(exec->vm().throwException(exec, createReferenceError(exec, ASCIILiteral("hasProperty callback returned true for a property that doesn't exist.")))); 644 651 } 645 652 -
trunk/Source/JavaScriptCore/ChangeLog
r160131 r160133 1 2013-12-04 Oliver Hunt <oliver@apple.com> 2 3 Refactor static getter function prototype to include thisValue in addition to the base object 4 https://bugs.webkit.org/show_bug.cgi?id=124461 5 6 Reviewed by Geoffrey Garen. 7 8 Add thisValue parameter to static getter prototype, and switch 9 from JSValue to EncodedJSValue for parameters and return value. 10 11 Currently none of the static getters use the thisValue, but 12 separating out the refactoring will prevent future changes 13 from getting lost in the noise of refactoring. This means 14 that this patch does not result in any change in behaviour. 15 16 * API/JSCallbackObject.h: 17 * API/JSCallbackObjectFunctions.h: 18 (JSC::::asCallbackObject): 19 (JSC::::staticFunctionGetter): 20 (JSC::::callbackGetter): 21 * jit/JITOperations.cpp: 22 * runtime/JSActivation.cpp: 23 (JSC::JSActivation::argumentsGetter): 24 * runtime/JSActivation.h: 25 * runtime/JSFunction.cpp: 26 (JSC::JSFunction::argumentsGetter): 27 (JSC::JSFunction::callerGetter): 28 (JSC::JSFunction::lengthGetter): 29 (JSC::JSFunction::nameGetter): 30 * runtime/JSFunction.h: 31 * runtime/JSObject.h: 32 (JSC::PropertySlot::getValue): 33 * runtime/NumberConstructor.cpp: 34 (JSC::numberConstructorNaNValue): 35 (JSC::numberConstructorNegInfinity): 36 (JSC::numberConstructorPosInfinity): 37 (JSC::numberConstructorMaxValue): 38 (JSC::numberConstructorMinValue): 39 * runtime/PropertySlot.h: 40 * runtime/RegExpConstructor.cpp: 41 (JSC::asRegExpConstructor): 42 (JSC::regExpConstructorDollar1): 43 (JSC::regExpConstructorDollar2): 44 (JSC::regExpConstructorDollar3): 45 (JSC::regExpConstructorDollar4): 46 (JSC::regExpConstructorDollar5): 47 (JSC::regExpConstructorDollar6): 48 (JSC::regExpConstructorDollar7): 49 (JSC::regExpConstructorDollar8): 50 (JSC::regExpConstructorDollar9): 51 (JSC::regExpConstructorInput): 52 (JSC::regExpConstructorMultiline): 53 (JSC::regExpConstructorLastMatch): 54 (JSC::regExpConstructorLastParen): 55 (JSC::regExpConstructorLeftContext): 56 (JSC::regExpConstructorRightContext): 57 * runtime/RegExpObject.cpp: 58 (JSC::asRegExpObject): 59 (JSC::regExpObjectGlobal): 60 (JSC::regExpObjectIgnoreCase): 61 (JSC::regExpObjectMultiline): 62 (JSC::regExpObjectSource): 63 1 64 2013-12-04 Daniel Bates <dabates@apple.com> 2 65 -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r160094 r160133 223 223 Identifier ident(vm, uid); 224 224 225 return JSValue::encode(function(exec, asObject(base), ident));225 return function(exec, JSValue::encode(base), JSValue::encode(base), ident); 226 226 } 227 227 -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r156511 r160133 211 211 } 212 212 213 JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, PropertyName)214 { 215 JSActivation* activation = jsCast<JSActivation*>( slotBase);213 EncodedJSValue JSActivation::argumentsGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 214 { 215 JSActivation* activation = jsCast<JSActivation*>(JSValue::decode(slotBase)); 216 216 CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(activation->m_registers)); 217 217 ASSERT(!activation->isTornOff() && (callFrame->codeBlock()->usesArguments() || callFrame->codeBlock()->usesEval())); 218 218 if (activation->isTornOff() || !(callFrame->codeBlock()->usesArguments() || callFrame->codeBlock()->usesEval())) 219 return jsUndefined();219 return JSValue::encode(jsUndefined()); 220 220 221 221 VirtualRegister argumentsRegister = callFrame->codeBlock()->argumentsRegister(); 222 222 if (JSValue arguments = callFrame->uncheckedR(argumentsRegister.offset()).jsValue()) 223 return arguments;223 return JSValue::encode(arguments); 224 224 int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister).offset(); 225 225 … … 229 229 230 230 ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(Arguments::info())); 231 return callFrame->uncheckedR(realArgumentsRegister).jsValue();231 return JSValue::encode(callFrame->uncheckedR(realArgumentsRegister).jsValue()); 232 232 } 233 233 -
trunk/Source/JavaScriptCore/runtime/JSActivation.h
r159942 r160133 101 101 bool symbolTablePutWithAttributes(VM&, PropertyName, JSValue, unsigned attributes); 102 102 103 static JSValue argumentsGetter(ExecState*,JSValue, PropertyName);103 static EncodedJSValue argumentsGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 104 104 105 105 static size_t allocationSize(SymbolTable*); -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r159528 r160133 213 213 } 214 214 215 JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, PropertyName)216 { 217 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);215 EncodedJSValue JSFunction::argumentsGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 216 { 217 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 218 218 ASSERT(!thisObj->isHostFunction()); 219 219 220 return retrieveArguments(exec, thisObj);220 return JSValue::encode(retrieveArguments(exec, thisObj)); 221 221 } 222 222 … … 268 268 } 269 269 270 JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, PropertyName)271 { 272 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);270 EncodedJSValue JSFunction::callerGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 271 { 272 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 273 273 ASSERT(!thisObj->isHostFunction()); 274 274 JSValue caller = retrieveCallerFunction(exec, thisObj); … … 276 276 // See ES5.1 15.3.5.4 - Function.caller may not be used to retrieve a strict caller. 277 277 if (!caller.isObject() || !asObject(caller)->inherits(JSFunction::info())) 278 return caller;278 return JSValue::encode(caller); 279 279 JSFunction* function = jsCast<JSFunction*>(caller); 280 280 if (function->isHostFunction() || !function->jsExecutable()->isStrictMode()) 281 return caller;282 return throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller"));283 } 284 285 JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, PropertyName)286 { 287 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);281 return JSValue::encode(caller); 282 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller"))); 283 } 284 285 EncodedJSValue JSFunction::lengthGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 286 { 287 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 288 288 ASSERT(!thisObj->isHostFunction()); 289 return jsNumber(thisObj->jsExecutable()->parameterCount());290 } 291 292 JSValue JSFunction::nameGetter(ExecState*, JSValue slotBase, PropertyName)293 { 294 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);289 return JSValue::encode(jsNumber(thisObj->jsExecutable()->parameterCount())); 290 } 291 292 EncodedJSValue JSFunction::nameGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 293 { 294 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 295 295 ASSERT(!thisObj->isHostFunction()); 296 return thisObj->jsExecutable()->nameValue();296 return JSValue::encode(thisObj->jsExecutable()->nameValue()); 297 297 } 298 298 -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r160038 r160133 172 172 JS_EXPORT_PRIVATE bool isHostFunctionNonInline() const; 173 173 174 static JSValue argumentsGetter(ExecState*,JSValue, PropertyName);175 static JSValue callerGetter(ExecState*,JSValue, PropertyName);176 static JSValue lengthGetter(ExecState*,JSValue, PropertyName);177 static JSValue nameGetter(ExecState*,JSValue, PropertyName);174 static EncodedJSValue argumentsGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 175 static EncodedJSValue callerGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 176 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 177 static EncodedJSValue nameGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 178 178 179 179 WriteBarrier<ExecutableBase> m_executable; -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r157150 r160133 1536 1536 return JSValue::decode(m_data.value); 1537 1537 if (m_propertyType == TypeCustomIndex) 1538 return m_data.customIndex.getIndexValue(exec, slotBase(), m_data.customIndex.index);1538 return JSValue::decode(m_data.customIndex.getIndexValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), m_data.customIndex.index)); 1539 1539 if (m_propertyType == TypeGetter) 1540 1540 return functionGetter(exec); 1541 return m_data.custom.getValue(exec, slotBase(), propertyName);1541 return JSValue::decode(m_data.custom.getValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), propertyName)); 1542 1542 } 1543 1543 … … 1547 1547 return JSValue::decode(m_data.value); 1548 1548 if (m_propertyType == TypeCustomIndex) 1549 return m_data.customIndex.getIndexValue(exec, slotBase(), m_data.customIndex.index);1549 return JSValue::decode(m_data.customIndex.getIndexValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), m_data.customIndex.index)); 1550 1550 if (m_propertyType == TypeGetter) 1551 1551 return functionGetter(exec); 1552 return m_data.custom.getValue(exec, slotBase(), Identifier::from(exec, propertyName));1552 return JSValue::decode(m_data.custom.getValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), Identifier::from(exec, propertyName))); 1553 1553 } 1554 1554 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r156624 r160133 30 30 namespace JSC { 31 31 32 static JSValue numberConstructorNaNValue(ExecState*,JSValue, PropertyName);33 static JSValue numberConstructorNegInfinity(ExecState*,JSValue, PropertyName);34 static JSValue numberConstructorPosInfinity(ExecState*,JSValue, PropertyName);35 static JSValue numberConstructorMaxValue(ExecState*,JSValue, PropertyName);36 static JSValue numberConstructorMinValue(ExecState*,JSValue, PropertyName);32 static EncodedJSValue numberConstructorNaNValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 33 static EncodedJSValue numberConstructorNegInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 34 static EncodedJSValue numberConstructorPosInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 35 static EncodedJSValue numberConstructorMaxValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 36 static EncodedJSValue numberConstructorMinValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 37 37 38 38 } // namespace JSC … … 83 83 } 84 84 85 static JSValue numberConstructorNaNValue(ExecState*,JSValue, PropertyName)85 static EncodedJSValue numberConstructorNaNValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) 86 86 { 87 return jsNaN();87 return JSValue::encode(jsNaN()); 88 88 } 89 89 90 static JSValue numberConstructorNegInfinity(ExecState*,JSValue, PropertyName)90 static EncodedJSValue numberConstructorNegInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) 91 91 { 92 return jsNumber(-std::numeric_limits<double>::infinity());92 return JSValue::encode(jsNumber(-std::numeric_limits<double>::infinity())); 93 93 } 94 94 95 static JSValue numberConstructorPosInfinity(ExecState*,JSValue, PropertyName)95 static EncodedJSValue numberConstructorPosInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) 96 96 { 97 return jsNumber(std::numeric_limits<double>::infinity());97 return JSValue::encode(jsNumber(std::numeric_limits<double>::infinity())); 98 98 } 99 99 100 static JSValue numberConstructorMaxValue(ExecState*,JSValue, PropertyName)100 static EncodedJSValue numberConstructorMaxValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) 101 101 { 102 return jsNumber(1.7976931348623157E+308);102 return JSValue::encode(jsNumber(1.7976931348623157E+308)); 103 103 } 104 104 105 static JSValue numberConstructorMinValue(ExecState*,JSValue, PropertyName)105 static EncodedJSValue numberConstructorMinValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) 106 106 { 107 return jsNumber(5E-324);107 return JSValue::encode(jsNumber(5E-324)); 108 108 } 109 109 -
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r155308 r160133 61 61 } 62 62 63 typedef JSValue (*GetValueFunc)(ExecState*, JSValue slotBase, PropertyName);64 typedef JSValue (*GetIndexValueFunc)(ExecState*, JSValue slotBase, unsigned);63 typedef EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName); 64 typedef EncodedJSValue (*GetIndexValueFunc)(ExecState*, EncodedJSValue slotBase, EncodedJSValue thisValue, unsigned); 65 65 66 66 JSValue getValue(ExecState*, PropertyName) const; … … 227 227 PropertyType m_propertyType; 228 228 PropertyOffset m_offset; 229 JSValue m_thisValue;229 const JSValue m_thisValue; 230 230 JSObject* m_slotBase; 231 231 }; -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r156668 r160133 30 30 namespace JSC { 31 31 32 static JSValue regExpConstructorInput(ExecState*,JSValue, PropertyName);33 static JSValue regExpConstructorMultiline(ExecState*,JSValue, PropertyName);34 static JSValue regExpConstructorLastMatch(ExecState*,JSValue, PropertyName);35 static JSValue regExpConstructorLastParen(ExecState*,JSValue, PropertyName);36 static JSValue regExpConstructorLeftContext(ExecState*,JSValue, PropertyName);37 static JSValue regExpConstructorRightContext(ExecState*,JSValue, PropertyName);38 static JSValue regExpConstructorDollar1(ExecState*,JSValue, PropertyName);39 static JSValue regExpConstructorDollar2(ExecState*,JSValue, PropertyName);40 static JSValue regExpConstructorDollar3(ExecState*,JSValue, PropertyName);41 static JSValue regExpConstructorDollar4(ExecState*,JSValue, PropertyName);42 static JSValue regExpConstructorDollar5(ExecState*,JSValue, PropertyName);43 static JSValue regExpConstructorDollar6(ExecState*,JSValue, PropertyName);44 static JSValue regExpConstructorDollar7(ExecState*,JSValue, PropertyName);45 static JSValue regExpConstructorDollar8(ExecState*,JSValue, PropertyName);46 static JSValue regExpConstructorDollar9(ExecState*,JSValue, PropertyName);32 static EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 33 static EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 34 static EncodedJSValue regExpConstructorLastMatch(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 35 static EncodedJSValue regExpConstructorLastParen(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 36 static EncodedJSValue regExpConstructorLeftContext(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 37 static EncodedJSValue regExpConstructorRightContext(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 38 static EncodedJSValue regExpConstructorDollar1(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 39 static EncodedJSValue regExpConstructorDollar2(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 40 static EncodedJSValue regExpConstructorDollar3(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 41 static EncodedJSValue regExpConstructorDollar4(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 42 static EncodedJSValue regExpConstructorDollar5(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 43 static EncodedJSValue regExpConstructorDollar6(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 44 static EncodedJSValue regExpConstructorDollar7(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 45 static EncodedJSValue regExpConstructorDollar8(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 46 static EncodedJSValue regExpConstructorDollar9(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 47 47 48 48 static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue); … … 159 159 } 160 160 161 JSValue regExpConstructorDollar1(ExecState* exec, JSValue slotBase, PropertyName) 162 { 163 return asRegExpConstructor(slotBase)->getBackref(exec, 1); 164 } 165 166 JSValue regExpConstructorDollar2(ExecState* exec, JSValue slotBase, PropertyName) 167 { 168 return asRegExpConstructor(slotBase)->getBackref(exec, 2); 169 } 170 171 JSValue regExpConstructorDollar3(ExecState* exec, JSValue slotBase, PropertyName) 172 { 173 return asRegExpConstructor(slotBase)->getBackref(exec, 3); 174 } 175 176 JSValue regExpConstructorDollar4(ExecState* exec, JSValue slotBase, PropertyName) 177 { 178 return asRegExpConstructor(slotBase)->getBackref(exec, 4); 179 } 180 181 JSValue regExpConstructorDollar5(ExecState* exec, JSValue slotBase, PropertyName) 182 { 183 return asRegExpConstructor(slotBase)->getBackref(exec, 5); 184 } 185 186 JSValue regExpConstructorDollar6(ExecState* exec, JSValue slotBase, PropertyName) 187 { 188 return asRegExpConstructor(slotBase)->getBackref(exec, 6); 189 } 190 191 JSValue regExpConstructorDollar7(ExecState* exec, JSValue slotBase, PropertyName) 192 { 193 return asRegExpConstructor(slotBase)->getBackref(exec, 7); 194 } 195 196 JSValue regExpConstructorDollar8(ExecState* exec, JSValue slotBase, PropertyName) 197 { 198 return asRegExpConstructor(slotBase)->getBackref(exec, 8); 199 } 200 201 JSValue regExpConstructorDollar9(ExecState* exec, JSValue slotBase, PropertyName) 202 { 203 return asRegExpConstructor(slotBase)->getBackref(exec, 9); 204 } 205 206 JSValue regExpConstructorInput(ExecState*, JSValue slotBase, PropertyName) 207 { 208 return asRegExpConstructor(slotBase)->input(); 209 } 210 211 JSValue regExpConstructorMultiline(ExecState*, JSValue slotBase, PropertyName) 212 { 213 return jsBoolean(asRegExpConstructor(slotBase)->multiline()); 214 } 215 216 JSValue regExpConstructorLastMatch(ExecState* exec, JSValue slotBase, PropertyName) 217 { 218 return asRegExpConstructor(slotBase)->getBackref(exec, 0); 219 } 220 221 JSValue regExpConstructorLastParen(ExecState* exec, JSValue slotBase, PropertyName) 222 { 223 return asRegExpConstructor(slotBase)->getLastParen(exec); 224 } 225 226 JSValue regExpConstructorLeftContext(ExecState* exec, JSValue slotBase, PropertyName) 227 { 228 return asRegExpConstructor(slotBase)->getLeftContext(exec); 229 } 230 231 JSValue regExpConstructorRightContext(ExecState* exec, JSValue slotBase, PropertyName) 232 { 233 return asRegExpConstructor(slotBase)->getRightContext(exec); 161 static inline RegExpConstructor* asRegExpConstructor(EncodedJSValue value) 162 { 163 return jsCast<RegExpConstructor*>(JSValue::decode(value)); 164 } 165 166 EncodedJSValue regExpConstructorDollar1(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 167 { 168 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 1)); 169 } 170 171 EncodedJSValue regExpConstructorDollar2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 172 { 173 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 2)); 174 } 175 176 EncodedJSValue regExpConstructorDollar3(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 177 { 178 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 3)); 179 } 180 181 EncodedJSValue regExpConstructorDollar4(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 182 { 183 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 4)); 184 } 185 186 EncodedJSValue regExpConstructorDollar5(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 187 { 188 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 5)); 189 } 190 191 EncodedJSValue regExpConstructorDollar6(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 192 { 193 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 6)); 194 } 195 196 EncodedJSValue regExpConstructorDollar7(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 197 { 198 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 7)); 199 } 200 201 EncodedJSValue regExpConstructorDollar8(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 202 { 203 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 8)); 204 } 205 206 EncodedJSValue regExpConstructorDollar9(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 207 { 208 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 9)); 209 } 210 211 EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 212 { 213 return JSValue::encode(asRegExpConstructor(slotBase)->input()); 214 } 215 216 EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 217 { 218 return JSValue::encode(jsBoolean(asRegExpConstructor(slotBase)->multiline())); 219 } 220 221 EncodedJSValue regExpConstructorLastMatch(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 222 { 223 return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 0)); 224 } 225 226 EncodedJSValue regExpConstructorLastParen(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 227 { 228 return JSValue::encode(asRegExpConstructor(slotBase)->getLastParen(exec)); 229 } 230 231 EncodedJSValue regExpConstructorLeftContext(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 232 { 233 return JSValue::encode(asRegExpConstructor(slotBase)->getLeftContext(exec)); 234 } 235 236 EncodedJSValue regExpConstructorRightContext(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 237 { 238 return JSValue::encode(asRegExpConstructor(slotBase)->getRightContext(exec)); 234 239 } 235 240 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r156668 r160133 40 40 namespace JSC { 41 41 42 static JSValue regExpObjectGlobal(ExecState*,JSValue, PropertyName);43 static JSValue regExpObjectIgnoreCase(ExecState*,JSValue, PropertyName);44 static JSValue regExpObjectMultiline(ExecState*,JSValue, PropertyName);45 static JSValue regExpObjectSource(ExecState*,JSValue, PropertyName);42 static EncodedJSValue regExpObjectGlobal(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 43 static EncodedJSValue regExpObjectIgnoreCase(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 44 static EncodedJSValue regExpObjectMultiline(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 45 static EncodedJSValue regExpObjectSource(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 46 46 47 47 } // namespace JSC … … 156 156 } 157 157 158 JSValue regExpObjectGlobal(ExecState*, JSValue slotBase, PropertyName) 159 { 160 return jsBoolean(asRegExpObject(slotBase)->regExp()->global()); 161 } 162 163 JSValue regExpObjectIgnoreCase(ExecState*, JSValue slotBase, PropertyName) 164 { 165 return jsBoolean(asRegExpObject(slotBase)->regExp()->ignoreCase()); 158 static inline RegExpObject* asRegExpObject(EncodedJSValue value) 159 { 160 return jsCast<RegExpObject*>(JSValue::decode(value)); 161 } 162 163 EncodedJSValue regExpObjectGlobal(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 164 { 165 return JSValue::encode(jsBoolean(asRegExpObject(slotBase)->regExp()->global())); 166 } 167 168 EncodedJSValue regExpObjectIgnoreCase(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 169 { 170 return JSValue::encode(jsBoolean(asRegExpObject(slotBase)->regExp()->ignoreCase())); 166 171 } 167 172 168 JSValue regExpObjectMultiline(ExecState*, JSValue slotBase, PropertyName)173 EncodedJSValue regExpObjectMultiline(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 169 174 { 170 return jsBoolean(asRegExpObject(slotBase)->regExp()->multiline());175 return JSValue::encode(jsBoolean(asRegExpObject(slotBase)->regExp()->multiline())); 171 176 } 172 177 … … 277 282 } 278 283 279 JSValue regExpObjectSource(ExecState* exec, JSValue slotBase, PropertyName) 284 285 286 EncodedJSValue regExpObjectSource(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 280 287 { 281 288 String pattern = asRegExpObject(slotBase)->regExp()->pattern(); 282 289 if (pattern.is8Bit()) 283 return regExpObjectSourceInternal(exec, pattern, pattern.characters8(), pattern.length());284 return regExpObjectSourceInternal(exec, pattern, pattern.characters16(), pattern.length());290 return JSValue::encode(regExpObjectSourceInternal(exec, pattern, pattern.characters8(), pattern.length())); 291 return JSValue::encode(regExpObjectSourceInternal(exec, pattern, pattern.characters16(), pattern.length())); 285 292 } 286 293 -
trunk/Source/WebCore/ChangeLog
r160130 r160133 1 2013-12-04 Oliver Hunt <oliver@apple.com> 2 3 Refactor static getter function prototype to include thisValue in addition to the base object 4 https://bugs.webkit.org/show_bug.cgi?id=124461 5 6 Reviewed by Geoffrey Garen. 7 8 Change bindings codegen to produce static getter functions 9 with the correct types. Also update the many custom implementations 10 to the new type. 11 12 No change in behaviour. 13 14 * bindings/js/JSCSSStyleDeclarationCustom.cpp: 15 (WebCore::cssPropertyGetterPixelOrPosPrefixCallback): 16 (WebCore::cssPropertyGetterCallback): 17 * bindings/js/JSDOMBinding.cpp: 18 (WebCore::objectToStringFunctionGetter): 19 * bindings/js/JSDOMBinding.h: 20 * bindings/js/JSDOMMimeTypeArrayCustom.cpp: 21 (WebCore::JSDOMMimeTypeArray::nameGetter): 22 * bindings/js/JSDOMPluginArrayCustom.cpp: 23 (WebCore::JSDOMPluginArray::nameGetter): 24 * bindings/js/JSDOMPluginCustom.cpp: 25 (WebCore::JSDOMPlugin::nameGetter): 26 * bindings/js/JSDOMStringMapCustom.cpp: 27 (WebCore::JSDOMStringMap::nameGetter): 28 * bindings/js/JSDOMWindowCustom.cpp: 29 (WebCore::nonCachingStaticFunctionGetter): 30 (WebCore::childFrameGetter): 31 (WebCore::indexGetter): 32 (WebCore::namedItemGetter): 33 * bindings/js/JSHTMLAllCollectionCustom.cpp: 34 (WebCore::JSHTMLAllCollection::nameGetter): 35 * bindings/js/JSHTMLCollectionCustom.cpp: 36 (WebCore::JSHTMLCollection::nameGetter): 37 * bindings/js/JSHTMLDocumentCustom.cpp: 38 (WebCore::JSHTMLDocument::nameGetter): 39 * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: 40 (WebCore::JSHTMLFormControlsCollection::nameGetter): 41 * bindings/js/JSHTMLFormElementCustom.cpp: 42 (WebCore::JSHTMLFormElement::nameGetter): 43 * bindings/js/JSHTMLFrameSetElementCustom.cpp: 44 (WebCore::JSHTMLFrameSetElement::nameGetter): 45 * bindings/js/JSHistoryCustom.cpp: 46 (WebCore::nonCachingStaticBackFunctionGetter): 47 (WebCore::nonCachingStaticForwardFunctionGetter): 48 (WebCore::nonCachingStaticGoFunctionGetter): 49 * bindings/js/JSJavaScriptCallFrameCustom.cpp: 50 (WebCore::JSJavaScriptCallFrame::scopeType): 51 * bindings/js/JSLocationCustom.cpp: 52 (WebCore::nonCachingStaticReplaceFunctionGetter): 53 (WebCore::nonCachingStaticReloadFunctionGetter): 54 (WebCore::nonCachingStaticAssignFunctionGetter): 55 * bindings/js/JSNamedNodeMapCustom.cpp: 56 (WebCore::JSNamedNodeMap::nameGetter): 57 * bindings/js/JSNodeListCustom.cpp: 58 (WebCore::JSNodeList::nameGetter): 59 * bindings/js/JSPluginElementFunctions.cpp: 60 (WebCore::pluginElementPropertyGetter): 61 * bindings/js/JSPluginElementFunctions.h: 62 * bindings/js/JSRTCStatsResponseCustom.cpp: 63 (WebCore::JSRTCStatsResponse::nameGetter): 64 * bindings/js/JSStorageCustom.cpp: 65 (WebCore::JSStorage::nameGetter): 66 * bindings/js/JSStyleSheetListCustom.cpp: 67 (WebCore::JSStyleSheetList::nameGetter): 68 * bindings/scripts/CodeGeneratorJS.pm: 69 (GenerateHeader): 70 (GenerateImplementation): 71 (GenerateParametersCheck): 72 * bridge/runtime_array.cpp: 73 (JSC::RuntimeArray::lengthGetter): 74 (JSC::RuntimeArray::indexGetter): 75 * bridge/runtime_array.h: 76 * bridge/runtime_method.cpp: 77 (JSC::RuntimeMethod::lengthGetter): 78 * bridge/runtime_method.h: 79 * bridge/runtime_object.cpp: 80 (JSC::Bindings::RuntimeObject::fallbackObjectGetter): 81 (JSC::Bindings::RuntimeObject::fieldGetter): 82 (JSC::Bindings::RuntimeObject::methodGetter): 83 * bridge/runtime_object.h: 84 1 85 2013-12-04 Zoltan Horvath <zoltan@webkit.org> 2 86 -
trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
r159856 r160133 304 304 } 305 305 306 static JSValue cssPropertyGetterPixelOrPosPrefixCallback(ExecState* exec, JSValue slotBase, unsigned propertyID)307 { 308 return cssPropertyGetterPixelOrPosPrefix(exec, jsCast<JSCSSStyleDeclaration*>(asObject(slotBase)), propertyID);306 static EncodedJSValue cssPropertyGetterPixelOrPosPrefixCallback(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned propertyID) 307 { 308 return JSValue::encode(cssPropertyGetterPixelOrPosPrefix(exec, jsCast<JSCSSStyleDeclaration*>(JSValue::decode(slotBase)), propertyID)); 309 309 } 310 310 … … 318 318 } 319 319 320 static JSValue cssPropertyGetterCallback(ExecState* exec, JSValue slotBase, unsigned propertyID)321 { 322 return cssPropertyGetter(exec, jsCast<JSCSSStyleDeclaration*>(asObject(slotBase)), propertyID);320 static EncodedJSValue cssPropertyGetterCallback(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned propertyID) 321 { 322 return JSValue::encode(cssPropertyGetter(exec, jsCast<JSCSSStyleDeclaration*>(JSValue::decode(slotBase)), propertyID)); 323 323 } 324 324 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp
r159605 r160133 272 272 } 273 273 274 JSValue objectToStringFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)275 { 276 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), objectProtoFuncToString);274 EncodedJSValue objectToStringFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 275 { 276 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), objectProtoFuncToString)); 277 277 } 278 278 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r159827 r160133 573 573 574 574 void printErrorMessageForFrame(Frame*, const String& message); 575 JSC:: JSValue objectToStringFunctionGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);575 JSC::EncodedJSValue objectToStringFunctionGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName); 576 576 577 577 inline JSC::JSValue jsStringWithCache(JSC::ExecState* exec, const String& s) -
trunk/Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
r157215 r160133 34 34 } 35 35 36 JSValue JSDOMMimeTypeArray::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)36 EncodedJSValue JSDOMMimeTypeArray::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 37 37 { 38 JSDOMMimeTypeArray* thisObj = jsCast<JSDOMMimeTypeArray*>(asObject(slotBase)); 39 return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName))); 38 JSDOMMimeTypeArray* thisObj = jsDynamicCast<JSDOMMimeTypeArray*>(JSValue::decode(slotBase)); 39 if (!thisObj) 40 return throwVMTypeError(exec); 41 return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)))); 40 42 } 41 43 -
trunk/Source/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
r157215 r160133 34 34 } 35 35 36 JSValue JSDOMPluginArray::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)36 EncodedJSValue JSDOMPluginArray::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 37 37 { 38 JSDOMPluginArray* thisObj = jsCast<JSDOMPluginArray*>( asObject(slotBase));39 return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));38 JSDOMPluginArray* thisObj = jsCast<JSDOMPluginArray*>(JSValue::decode(slotBase)); 39 return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)))); 40 40 } 41 41 -
trunk/Source/WebCore/bindings/js/JSDOMPluginCustom.cpp
r157215 r160133 33 33 } 34 34 35 JSValue JSDOMPlugin::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)35 EncodedJSValue JSDOMPlugin::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 36 36 { 37 JSDOMPlugin* thisObj = jsCast<JSDOMPlugin*>( asObject(slotBase));38 return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));37 JSDOMPlugin* thisObj = jsCast<JSDOMPlugin*>(JSValue::decode(slotBase)); 38 return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)))); 39 39 } 40 40 -
trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
r157215 r160133 41 41 } 42 42 43 JSValue JSDOMStringMap::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)43 EncodedJSValue JSDOMStringMap::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 44 44 { 45 JSDOMStringMap* thisObj = jsCast<JSDOMStringMap*>( asObject(slotBase));46 return jsStringWithCache(exec, thisObj->impl().item(propertyNameToAtomicString(propertyName)));45 JSDOMStringMap* thisObj = jsCast<JSDOMStringMap*>(JSValue::decode(slotBase)); 46 return JSValue::encode(jsStringWithCache(exec, thisObj->impl().item(propertyNameToAtomicString(propertyName)))); 47 47 } 48 48 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r159679 r160133 68 68 69 69 template<NativeFunction nativeFunction, int length> 70 JSValue nonCachingStaticFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)71 { 72 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction);73 } 74 75 static JSValue childFrameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)76 { 77 return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow());78 } 79 80 static JSValue indexGetter(ExecState* exec, JSValue slotBase, unsigned index)81 { 82 return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl().frame()->tree().scopedChild(index)->document()->domWindow());83 } 84 85 static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)86 { 87 JSDOMWindowBase* thisObj = jsCast<JSDOMWindow*>( asObject(slotBase));70 EncodedJSValue nonCachingStaticFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 71 { 72 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction)); 73 } 74 75 static EncodedJSValue childFrameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 76 { 77 return JSValue::encode(toJS(exec, jsCast<JSDOMWindow*>(JSValue::decode(slotBase))->impl().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow())); 78 } 79 80 static EncodedJSValue indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index) 81 { 82 return JSValue::encode(toJS(exec, jsCast<JSDOMWindow*>(JSValue::decode(slotBase))->impl().frame()->tree().scopedChild(index)->document()->domWindow())); 83 } 84 85 static EncodedJSValue namedItemGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 86 { 87 JSDOMWindowBase* thisObj = jsCast<JSDOMWindow*>(JSValue::decode(slotBase)); 88 88 Document* document = thisObj->impl().frame()->document(); 89 89 … … 94 94 AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName); 95 95 if (!atomicPropertyName || !toHTMLDocument(document)->hasWindowNamedItem(*atomicPropertyName)) 96 return jsUndefined();96 return JSValue::encode(jsUndefined()); 97 97 98 98 if (UNLIKELY(toHTMLDocument(document)->windowNamedItemContainsMultipleElements(*atomicPropertyName))) { 99 99 RefPtr<HTMLCollection> collection = document->windowNamedItems(atomicPropertyName); 100 100 ASSERT(collection->length() > 1); 101 return toJS(exec, thisObj->globalObject(), WTF::getPtr(collection));102 } 103 104 return toJS(exec, thisObj->globalObject(), toHTMLDocument(document)->windowNamedItem(*atomicPropertyName));101 return JSValue::encode(toJS(exec, thisObj->globalObject(), WTF::getPtr(collection))); 102 } 103 104 return JSValue::encode(toJS(exec, thisObj->globalObject(), toHTMLDocument(document)->windowNamedItem(*atomicPropertyName))); 105 105 } 106 106 -
trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
r157215 r160133 101 101 } 102 102 103 JSValue JSHTMLAllCollection::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)103 EncodedJSValue JSHTMLAllCollection::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 104 104 { 105 JSHTMLAllCollection* thisObj = jsCast<JSHTMLAllCollection*>( asObject(slotBase));106 return getNamedItems(exec, thisObj, propertyName);105 JSHTMLAllCollection* thisObj = jsCast<JSHTMLAllCollection*>(JSValue::decode(slotBase)); 106 return JSValue::encode(getNamedItems(exec, thisObj, propertyName)); 107 107 } 108 108 -
trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
r157215 r160133 46 46 } 47 47 48 JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)48 EncodedJSValue JSHTMLCollection::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 49 49 { 50 JSHTMLCollection* collection = jsCast<JSHTMLCollection*>( asObject(slotBase));50 JSHTMLCollection* collection = jsCast<JSHTMLCollection*>(JSValue::decode(slotBase)); 51 51 const AtomicString& name = propertyNameToAtomicString(propertyName); 52 return toJS(exec, collection->globalObject(), collection->impl().namedItem(name));52 return JSValue::encode(toJS(exec, collection->globalObject(), collection->impl().namedItem(name))); 53 53 } 54 54 -
trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
r158774 r160133 58 58 } 59 59 60 JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)60 EncodedJSValue JSHTMLDocument::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 61 61 { 62 JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>( asObject(slotBase));62 JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(JSValue::decode(slotBase)); 63 63 HTMLDocument& document = thisObj->impl(); 64 64 65 65 AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName); 66 66 if (!atomicPropertyName || !document.hasDocumentNamedItem(*atomicPropertyName)) 67 return jsUndefined();67 return JSValue::encode(jsUndefined()); 68 68 69 69 if (UNLIKELY(document.documentNamedItemContainsMultipleElements(*atomicPropertyName))) { 70 70 RefPtr<HTMLCollection> collection = document.documentNamedItems(atomicPropertyName); 71 71 ASSERT(collection->length() > 1); 72 return toJS(exec, thisObj->globalObject(), WTF::getPtr(collection));72 return JSValue::encode(toJS(exec, thisObj->globalObject(), WTF::getPtr(collection))); 73 73 } 74 74 … … 76 76 if (UNLIKELY(element->hasTagName(iframeTag))) { 77 77 if (Frame* frame = toHTMLIFrameElement(element)->contentFrame()) 78 return toJS(exec, frame);78 return JSValue::encode(toJS(exec, frame)); 79 79 } 80 80 81 return toJS(exec, thisObj->globalObject(), element);81 return JSValue::encode(toJS(exec, thisObj->globalObject(), element)); 82 82 } 83 83 -
trunk/Source/WebCore/bindings/js/JSHTMLFormControlsCollectionCustom.cpp
r157215 r160133 58 58 } 59 59 60 JSValue JSHTMLFormControlsCollection::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)60 EncodedJSValue JSHTMLFormControlsCollection::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 61 61 { 62 JSHTMLFormControlsCollection* thisObj = jsCast<JSHTMLFormControlsCollection*>( asObject(slotBase));63 return getNamedItems(exec, thisObj, propertyName);62 JSHTMLFormControlsCollection* thisObj = jsCast<JSHTMLFormControlsCollection*>(JSValue::decode(slotBase)); 63 return JSValue::encode(getNamedItems(exec, thisObj, propertyName)); 64 64 } 65 65 -
trunk/Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
r157215 r160133 43 43 } 44 44 45 JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)45 EncodedJSValue JSHTMLFormElement::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 46 46 { 47 JSHTMLFormElement* jsForm = jsCast<JSHTMLFormElement*>( asObject(slotBase));47 JSHTMLFormElement* jsForm = jsCast<JSHTMLFormElement*>(JSValue::decode(slotBase)); 48 48 HTMLFormElement& form = jsForm->impl(); 49 49 … … 52 52 53 53 if (namedItems.isEmpty()) 54 return jsUndefined();54 return JSValue::encode(jsUndefined()); 55 55 if (namedItems.size() == 1) 56 return toJS(exec, jsForm->globalObject(), &namedItems[0].get());56 return JSValue::encode(toJS(exec, jsForm->globalObject(), &namedItems[0].get())); 57 57 58 58 // FIXME: HTML5 specifies that this should be a RadioNodeList. 59 return toJS(exec, jsForm->globalObject(), StaticElementList::adopt(namedItems).get());59 return JSValue::encode(toJS(exec, jsForm->globalObject(), StaticElementList::adopt(namedItems).get())); 60 60 } 61 61 -
trunk/Source/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
r159416 r160133 48 48 } 49 49 50 JSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)50 EncodedJSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 51 51 { 52 HTMLElement& element = jsCast<JSHTMLElement*>( asObject(slotBase))->impl();52 HTMLElement& element = jsCast<JSHTMLElement*>(JSValue::decode(slotBase))->impl(); 53 53 Node* frameElement = element.children()->namedItem(propertyNameToAtomicString(propertyName)); 54 54 if (Document* document = toHTMLFrameElement(frameElement)->contentDocument()) { 55 55 if (JSDOMWindowShell* window = toJSDOMWindowShell(document->frame(), currentWorld(exec))) 56 return window;56 return JSValue::encode(window); 57 57 } 58 return jsUndefined();58 return JSValue::encode(jsUndefined()); 59 59 } 60 60 -
trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp
r157215 r160133 39 39 namespace WebCore { 40 40 41 static JSValue nonCachingStaticBackFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)41 static EncodedJSValue nonCachingStaticBackFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 42 42 { 43 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionBack);43 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionBack)); 44 44 } 45 45 46 static JSValue nonCachingStaticForwardFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)46 static EncodedJSValue nonCachingStaticForwardFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 47 47 { 48 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionForward);48 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionForward)); 49 49 } 50 50 51 static JSValue nonCachingStaticGoFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)51 static EncodedJSValue nonCachingStaticGoFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 52 52 { 53 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsHistoryPrototypeFunctionGo);53 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsHistoryPrototypeFunctionGo)); 54 54 } 55 55 -
trunk/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
r157215 r160133 107 107 // First activation object is local scope, each successive activation object is closure. 108 108 if (!index) 109 return jsJavaScriptCallFrameLOCAL_SCOPE(exec, JSValue(), Identifier());109 return JSValue::decode(jsJavaScriptCallFrameLOCAL_SCOPE(exec, EncodedJSValue(), EncodedJSValue(), Identifier())); 110 110 foundLocalScope = true; 111 111 } else if (!index) 112 return jsJavaScriptCallFrameCLOSURE_SCOPE(exec, JSValue(), Identifier());112 return JSValue::decode(jsJavaScriptCallFrameCLOSURE_SCOPE(exec, EncodedJSValue(), EncodedJSValue(), Identifier())); 113 113 } 114 114 … … 116 116 // Last in the chain is global scope. 117 117 if (++iter == end) 118 return jsJavaScriptCallFrameGLOBAL_SCOPE(exec, JSValue(), Identifier());119 return jsJavaScriptCallFrameWITH_SCOPE(exec, JSValue(), Identifier());118 return JSValue::decode(jsJavaScriptCallFrameGLOBAL_SCOPE(exec, EncodedJSValue(), EncodedJSValue(), Identifier())); 119 return JSValue::decode(jsJavaScriptCallFrameWITH_SCOPE(exec, EncodedJSValue(), EncodedJSValue(), Identifier())); 120 120 } 121 121 -
trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp
r157215 r160133 31 31 namespace WebCore { 32 32 33 static JSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)34 { 35 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionReplace);36 } 37 38 static JSValue nonCachingStaticReloadFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)39 { 40 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsLocationPrototypeFunctionReload);41 } 42 43 static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec,JSValue, PropertyName propertyName)44 { 45 return JS Function::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionAssign);33 static EncodedJSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 34 { 35 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionReplace)); 36 } 37 38 static EncodedJSValue nonCachingStaticReloadFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 39 { 40 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsLocationPrototypeFunctionReload)); 41 } 42 43 static EncodedJSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName propertyName) 44 { 45 return JSValue::encode(JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionAssign)); 46 46 } 47 47 -
trunk/Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
r157215 r160133 41 41 } 42 42 43 JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)43 EncodedJSValue JSNamedNodeMap::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 44 44 { 45 JSNamedNodeMap* thisObj = jsCast<JSNamedNodeMap*>( asObject(slotBase));46 return toJS(exec, thisObj->globalObject(), thisObj->impl().getNamedItem(propertyNameToAtomicString(propertyName)));45 JSNamedNodeMap* thisObj = jsCast<JSNamedNodeMap*>(JSValue::decode(slotBase)); 46 return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().getNamedItem(propertyNameToAtomicString(propertyName)))); 47 47 } 48 48 -
trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp
r158536 r160133 57 57 } 58 58 59 JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)59 EncodedJSValue JSNodeList::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 60 60 { 61 JSNodeList* thisObj = jsCast<JSNodeList*>( asObject(slotBase));62 return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));61 JSNodeList* thisObj = jsCast<JSNodeList*>(JSValue::decode(slotBase)); 62 return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)))); 63 63 } 64 64 -
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
r159827 r160133 101 101 } 102 102 103 JSValue pluginElementPropertyGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)103 EncodedJSValue pluginElementPropertyGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 104 104 { 105 JSHTMLElement* element = jsCast<JSHTMLElement*>( asObject(slotBase));105 JSHTMLElement* element = jsCast<JSHTMLElement*>(JSValue::decode(slotBase)); 106 106 JSObject* scriptObject = pluginScriptObject(exec, element); 107 107 if (!scriptObject) 108 return jsUndefined();108 return JSValue::encode(jsUndefined()); 109 109 110 return scriptObject->get(exec, propertyName);110 return JSValue::encode(scriptObject->get(exec, propertyName)); 111 111 } 112 112 -
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.h
r156769 r160133 39 39 JSC::JSObject* pluginScriptObject(JSC::ExecState*, JSHTMLElement*); 40 40 41 JSC:: JSValue pluginElementPropertyGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);41 JSC::EncodedJSValue pluginElementPropertyGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName); 42 42 bool pluginElementCustomGetOwnPropertySlot(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&, JSHTMLElement*); 43 43 bool pluginElementCustomPut(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSHTMLElement*, JSC::PutPropertySlot&); -
trunk/Source/WebCore/bindings/js/JSRTCStatsResponseCustom.cpp
r157215 r160133 41 41 } 42 42 43 JSValue JSRTCStatsResponse::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)43 EncodedJSValue JSRTCStatsResponse::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 44 44 { 45 JSRTCStatsResponse* thisObj = jsCast<JSRTCStatsResponse*>( asObject(slotBase));46 return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));45 JSRTCStatsResponse* thisObj = jsCast<JSRTCStatsResponse*>(JSValue::decode(slotBase)); 46 return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)))); 47 47 } 48 48 -
trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp
r157215 r160133 43 43 } 44 44 45 JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)45 EncodedJSValue JSStorage::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 46 46 { 47 JSStorage* thisObj = jsCast<JSStorage*>( asObject(slotBase));47 JSStorage* thisObj = jsCast<JSStorage*>(JSValue::decode(slotBase)); 48 48 49 JSValue prototype = asObject( slotBase)->prototype();49 JSValue prototype = asObject(JSValue::decode(slotBase))->prototype(); 50 50 if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName)) 51 return asObject(prototype)->get(exec, propertyName);51 return JSValue::encode(asObject(prototype)->get(exec, propertyName)); 52 52 53 53 ExceptionCode ec = 0; 54 54 JSValue result = jsStringOrNull(exec, thisObj->impl().getItem(propertyNameToString(propertyName), ec)); 55 55 setDOMException(exec, ec); 56 return result;56 return JSValue::encode(result); 57 57 } 58 58 -
trunk/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp
r157215 r160133 41 41 } 42 42 43 JSValue JSStyleSheetList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)43 EncodedJSValue JSStyleSheetList::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 44 44 { 45 JSStyleSheetList* thisObj = jsCast<JSStyleSheetList*>( asObject(slotBase));45 JSStyleSheetList* thisObj = jsCast<JSStyleSheetList*>(JSValue::decode(slotBase)); 46 46 HTMLStyleElement* element = thisObj->impl().getNamedItem(propertyNameToString(propertyName)); 47 47 ASSERT(element); 48 return toJS(exec, thisObj->globalObject(), element->sheet());48 return JSValue::encode(toJS(exec, thisObj->globalObject(), element->sheet())); 49 49 } 50 50 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r159856 r160133 894 894 push(@headerContent, " JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\n"); 895 895 } else { 896 push(@headerContent, " static JSC:: JSValue indexGetter(JSC::ExecState*, JSC::JSValue, unsigned);\n");896 push(@headerContent, " static JSC::EncodedJSValue indexGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, unsigned);\n"); 897 897 } 898 898 } … … 906 906 push(@headerContent, "private:\n"); 907 907 push(@headerContent, " static bool canGetItemsForName(JSC::ExecState*, $interfaceName*, JSC::PropertyName);\n"); 908 push(@headerContent, " static JSC:: JSValue nameGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n");908 push(@headerContent, " static JSC::EncodedJSValue nameGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName);\n"); 909 909 } 910 910 … … 1042 1042 push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; 1043 1043 my $getter = GetAttributeGetterName($interfaceName, $className, $attribute); 1044 push(@headerContent, "JSC:: JSValue ${getter}(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n");1044 push(@headerContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName);\n"); 1045 1045 if (!IsReadonly($attribute)) { 1046 1046 my $setter = GetAttributeSetterName($interfaceName, $className, $attribute); … … 1052 1052 if (!$interface->extendedAttributes->{"NoInterfaceObject"}) { 1053 1053 my $getter = "js" . $interfaceName . "Constructor"; 1054 push(@headerContent, "JSC:: JSValue ${getter}(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n");1054 push(@headerContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName);\n"); 1055 1055 } 1056 1056 … … 1067 1067 push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; 1068 1068 my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name); 1069 push(@headerContent, "JSC:: JSValue ${getter}(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);\n");1069 push(@headerContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName);\n"); 1070 1070 push(@headerContent, "#endif\n") if $conditionalString; 1071 1071 } … … 1876 1876 push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; 1877 1877 1878 push(@implContent, " JSValue ${getFunctionName}(ExecState* exec, JSValue slotBase, PropertyName)\n");1878 push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)\n"); 1879 1879 push(@implContent, "{\n"); 1880 1880 1881 1881 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { 1882 push(@implContent, " ${className}* castedThis = js Cast<$className*>(asObject(slotBase));\n");1882 push(@implContent, " ${className}* castedThis = jsDynamicCast<$className*>(JSValue::decode(slotBase));\n"); 1883 1883 } else { 1884 1884 push(@implContent, " UNUSED_PARAM(slotBase);\n"); … … 1891 1891 my $enable_function = GetRuntimeEnableFunctionName($attribute->signature); 1892 1892 push(@implContent, " if (!${enable_function}())\n"); 1893 push(@implContent, " return jsUndefined();\n");1893 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 1894 1894 } elsif ($attribute->signature->extendedAttributes->{"EnabledBySetting"}) { 1895 1895 AddToImplIncludes("Frame.h"); … … 1897 1897 my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{"EnabledBySetting"}) . "Enabled"; 1898 1898 push(@implContent, " if (!castedThis->impl().frame())\n"); 1899 push(@implContent, " return jsUndefined();\n");1899 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 1900 1900 push(@implContent, " Settings& settings = castedThis->impl().frame()->settings();\n"); 1901 1901 push(@implContent, " if (!settings.$enable_function())\n"); 1902 push(@implContent, " return jsUndefined();\n");1902 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 1903 1903 } 1904 1904 } … … 1912 1912 !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) { 1913 1913 push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))\n"); 1914 push(@implContent, " return jsUndefined();\n");1914 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 1915 1915 } 1916 1916 1917 1917 if (HasCustomGetter($attribute->signature->extendedAttributes)) { 1918 push(@implContent, " return castedThis->$implGetterFunctionName(exec);\n");1918 push(@implContent, " return JSValue::encode(castedThis->$implGetterFunctionName(exec));\n"); 1919 1919 } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) { 1920 1920 $implIncludes{"JSDOMBinding.h"} = 1; 1921 1921 push(@implContent, " $interfaceName& impl = castedThis->impl();\n"); 1922 push(@implContent, " return shouldAllowAccessToNode(exec, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull();\n");1922 push(@implContent, " return JSValue::encode(shouldAllowAccessToNode(exec, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull());\n"); 1923 1923 } elsif ($type eq "EventListener") { 1924 1924 $implIncludes{"EventListener.h"} = 1; … … 1932 1932 push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))\n"); 1933 1933 } 1934 push(@implContent, " return jsFunction;\n");1934 push(@implContent, " return JSValue::encode(jsFunction);\n"); 1935 1935 push(@implContent, " }\n"); 1936 1936 push(@implContent, " }\n"); 1937 push(@implContent, " return jsNull();\n");1937 push(@implContent, " return JSValue::encode(jsNull());\n"); 1938 1938 } elsif ($attribute->signature->type =~ /Constructor$/) { 1939 1939 my $constructorType = $attribute->signature->type; … … 1944 1944 my $named = ($constructorType =~ /Named$/) ? "Named" : ""; 1945 1945 $constructorType =~ s/Named$//; 1946 push(@implContent, " return JS " . $constructorType . "::get${named}Constructor(exec->vm(), castedThis);\n");1946 push(@implContent, " return JSValue::encode(JS" . $constructorType . "::get${named}Constructor(exec->vm(), castedThis));\n"); 1947 1947 } else { 1948 1948 AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"}); 1949 push(@implContent, " return JS " . $constructorType . "::getConstructor(exec->vm(), castedThis->globalObject());\n");1949 push(@implContent, " return JSValue::encode(JS" . $constructorType . "::getConstructor(exec->vm(), castedThis->globalObject()));\n"); 1950 1950 } 1951 1951 } elsif (!$attribute->signature->extendedAttributes->{"GetterRaisesException"}) { … … 1958 1958 $currentCachedAttribute++; 1959 1959 push(@implContent, " if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n"); 1960 push(@implContent, " return cachedValue;\n");1960 push(@implContent, " return JSValue::encode(cachedValue);\n"); 1961 1961 } 1962 1962 1963 my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, " jsUndefined()");1963 my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())"); 1964 1964 1965 1965 if ($svgListPropertyType) { … … 1999 1999 if ($isNullable) { 2000 2000 push(@implContent, " if (isNull)\n"); 2001 push(@implContent, " return jsNull();\n");2001 push(@implContent, " return JSValue::encode(jsNull());\n"); 2002 2002 } 2003 2003 } 2004 2004 2005 2005 push(@implContent, " castedThis->m_" . $attribute->signature->name . ".set(exec->vm(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"}); 2006 push(@implContent, " return result;\n");2006 push(@implContent, " return JSValue::encode(result);\n"); 2007 2007 2008 2008 } else { … … 2015 2015 } 2016 2016 2017 unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, " jsUndefined()"));2017 unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())")); 2018 2018 2019 2019 if ($svgPropertyOrListPropertyType) { … … 2027 2027 if ($isNullable) { 2028 2028 push(@implContent, " if (isNull)\n"); 2029 push(@implContent, " return jsNull();\n");2029 push(@implContent, " return JSValue::encode(jsNull());\n"); 2030 2030 } 2031 2031 2032 2032 push(@implContent, " setDOMException(exec, ec);\n"); 2033 push(@implContent, " return result;\n");2033 push(@implContent, " return JSValue::encode(result);\n"); 2034 2034 } 2035 2035 … … 2044 2044 my $constructorFunctionName = "js" . $interfaceName . "Constructor"; 2045 2045 2046 push(@implContent, " JSValue ${constructorFunctionName}(ExecState* exec, JSValue slotBase, PropertyName)\n");2046 push(@implContent, "EncodedJSValue ${constructorFunctionName}(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)\n"); 2047 2047 push(@implContent, "{\n"); 2048 push(@implContent, " ${className}* domObject = js Cast<$className*>(asObject(slotBase));\n");2048 push(@implContent, " ${className}* domObject = jsDynamicCast<$className*>(JSValue::decode(slotBase));\n"); 2049 2049 2050 2050 if ($interface->extendedAttributes->{"CheckSecurity"}) { 2051 2051 push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, domObject->impl()))\n"); 2052 push(@implContent, " return jsUndefined();\n");2052 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 2053 2053 } 2054 2054 2055 push(@implContent, " return ${className}::getConstructor(exec->vm(), domObject->globalObject());\n");2055 push(@implContent, " return JSValue::encode(${className}::getConstructor(exec->vm(), domObject->globalObject()));\n"); 2056 2056 push(@implContent, "}\n\n"); 2057 2057 } … … 2385 2385 } else { 2386 2386 push(@implContent, " JSValue thisValue = exec->hostThisValue();\n"); 2387 push(@implContent, " if (!thisValue.inherits(${className}::info()))\n"); 2387 push(@implContent, " $className* castedThis = jsDynamicCast<$className*>(thisValue);\n"); 2388 push(@implContent, " if (!castedThis)\n"); 2388 2389 push(@implContent, " return throwVMTypeError(exec);\n"); 2389 push(@implContent, " $className* castedThis = jsCast<$className*>(asObject(thisValue));\n");2390 2390 } 2391 2391 … … 2485 2485 2486 2486 # FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL 2487 push(@implContent, " JSValue ${getter}(ExecState* exec,JSValue, PropertyName)\n");2487 push(@implContent, "EncodedJSValue ${getter}(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName)\n"); 2488 2488 push(@implContent, "{\n"); 2489 2489 if ($constant->type eq "DOMString") { 2490 push(@implContent, " return jsStringOrNull(exec, String(" . $constant->value . "));\n");2490 push(@implContent, " return JSValue::encode(jsStringOrNull(exec, String(" . $constant->value . ")));\n"); 2491 2491 } else { 2492 2492 push(@implContent, " UNUSED_PARAM(exec);\n"); 2493 push(@implContent, " return jsNumber(static_cast<int>(" . $constant->value . "));\n");2493 push(@implContent, " return JSValue::encode(jsNumber(static_cast<int>(" . $constant->value . ")));\n"); 2494 2494 } 2495 2495 push(@implContent, "}\n\n"); … … 2499 2499 2500 2500 if ($indexedGetterFunction && !$hasNumericIndexedGetter) { 2501 push(@implContent, "\n JSValue ${className}::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)\n");2501 push(@implContent, "\nEncodedJSValue ${className}::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index)\n"); 2502 2502 push(@implContent, "{\n"); 2503 push(@implContent, " ${className}* thisObj = jsCast<$className*>( asObject(slotBase));\n");2503 push(@implContent, " ${className}* thisObj = jsCast<$className*>(JSValue::decode(slotBase));\n"); 2504 2504 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObj, info());\n"); 2505 2505 if ($indexedGetterFunction->signature->type eq "DOMString") { 2506 2506 $implIncludes{"URL.h"} = 1; 2507 push(@implContent, " return jsStringOrUndefined(exec, thisObj->impl().item(index));\n");2507 push(@implContent, " return JSValue::encode(jsStringOrUndefined(exec, thisObj->impl().item(index)));\n"); 2508 2508 } else { 2509 push(@implContent, " return toJS(exec, thisObj->globalObject(), thisObj->impl().item(index));\n");2509 push(@implContent, " return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().item(index)));\n"); 2510 2510 } 2511 2511 push(@implContent, "}\n\n"); … … 2538 2538 push(@implContent, " return collection->hasNamedItem(propertyNameToAtomicString(propertyName));\n"); 2539 2539 push(@implContent, "}\n\n"); 2540 push(@implContent, " JSValue ${className}::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)\n");2540 push(@implContent, "EncodedJSValue ${className}::nameGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName)\n"); 2541 2541 push(@implContent, "{\n"); 2542 push(@implContent, " ${className}* thisObj = jsCast<$className*>( asObject(slotBase));\n");2543 push(@implContent, " return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));\n");2542 push(@implContent, " ${className}* thisObj = jsCast<$className*>(JSValue::decode(slotBase));\n"); 2543 push(@implContent, " return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName))));\n"); 2544 2544 push(@implContent, "}\n\n"); 2545 2545 } … … 2732 2732 push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n"); 2733 2733 push(@implContent, "{\n"); 2734 push(@implContent, " return value.inherits(${className}::info()) ? &jsCast<$className*>( asObject(value))->impl() : 0");2734 push(@implContent, " return value.inherits(${className}::info()) ? &jsCast<$className*>(value)->impl() : 0"); 2735 2735 push(@implContent, ";\n}\n"); 2736 2736 } … … 2872 2872 if ($function->isStatic) { 2873 2873 AddToImplIncludes("CallbackFunction.h"); 2874 push(@$outputArray, " $name = createFunctionOnlyCallback<${callbackClassName}>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument($argsIndex));\n");2874 push(@$outputArray, " $name = createFunctionOnlyCallback<${callbackClassName}>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument($argsIndex));\n"); 2875 2875 } else { 2876 2876 push(@$outputArray, " $name = ${callbackClassName}::create(asObject(exec->uncheckedArgument($argsIndex)), castedThis->globalObject());\n"); … … 2882 2882 if ($function->isStatic) { 2883 2883 AddToImplIncludes("CallbackFunction.h"); 2884 push(@$outputArray, " RefPtr<$argType> $name = createFunctionOnlyCallback<${callbackClassName}>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument($argsIndex));\n");2884 push(@$outputArray, " RefPtr<$argType> $name = createFunctionOnlyCallback<${callbackClassName}>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument($argsIndex));\n"); 2885 2885 } else { 2886 2886 push(@$outputArray, " RefPtr<$argType> $name = ${callbackClassName}::create(asObject(exec->uncheckedArgument($argsIndex)), castedThis->globalObject());\n"); -
trunk/Source/WebCore/bridge/runtime_array.cpp
r154797 r160133 61 61 } 62 62 63 JSValue RuntimeArray::lengthGetter(ExecState*, JSValue slotBase, PropertyName)63 EncodedJSValue RuntimeArray::lengthGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 64 64 { 65 RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slotBase));66 return jsNumber(thisObj->getLength());65 RuntimeArray* thisObj = jsCast<RuntimeArray*>(JSValue::decode(slotBase)); 66 return JSValue::encode(jsNumber(thisObj->getLength())); 67 67 } 68 68 69 JSValue RuntimeArray::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)69 EncodedJSValue RuntimeArray::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index) 70 70 { 71 RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slotBase));72 return thisObj->getConcreteArray()->valueAt(exec, index);71 RuntimeArray* thisObj = jsCast<RuntimeArray*>(JSValue::decode(slotBase)); 72 return JSValue::encode(thisObj->getConcreteArray()->valueAt(exec, index)); 73 73 } 74 74 -
trunk/Source/WebCore/bridge/runtime_array.h
r156485 r160133 85 85 private: 86 86 RuntimeArray(ExecState*, Structure*); 87 static JSValue lengthGetter(ExecState*,JSValue, PropertyName);88 static JSValue indexGetter(ExecState*,JSValue, unsigned);87 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 88 static EncodedJSValue indexGetter(ExecState*, EncodedJSValue, EncodedJSValue, unsigned); 89 89 90 90 BindingsArray* m_array; -
trunk/Source/WebCore/bridge/runtime_method.cpp
r157215 r160133 55 55 } 56 56 57 JSValue RuntimeMethod::lengthGetter(ExecState*, JSValue slotBase, PropertyName)57 EncodedJSValue RuntimeMethod::lengthGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 58 58 { 59 RuntimeMethod* thisObj = static_cast<RuntimeMethod*>(asObject(slotBase));59 RuntimeMethod* thisObj = jsCast<RuntimeMethod*>(JSValue::decode(slotBase)); 60 60 61 return jsNumber(thisObj->m_method->numParameters());61 return JSValue::encode(jsNumber(thisObj->m_method->numParameters())); 62 62 } 63 63 -
trunk/Source/WebCore/bridge/runtime_method.h
r156485 r160133 68 68 69 69 private: 70 static JSValue lengthGetter(ExecState*,JSValue, PropertyName);70 static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 71 71 72 72 Bindings::Method* m_method; -
trunk/Source/WebCore/bridge/runtime_object.cpp
r156485 r160133 63 63 } 64 64 65 JSValue RuntimeObject::fallbackObjectGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)66 { 67 RuntimeObject* thisObj = static_cast<RuntimeObject*>(asObject(slotBase));65 EncodedJSValue RuntimeObject::fallbackObjectGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 66 { 67 RuntimeObject* thisObj = jsCast<RuntimeObject*>(JSValue::decode(slotBase)); 68 68 RefPtr<Instance> instance = thisObj->m_instance; 69 69 70 70 if (!instance) 71 return throwInvalidAccessError(exec);71 return JSValue::encode(throwInvalidAccessError(exec)); 72 72 73 73 instance->begin(); … … 78 78 instance->end(); 79 79 80 return result;81 } 82 83 JSValue RuntimeObject::fieldGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)80 return JSValue::encode(result); 81 } 82 83 EncodedJSValue RuntimeObject::fieldGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 84 84 { 85 RuntimeObject* thisObj = static_cast<RuntimeObject*>(asObject(slotBase));85 RuntimeObject* thisObj = jsCast<RuntimeObject*>(JSValue::decode(slotBase)); 86 86 RefPtr<Instance> instance = thisObj->m_instance; 87 87 88 88 if (!instance) 89 return throwInvalidAccessError(exec);89 return JSValue::encode(throwInvalidAccessError(exec)); 90 90 91 91 instance->begin(); … … 97 97 instance->end(); 98 98 99 return result;100 } 101 102 JSValue RuntimeObject::methodGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)103 { 104 RuntimeObject* thisObj = static_cast<RuntimeObject*>(asObject(slotBase));99 return JSValue::encode(result); 100 } 101 102 EncodedJSValue RuntimeObject::methodGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 103 { 104 RuntimeObject* thisObj = jsCast<RuntimeObject*>(JSValue::decode(slotBase)); 105 105 RefPtr<Instance> instance = thisObj->m_instance; 106 106 107 107 if (!instance) 108 return throwInvalidAccessError(exec);108 return JSValue::encode(throwInvalidAccessError(exec)); 109 109 110 110 instance->begin(); … … 114 114 instance->end(); 115 115 116 return method;116 return JSValue::encode(method); 117 117 } 118 118 -
trunk/Source/WebCore/bridge/runtime_object.h
r156485 r160133 79 79 80 80 private: 81 static JSValue fallbackObjectGetter(ExecState*,JSValue, PropertyName);82 static JSValue fieldGetter(ExecState*,JSValue, PropertyName);83 static JSValue methodGetter(ExecState*,JSValue, PropertyName);81 static EncodedJSValue fallbackObjectGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 82 static EncodedJSValue fieldGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 83 static EncodedJSValue methodGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); 84 84 85 85 RefPtr<Instance> m_instance; -
trunk/Source/WebKit2/ChangeLog
r160129 r160133 1 2013-12-04 Oliver Hunt <oliver@apple.com> 2 3 Refactor static getter function prototype to include thisValue in addition to the base object 4 https://bugs.webkit.org/show_bug.cgi?id=124461 5 6 Reviewed by Geoffrey Garen. 7 8 Update the WK2 JSC usage to the new static getter API 9 10 * WebProcess/Plugins/Netscape/JSNPMethod.cpp: 11 (WebKit::callMethod): 12 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 13 (WebKit::callNPJSObject): 14 (WebKit::constructWithConstructor): 15 (WebKit::JSNPObject::propertyGetter): 16 (WebKit::JSNPObject::methodGetter): 17 * WebProcess/Plugins/Netscape/JSNPObject.h: 18 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: 19 (WebKit::NPRuntimeObjectMap::getOrCreateNPObject): 20 (WebKit::NPRuntimeObjectMap::finalize): 21 * WebProcess/WebPage/WebFrame.cpp: 22 (WebKit::WebFrame::frameForContext): 23 (WebKit::WebFrame::counterValue): 24 1 25 2013-12-04 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
r156624 r160133 60 60 static EncodedJSValue JSC_HOST_CALL callMethod(ExecState* exec) 61 61 { 62 JSNPMethod* jsNPMethod = static_cast<JSNPMethod*>(exec->callee());62 JSNPMethod* jsNPMethod = jsCast<JSNPMethod*>(exec->callee()); 63 63 64 64 JSValue thisValue = exec->hostThisValue(); … … 66 66 // Check if we're calling a method on the plug-in script object. 67 67 if (thisValue.inherits(JSHTMLElement::info())) { 68 JSHTMLElement* element = static_cast<JSHTMLElement*>(asObject(thisValue));68 JSHTMLElement* element = jsCast<JSHTMLElement*>(asObject(thisValue)); 69 69 70 70 // Try to get the script object from the element … … 74 74 75 75 if (thisValue.inherits(JSNPObject::info())) { 76 JSNPObject* jsNPObject = static_cast<JSNPObject*>(asObject(thisValue));76 JSNPObject* jsNPObject = jsCast<JSNPObject*>(asObject(thisValue)); 77 77 78 78 return JSValue::encode(jsNPObject->callMethod(exec, jsNPMethod->npIdentifier())); -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r156240 r160133 226 226 ASSERT(object->inherits(JSNPObject::info())); 227 227 228 return JSValue::encode( static_cast<JSNPObject*>(object)->callObject(exec));228 return JSValue::encode(jsCast<JSNPObject*>(object)->callObject(exec)); 229 229 } 230 230 … … 245 245 ASSERT(constructor->inherits(JSNPObject::info())); 246 246 247 return JSValue::encode( static_cast<JSNPObject*>(constructor)->callConstructor(exec));247 return JSValue::encode(jsCast<JSNPObject*>(constructor)->callConstructor(exec)); 248 248 } 249 249 … … 418 418 } 419 419 420 JSValue JSNPObject::propertyGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)421 { 422 JSNPObject* thisObj = static_cast<JSNPObject*>(asObject(slotBase));420 EncodedJSValue JSNPObject::propertyGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 421 { 422 JSNPObject* thisObj = jsCast<JSNPObject*>(JSValue::decode(slotBase)); 423 423 ASSERT_GC_OBJECT_INHERITS(thisObj, info()); 424 424 425 425 if (!thisObj->m_npObject) 426 return throwInvalidAccessError(exec);426 return JSValue::encode(throwInvalidAccessError(exec)); 427 427 428 428 if (!thisObj->m_npObject->_class->getProperty) 429 return jsUndefined();429 return JSValue::encode(jsUndefined()); 430 430 431 431 NPVariant result; … … 447 447 448 448 if (!returnValue) 449 return jsUndefined();449 return JSValue::encode(jsUndefined()); 450 450 451 451 JSValue propertyValue = thisObj->m_objectMap->convertNPVariantToJSValue(exec, thisObj->globalObject(), result); 452 452 releaseNPVariantValue(&result); 453 return propertyValue;454 } 455 456 JSValue JSNPObject::methodGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)457 { 458 JSNPObject* thisObj = static_cast<JSNPObject*>(asObject(slotBase));453 return JSValue::encode(propertyValue); 454 } 455 456 EncodedJSValue JSNPObject::methodGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName propertyName) 457 { 458 JSNPObject* thisObj = jsCast<JSNPObject*>(JSValue::decode(slotBase)); 459 459 ASSERT_GC_OBJECT_INHERITS(thisObj, info()); 460 460 461 461 if (!thisObj->m_npObject) 462 return throwInvalidAccessError(exec);462 return JSValue::encode(throwInvalidAccessError(exec)); 463 463 464 464 NPIdentifier npIdentifier = npIdentifierFromIdentifier(propertyName); 465 return JS NPMethod::create(exec, thisObj->globalObject(), propertyName.publicName(), npIdentifier);465 return JSValue::encode(JSNPMethod::create(exec, thisObj->globalObject(), propertyName.publicName(), npIdentifier)); 466 466 } 467 467 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r154373 r160133 96 96 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode); 97 97 98 static JSC:: JSValue propertyGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);99 static JSC:: JSValue methodGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);98 static JSC::EncodedJSValue propertyGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName); 99 static JSC::EncodedJSValue methodGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue, JSC::PropertyName); 100 100 static JSC::JSObject* throwInvalidAccessError(JSC::ExecState*); 101 101 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
r156626 r160133 73 73 // If this is a JSNPObject, we can just get its underlying NPObject. 74 74 if (jsObject->classInfo() == JSNPObject::info()) { 75 JSNPObject* jsNPObject = static_cast<JSNPObject*>(jsObject);75 JSNPObject* jsNPObject = jsCast<JSNPObject*>(jsObject); 76 76 NPObject* npObject = jsNPObject->npObject(); 77 77 … … 303 303 void NPRuntimeObjectMap::finalize(JSC::Handle<JSC::Unknown> handle, void* context) 304 304 { 305 JSNPObject* object = static_cast<JSNPObject*>(handle.get().asCell());305 JSNPObject* object = jsCast<JSNPObject*>(handle.get().asCell()); 306 306 weakRemove(m_jsNPObjects, static_cast<NPObject*>(context), object); 307 307 addToInvalidationQueue(object->leakNPObject()); -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r159234 r160133 665 665 return String(); 666 666 667 return counterValueForElement(& static_cast<JSElement*>(toJS(element))->impl());667 return counterValueForElement(&jsCast<JSElement*>(toJS(element))->impl()); 668 668 } 669 669
Note: See TracChangeset
for help on using the changeset viewer.