Changeset 156602 in webkit
- Timestamp:
- Sep 28, 2013 7:15:24 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r156597 r156602 1 2013-09-28 Andreas Kling <akling@apple.com> 2 3 Pass VM instead of ExecState to JSFunction constructors. 4 <https://webkit.org/b/122014> 5 6 Reviewed by Geoffrey Garen. 7 8 JSFunction doesn't need the ExecState for anything during its 9 construction, so reduce the amount of loads by just passing the 10 VM around instead. 11 12 Factored out putDirectNonIndexAccessor() from the existing 13 putDirectAccessor() to avoid snowballing the patch (and because 14 it's kinda neat to avoid the extra branch.) 15 16 JSC release binary size -= 9680 bytes. 17 1 18 2013-09-28 Mark Rowe <mrowe@apple.com> 2 19 -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r156490 r156602 858 858 VM& vm = exec->vm(); 859 859 NativeCallFrameTracer tracer(&vm, exec); 860 return JSFunction::create( exec, static_cast<FunctionExecutable*>(functionExecutable), exec->scope());860 return JSFunction::create(vm, static_cast<FunctionExecutable*>(functionExecutable), exec->scope()); 861 861 } 862 862 … … 866 866 VM& vm = exec->vm(); 867 867 NativeCallFrameTracer tracer(&vm, exec); 868 return JSValue::encode(JSFunction::create( exec, static_cast<FunctionExecutable*>(functionExecutable), exec->scope()));868 return JSValue::encode(JSFunction::create(vm, static_cast<FunctionExecutable*>(functionExecutable), exec->scope())); 869 869 } 870 870 … … 878 878 FunctionExecutable* functionExecutable = 879 879 static_cast<FunctionExecutable*>(functionExecutableAsCell); 880 return JSFunction::create( exec, functionExecutable, exec->scope());880 return JSFunction::create(vm, functionExecutable, exec->scope()); 881 881 } 882 882 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r156597 r156602 1210 1210 FunctionExecutable* function = codeBlock->functionDecl(i); 1211 1211 PutPropertySlot slot; 1212 variableObject->methodTable()->put(variableObject, callFrame, function->name(), JSFunction::create( callFrame, function, scope), slot);1212 variableObject->methodTable()->put(variableObject, callFrame, function->name(), JSFunction::create(vm, function, scope), slot); 1213 1213 } 1214 1214 } -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r156521 r156602 1156 1156 1157 1157 ASSERT(stackFrame.callFrame->codeBlock()->codeType() != FunctionCode || !stackFrame.callFrame->codeBlock()->needsFullScopeChain() || stackFrame.callFrame->uncheckedR(stackFrame.callFrame->codeBlock()->activationRegister().offset()).jsValue()); 1158 return JSFunction::create(stackFrame.callFrame , stackFrame.args[0].function(), stackFrame.callFrame->scope());1158 return JSFunction::create(stackFrame.callFrame->vm(), stackFrame.args[0].function(), stackFrame.callFrame->scope()); 1159 1159 } 1160 1160 … … 1931 1931 1932 1932 FunctionExecutable* function = stackFrame.args[0].function(); 1933 JSFunction* func = JSFunction::create(callFrame , function, callFrame->scope());1933 JSFunction* func = JSFunction::create(callFrame->vm(), function, callFrame->scope()); 1934 1934 ASSERT(callFrame->codeBlock()->codeType() != FunctionCode || !callFrame->codeBlock()->needsFullScopeChain() || callFrame->uncheckedR(callFrame->codeBlock()->activationRegister().offset()).jsValue()); 1935 1935 -
trunk/Source/JavaScriptCore/jsc.cpp
r156402 r156602 251 251 void addFunction(VM& vm, const char* name, NativeFunction function, unsigned arguments) 252 252 { 253 Identifier identifier( globalExec(), name);254 putDirect(vm, identifier, JSFunction::create( globalExec(), this, arguments, identifier.string(), function));253 Identifier identifier(&vm, name); 254 putDirect(vm, identifier, JSFunction::create(vm, this, arguments, identifier.string(), function)); 255 255 } 256 256 257 257 void addConstructableFunction(VM& vm, const char* name, NativeFunction function, unsigned arguments) 258 258 { 259 Identifier identifier( globalExec(), name);260 putDirect(vm, identifier, JSFunction::create( globalExec(), this, arguments, identifier.string(), function, NoIntrinsic, function));259 Identifier identifier(&vm, name); 260 putDirect(vm, identifier, JSFunction::create(vm, this, arguments, identifier.string(), function, NoIntrinsic, function)); 261 261 } 262 262 }; -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r156521 r156602 922 922 dataLogF("Creating function!\n"); 923 923 #endif 924 LLINT_RETURN(JSFunction::create( exec, codeBlock->functionDecl(pc[2].u.operand), exec->scope()));924 LLINT_RETURN(JSFunction::create(vm, codeBlock->functionDecl(pc[2].u.operand), exec->scope())); 925 925 } 926 926 … … 930 930 CodeBlock* codeBlock = exec->codeBlock(); 931 931 FunctionExecutable* function = codeBlock->functionExpr(pc[2].u.operand); 932 JSFunction* func = JSFunction::create( exec, function, exec->scope());932 JSFunction* func = JSFunction::create(vm, function, exec->scope()); 933 933 934 934 LLINT_RETURN(func); -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r156229 r156602 107 107 return; 108 108 109 VM& vm = exec->vm(); 109 110 m_overrodeCaller = true; 110 111 PropertyDescriptor descriptor; 111 descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter( exec), DontEnum | DontDelete | Accessor);112 methodTable()->defineOwnProperty(this, exec, exec->propertyNames().caller, descriptor, false);112 descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter(vm), DontEnum | DontDelete | Accessor); 113 methodTable()->defineOwnProperty(this, exec, vm.propertyNames->caller, descriptor, false); 113 114 } 114 115 … … 117 118 if (m_overrodeCallee) 118 119 return; 119 120 121 VM& vm = exec->vm(); 120 122 m_overrodeCallee = true; 121 123 PropertyDescriptor descriptor; 122 descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter( exec), DontEnum | DontDelete | Accessor);123 methodTable()->defineOwnProperty(this, exec, exec->propertyNames().callee, descriptor, false);124 descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter(vm), DontEnum | DontDelete | Accessor); 125 methodTable()->defineOwnProperty(this, exec, vm.propertyNames->callee, descriptor, false); 124 126 } 125 127 -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r155889 r156602 434 434 const UnlinkedProgramCodeBlock::FunctionDeclations& functionDeclarations = unlinkedCode->functionDeclarations(); 435 435 436 CallFrame* globalExec = globalObject->globalExec();437 438 436 for (size_t i = 0; i < functionDeclarations.size(); ++i) { 439 437 UnlinkedFunctionExecutable* unlinkedFunctionExecutable = functionDeclarations[i].second.get(); 440 JSValue value = JSFunction::create( globalExec, unlinkedFunctionExecutable->link(vm, m_source, lineNo(), 0), scope);438 JSValue value = JSFunction::create(vm, unlinkedFunctionExecutable->link(vm, m_source, lineNo(), 0), scope); 441 439 globalObject->addFunction(callFrame, functionDeclarations[i].first, value); 442 440 } -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r156498 r156602 119 119 } 120 120 121 return JSFunction::create(exec , function, globalObject);121 return JSFunction::create(exec->vm(), function, globalObject); 122 122 } 123 123 -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r156498 r156602 56 56 void FunctionPrototype::addFunctionProperties(ExecState* exec, JSGlobalObject* globalObject, JSFunction** callFunction, JSFunction** applyFunction) 57 57 { 58 JSFunction* toStringFunction = JSFunction::create(exec, globalObject, 0, exec->propertyNames().toString.string(), functionProtoFuncToString); 59 putDirectWithoutTransition(exec->vm(), exec->propertyNames().toString, toStringFunction, DontEnum); 60 61 *applyFunction = JSFunction::create(exec, globalObject, 2, exec->propertyNames().apply.string(), functionProtoFuncApply); 62 putDirectWithoutTransition(exec->vm(), exec->propertyNames().apply, *applyFunction, DontEnum); 63 64 *callFunction = JSFunction::create(exec, globalObject, 1, exec->propertyNames().call.string(), functionProtoFuncCall); 65 putDirectWithoutTransition(exec->vm(), exec->propertyNames().call, *callFunction, DontEnum); 66 67 JSFunction* bindFunction = JSFunction::create(exec, globalObject, 1, exec->propertyNames().bind.string(), functionProtoFuncBind); 68 putDirectWithoutTransition(exec->vm(), exec->propertyNames().bind, bindFunction, DontEnum); 58 VM& vm = exec->vm(); 59 60 JSFunction* toStringFunction = JSFunction::create(vm, globalObject, 0, vm.propertyNames->toString.string(), functionProtoFuncToString); 61 putDirectWithoutTransition(vm, vm.propertyNames->toString, toStringFunction, DontEnum); 62 63 *applyFunction = JSFunction::create(vm, globalObject, 2, vm.propertyNames->apply.string(), functionProtoFuncApply); 64 putDirectWithoutTransition(vm, vm.propertyNames->apply, *applyFunction, DontEnum); 65 66 *callFunction = JSFunction::create(vm, globalObject, 1, vm.propertyNames->call.string(), functionProtoFuncCall); 67 putDirectWithoutTransition(vm, vm.propertyNames->call, *callFunction, DontEnum); 68 69 JSFunction* bindFunction = JSFunction::create(vm, globalObject, 1, vm.propertyNames->bind.string(), functionProtoFuncBind); 70 putDirectWithoutTransition(vm, vm.propertyNames->bind, bindFunction, DontEnum); 69 71 } 70 72 … … 185 187 ASSERT(target.isObject()); 186 188 JSObject* targetObject = asObject(target); 189 VM& vm = exec->vm(); 187 190 188 191 // Let A be a new (possibly empty) internal list of all of the argument values provided after thisArg (arg1, arg2 etc), in order. 189 192 size_t numBoundArgs = exec->argumentCount() > 1 ? exec->argumentCount() - 1 : 0; 190 JSArray* boundArgs = JSArray::tryCreateUninitialized( exec->vm(), globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), numBoundArgs);193 JSArray* boundArgs = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), numBoundArgs); 191 194 if (!boundArgs) 192 195 return JSValue::encode(throwOutOfMemoryError(exec)); 193 196 194 197 for (size_t i = 0; i < numBoundArgs; ++i) 195 boundArgs->initializeIndex( exec->vm(), i, exec->argument(i + 1));198 boundArgs->initializeIndex(vm, i, exec->argument(i + 1)); 196 199 197 200 // If the [[Class]] internal property of Target is "Function", then ... … … 208 211 209 212 JSString* name = target.get(exec, exec->propertyNames().name).toString(exec); 210 return JSValue::encode(JSBoundFunction::create( exec, globalObject, targetObject, exec->argument(0), boundArgs, length, name->value(exec)));213 return JSValue::encode(JSBoundFunction::create(vm, globalObject, targetObject, exec->argument(0), boundArgs, length, name->value(exec))); 211 214 } 212 215 -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
r156498 r156602 75 75 } 76 76 77 JSBoundFunction* JSBoundFunction::create( ExecState* exec, JSGlobalObject* globalObject, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int length, const String& name)77 JSBoundFunction* JSBoundFunction::create(VM& vm, JSGlobalObject* globalObject, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int length, const String& name) 78 78 { 79 VM& vm = exec->vm();80 79 ConstructData constructData; 81 80 ConstructType constructType = JSC::getConstructData(targetFunction, constructData); 82 81 bool canConstruct = constructType != ConstructTypeNone; 83 82 NativeExecutable* executable = vm.getHostFunction(boundFunctionCall, canConstruct ? boundFunctionConstruct : callHostFunctionAsConstructor); 84 JSBoundFunction* function = new (NotNull, allocateCell<JSBoundFunction>(vm.heap)) JSBoundFunction( exec, globalObject, globalObject->boundFunctionStructure(), targetFunction, boundThis, boundArgs);83 JSBoundFunction* function = new (NotNull, allocateCell<JSBoundFunction>(vm.heap)) JSBoundFunction(vm, globalObject, globalObject->boundFunctionStructure(), targetFunction, boundThis, boundArgs); 85 84 86 function->finishCreation( exec, executable, length, name);85 function->finishCreation(vm, executable, length, name); 87 86 return function; 88 87 } … … 98 97 } 99 98 100 JSBoundFunction::JSBoundFunction( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs)101 : Base( exec, globalObject, structure)102 , m_targetFunction( exec->vm(), this, targetFunction)103 , m_boundThis( exec->vm(), this, boundThis)104 , m_boundArgs( exec->vm(), this, boundArgs)99 JSBoundFunction::JSBoundFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs) 100 : Base(vm, globalObject, structure) 101 , m_targetFunction(vm, this, targetFunction) 102 , m_boundThis(vm, this, boundThis) 103 , m_boundArgs(vm, this, boundArgs) 105 104 { 106 105 } 107 106 108 void JSBoundFunction::finishCreation( ExecState* exec, NativeExecutable* executable, int length, const String& name)107 void JSBoundFunction::finishCreation(VM& vm, NativeExecutable* executable, int length, const String& name) 109 108 { 110 VM& vm = exec->vm();111 109 Base::finishCreation(vm, executable, length, name); 112 110 ASSERT(inherits(info())); 113 111 114 putDirect Accessor(exec, vm.propertyNames->arguments, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);115 putDirect Accessor(exec, vm.propertyNames->caller, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);112 putDirectNonIndexAccessor(vm, vm.propertyNames->arguments, globalObject()->throwTypeErrorGetterSetter(vm), DontDelete | DontEnum | Accessor); 113 putDirectNonIndexAccessor(vm, vm.propertyNames->caller, globalObject()->throwTypeErrorGetterSetter(vm), DontDelete | DontEnum | Accessor); 116 114 } 117 115 -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h
r154038 r156602 38 38 typedef JSFunction Base; 39 39 40 static JSBoundFunction* create( ExecState*, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const String&);40 static JSBoundFunction* create(VM&, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const String&); 41 41 42 42 static void destroy(JSCell*); … … 62 62 63 63 private: 64 JSBoundFunction( ExecState*, JSGlobalObject*, Structure*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs);64 JSBoundFunction(VM&, JSGlobalObject*, Structure*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs); 65 65 66 void finishCreation( ExecState*, NativeExecutable*, int, const String&);66 void finishCreation(VM&, NativeExecutable*, int, const String&); 67 67 68 68 WriteBarrier<JSObject> m_targetFunction; -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r156498 r156602 62 62 } 63 63 64 JSFunction* JSFunction::create(ExecState* exec, JSGlobalObject* globalObject, int length, const String& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor) 65 { 66 VM& vm = exec->vm(); 67 64 JSFunction* JSFunction::create(VM& vm, JSGlobalObject* globalObject, int length, const String& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor) 65 { 68 66 NativeExecutable* executable; 69 67 #if !ENABLE(JIT) 70 68 UNUSED_PARAM(intrinsic); 71 69 #else 72 if (intrinsic != NoIntrinsic && exec->vm().canUseJIT()) {70 if (intrinsic != NoIntrinsic && vm.canUseJIT()) { 73 71 ASSERT(nativeConstructor == callHostFunctionAsConstructor); 74 72 executable = vm.getHostFunction(nativeFunction, intrinsic); … … 77 75 executable = vm.getHostFunction(nativeFunction, nativeConstructor); 78 76 79 JSFunction* function = new (NotNull, allocateCell<JSFunction>(vm.heap)) JSFunction( exec, globalObject, globalObject->functionStructure());77 JSFunction* function = new (NotNull, allocateCell<JSFunction>(vm.heap)) JSFunction(vm, globalObject, globalObject->functionStructure()); 80 78 // Can't do this during initialization because getHostFunction might do a GC allocation. 81 79 function->finishCreation(vm, executable, length, name); … … 88 86 } 89 87 90 JSFunction::JSFunction( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)91 : Base( exec->vm(), structure)88 JSFunction::JSFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure) 89 : Base(vm, structure) 92 90 , m_executable() 93 , m_scope( exec->vm(), this, globalObject)91 , m_scope(vm, this, globalObject) 94 92 // We initialize blind so that changes to the prototype after function creation but before 95 93 // the optimizer kicks in don't disable optimizations. Once the optimizer kicks in, the … … 326 324 bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 327 325 if (!result) { 328 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec ), DontDelete | DontEnum | Accessor);326 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor); 329 327 result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 330 328 ASSERT(result); … … 350 348 bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 351 349 if (!result) { 352 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec ), DontDelete | DontEnum | Accessor);350 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor); 353 351 result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 354 352 ASSERT(result); … … 448 446 PropertySlot slot(thisObject); 449 447 if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 450 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec ), DontDelete | DontEnum | Accessor);448 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor); 451 449 return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); 452 450 } … … 456 454 PropertySlot slot(thisObject); 457 455 if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 458 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec ), DontDelete | DontEnum | Accessor);456 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor); 459 457 return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); 460 458 } -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r156498 r156602 59 59 typedef JSDestructibleObject Base; 60 60 61 JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const String& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor); 62 63 static JSFunction* create(ExecState* exec, FunctionExecutable* executable, JSScope* scope) 64 { 65 VM& vm = exec->vm(); 61 JS_EXPORT_PRIVATE static JSFunction* create(VM&, JSGlobalObject*, int length, const String& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor); 62 63 static JSFunction* create(VM& vm, FunctionExecutable* executable, JSScope* scope) 64 { 66 65 JSFunction* function = new (NotNull, allocateCell<JSFunction>(vm.heap)) JSFunction(vm, executable, scope); 67 66 ASSERT(function->structure()->globalObject()); … … 163 162 const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags; 164 163 165 JS_EXPORT_PRIVATE JSFunction( ExecState*, JSGlobalObject*, Structure*);164 JS_EXPORT_PRIVATE JSFunction(VM&, JSGlobalObject*, Structure*); 166 165 JSFunction(VM&, FunctionExecutable*, JSScope*); 167 166 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r156521 r156602 241 241 m_objectPrototype.set(vm, this, ObjectPrototype::create(exec, this, ObjectPrototype::createStructure(vm, this, jsNull()))); 242 242 GetterSetter* protoAccessor = GetterSetter::create(vm); 243 protoAccessor->setGetter(vm, JSFunction::create( exec, this, 0, String(), globalFuncProtoGetter));244 protoAccessor->setSetter(vm, JSFunction::create( exec, this, 0, String(), globalFuncProtoSetter));245 m_objectPrototype->putDirect Accessor(exec, vm.propertyNames->underscoreProto, protoAccessor, Accessor | DontEnum);243 protoAccessor->setGetter(vm, JSFunction::create(vm, this, 0, String(), globalFuncProtoGetter)); 244 protoAccessor->setSetter(vm, JSFunction::create(vm, this, 0, String(), globalFuncProtoSetter)); 245 m_objectPrototype->putDirectNonIndexAccessor(vm, vm.propertyNames->underscoreProto, protoAccessor, Accessor | DontEnum); 246 246 m_functionPrototype->structure()->setPrototypeWithoutTransition(vm, m_objectPrototype.get()); 247 247 … … 385 385 386 386 387 m_evalFunction.set(vm, this, JSFunction::create( exec, this, 1, vm.propertyNames->eval.string(), globalFuncEval));387 m_evalFunction.set(vm, this, JSFunction::create(vm, this, 1, vm.propertyNames->eval.string(), globalFuncEval)); 388 388 putDirectWithoutTransition(vm, vm.propertyNames->eval, m_evalFunction.get(), DontEnum); 389 389 … … 549 549 } 550 550 551 void JSGlobalObject::createThrowTypeError(ExecState* exec) 552 { 553 VM& vm = exec->vm(); 554 JSFunction* thrower = JSFunction::create(exec, this, 0, String(), globalFuncThrowTypeError); 551 void JSGlobalObject::createThrowTypeError(VM& vm) 552 { 553 JSFunction* thrower = JSFunction::create(vm, this, 0, String(), globalFuncThrowTypeError); 555 554 GetterSetter* getterSetter = GetterSetter::create(vm); 556 555 getterSetter->setGetter(vm, thrower); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r156492 r156602 336 336 JSFunction* callFunction() const { return m_callFunction.get(); } 337 337 JSFunction* applyFunction() const { return m_applyFunction.get(); } 338 GetterSetter* throwTypeErrorGetterSetter( ExecState* exec)338 GetterSetter* throwTypeErrorGetterSetter(VM& vm) 339 339 { 340 340 if (!m_throwTypeErrorGetterSetter) 341 createThrowTypeError( exec);341 createThrowTypeError(vm); 342 342 return m_throwTypeErrorGetterSetter.get(); 343 343 } … … 545 545 void reset(JSValue prototype); 546 546 547 void createThrowTypeError( ExecState*);547 void createThrowTypeError(VM&); 548 548 549 549 JS_EXPORT_PRIVATE static void clearRareData(JSCell*); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r156521 r156602 1193 1193 } 1194 1194 1195 VM& vm = exec->vm(); 1196 1195 putDirectNonIndexAccessor(exec->vm(), propertyName, value, attributes); 1196 } 1197 1198 void JSObject::putDirectNonIndexAccessor(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes) 1199 { 1197 1200 PutPropertySlot slot; 1198 1201 putDirectInternal<PutModeDefineOwnProperty>(vm, propertyName, value, attributes, slot, getCallableObject(value)); … … 2203 2206 StringImpl* name = propertyName.publicName(); 2204 2207 ASSERT(name); 2205 2206 JSFunction* function = JSFunction::create(exec, globalObject, functionLength, name, nativeFunction, intrinsic); 2207 putDirect(exec->vm(), propertyName, function, attributes); 2208 2209 VM& vm = exec->vm(); 2210 JSFunction* function = JSFunction::create(vm, globalObject, functionLength, name, nativeFunction, intrinsic); 2211 putDirect(vm, propertyName, function, attributes); 2208 2212 } 2209 2213 … … 2212 2216 StringImpl* name = propertyName.publicName(); 2213 2217 ASSERT(name); 2214 2215 JSFunction* function = JSFunction::create(exec, globalObject, functionLength, name, nativeFunction, intrinsic); 2216 putDirectWithoutTransition(exec->vm(), propertyName, function, attributes); 2218 2219 VM& vm = exec->vm(); 2220 JSFunction* function = JSFunction::create(vm, globalObject, functionLength, name, nativeFunction, intrinsic); 2221 putDirectWithoutTransition(vm, propertyName, function, attributes); 2217 2222 } 2218 2223 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r154471 r156602 461 461 void putDirect(VM&, PropertyName, JSValue, PutPropertySlot&); 462 462 void putDirectWithoutTransition(VM&, PropertyName, JSValue, unsigned attributes = 0); 463 void putDirectNonIndexAccessor(VM&, PropertyName, JSValue, unsigned attributes); 463 464 void putDirectAccessor(ExecState*, PropertyName, JSValue, unsigned attributes); 464 465 -
trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp
r156521 r156602 65 65 66 66 GetterSetter* accessor = GetterSetter::create(vm); 67 JSFunction* function = JSFunction::create( exec, globalObject, 0, vm.propertyNames->size.string(), mapProtoFuncSize);67 JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames->size.string(), mapProtoFuncSize); 68 68 accessor->setGetter(vm, function); 69 putDirect Accessor(exec, vm.propertyNames->size, accessor, DontEnum | Accessor);69 putDirectNonIndexAccessor(vm, vm.propertyNames->size, accessor, DontEnum | Accessor); 70 70 } 71 71 -
trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp
r156521 r156602 63 63 64 64 GetterSetter* accessor = GetterSetter::create(vm); 65 JSFunction* function = JSFunction::create( exec, globalObject, 0, vm.propertyNames->size.string(), setProtoFuncSize);65 JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames->size.string(), setProtoFuncSize); 66 66 accessor->setGetter(vm, function); 67 putDirect Accessor(exec, vm.propertyNames->size, accessor, DontEnum | Accessor);67 putDirectNonIndexAccessor(vm, vm.propertyNames->size, accessor, DontEnum | Accessor); 68 68 } 69 69 -
trunk/Source/WebCore/ChangeLog
r156601 r156602 1 2013-09-28 Andreas Kling <akling@apple.com> 2 3 Pass VM instead of ExecState to JSFunction constructors. 4 <https://webkit.org/b/122014> 5 6 Reviewed by Geoffrey Garen. 7 8 Updated for new JSFunction::create() signature. 9 1 10 2013-09-28 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 11 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp
r156550 r156602 275 275 JSValue objectToStringFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 276 276 { 277 return JSFunction::create(exec , exec->lexicalGlobalObject(), 0, propertyName.publicName(), objectProtoFuncToString);277 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), objectProtoFuncToString); 278 278 } 279 279 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r156485 r156602 74 74 JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 75 75 { 76 return JSFunction::create(exec , exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction);76 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction); 77 77 } 78 78 -
trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp
r156419 r156602 41 41 static JSValue nonCachingStaticBackFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 42 42 { 43 return JSFunction::create(exec , exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionBack);43 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionBack); 44 44 } 45 45 46 46 static JSValue nonCachingStaticForwardFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 47 47 { 48 return JSFunction::create(exec , exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionForward);48 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsHistoryPrototypeFunctionForward); 49 49 } 50 50 51 51 static JSValue nonCachingStaticGoFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 52 52 { 53 return JSFunction::create(exec , exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsHistoryPrototypeFunctionGo);53 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsHistoryPrototypeFunctionGo); 54 54 } 55 55 -
trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp
r154422 r156602 33 33 static JSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 34 34 { 35 return JSFunction::create(exec , exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionReplace);35 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionReplace); 36 36 } 37 37 38 38 static JSValue nonCachingStaticReloadFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 39 39 { 40 return JSFunction::create(exec , exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsLocationPrototypeFunctionReload);40 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 0, propertyName.publicName(), jsLocationPrototypeFunctionReload); 41 41 } 42 42 43 43 static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, JSValue, PropertyName propertyName) 44 44 { 45 return JSFunction::create(exec , exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionAssign);45 return JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), 1, propertyName.publicName(), jsLocationPrototypeFunctionAssign); 46 46 } 47 47
Note: See TracChangeset
for help on using the changeset viewer.