Changeset 229362 in webkit
- Timestamp:
- Mar 7, 2018 9:18:49 AM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r229356 r229362 1 2018-03-07 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Add more JSType based fast path for jsDynamicCast 4 https://bugs.webkit.org/show_bug.cgi?id=183403 5 6 Reviewed by Mark Lam. 7 8 We add more JSType based fast path for jsDynamicCast. Basically, we add miscellaneous JSTypes which 9 are used for jsDynamicCast in JSC, arguments types, and scope types. 10 11 We also add ClassInfo to JSScope and JSSegmentedVariableObject since they are used with jsDynamicCast. 12 13 * jit/JITOperations.cpp: 14 * llint/LLIntSlowPaths.cpp: 15 (JSC::LLInt::setUpCall): 16 * runtime/ClonedArguments.h: 17 (JSC::ClonedArguments::specialsMaterialized const): Deleted. 18 * runtime/DirectArguments.h: 19 (JSC::DirectArguments::subspaceFor): Deleted. 20 (JSC::DirectArguments::internalLength const): Deleted. 21 (JSC::DirectArguments::length const): Deleted. 22 (JSC::DirectArguments::isMappedArgument const): Deleted. 23 (JSC::DirectArguments::isMappedArgumentInDFG const): Deleted. 24 (JSC::DirectArguments::getIndexQuickly const): Deleted. 25 (JSC::DirectArguments::setIndexQuickly): Deleted. 26 (JSC::DirectArguments::callee): Deleted. 27 (JSC::DirectArguments::argument): Deleted. 28 (JSC::DirectArguments::overrodeThings const): Deleted. 29 (JSC::DirectArguments::initModifiedArgumentsDescriptorIfNecessary): Deleted. 30 (JSC::DirectArguments::setModifiedArgumentDescriptor): Deleted. 31 (JSC::DirectArguments::isModifiedArgumentDescriptor): Deleted. 32 (JSC::DirectArguments::offsetOfCallee): Deleted. 33 (JSC::DirectArguments::offsetOfLength): Deleted. 34 (JSC::DirectArguments::offsetOfMinCapacity): Deleted. 35 (JSC::DirectArguments::offsetOfMappedArguments): Deleted. 36 (JSC::DirectArguments::offsetOfModifiedArgumentsDescriptor): Deleted. 37 (JSC::DirectArguments::storageOffset): Deleted. 38 (JSC::DirectArguments::offsetOfSlot): Deleted. 39 (JSC::DirectArguments::allocationSize): Deleted. 40 (JSC::DirectArguments::storage): Deleted. 41 * runtime/JSCast.h: 42 * runtime/JSGlobalLexicalEnvironment.h: 43 (JSC::JSGlobalLexicalEnvironment::create): Deleted. 44 (JSC::JSGlobalLexicalEnvironment::isEmpty const): Deleted. 45 (JSC::JSGlobalLexicalEnvironment::createStructure): Deleted. 46 (JSC::JSGlobalLexicalEnvironment::JSGlobalLexicalEnvironment): Deleted. 47 * runtime/JSGlobalObject.cpp: 48 (JSC::JSGlobalObject::finishCreation): 49 * runtime/JSMap.h: 50 (JSC::isJSMap): Deleted. 51 * runtime/JSModuleEnvironment.h: 52 (JSC::JSModuleEnvironment::create): Deleted. 53 (JSC::JSModuleEnvironment::createStructure): Deleted. 54 (JSC::JSModuleEnvironment::offsetOfModuleRecord): Deleted. 55 (JSC::JSModuleEnvironment::allocationSize): Deleted. 56 (JSC::JSModuleEnvironment::moduleRecord): Deleted. 57 (JSC::JSModuleEnvironment::moduleRecordSlot): Deleted. 58 * runtime/JSObject.cpp: 59 (JSC::canDoFastPutDirectIndex): 60 (JSC::JSObject::defineOwnIndexedProperty): 61 (JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength): 62 * runtime/JSObject.h: 63 (JSC::JSFinalObject::allocationSize): Deleted. 64 (JSC::JSFinalObject::typeInfo): Deleted. 65 (JSC::JSFinalObject::defaultInlineCapacity): Deleted. 66 (JSC::JSFinalObject::maxInlineCapacity): Deleted. 67 (JSC::JSFinalObject::createStructure): Deleted. 68 (JSC::JSFinalObject::finishCreation): Deleted. 69 (JSC::JSFinalObject::JSFinalObject): Deleted. 70 (JSC::isJSFinalObject): Deleted. 71 * runtime/JSScope.cpp: 72 * runtime/JSScope.h: 73 * runtime/JSSegmentedVariableObject.cpp: 74 * runtime/JSSegmentedVariableObject.h: 75 * runtime/JSSet.h: 76 (JSC::isJSSet): Deleted. 77 * runtime/JSType.h: 78 * runtime/JSWeakMap.h: 79 (JSC::isJSWeakMap): Deleted. 80 * runtime/JSWeakSet.h: 81 (JSC::isJSWeakSet): Deleted. 82 * runtime/JSWithScope.h: 83 (JSC::JSWithScope::object): Deleted. 84 * runtime/MapConstructor.cpp: 85 (JSC::constructMap): 86 (JSC::mapPrivateFuncMapBucketHead): 87 * runtime/MapPrototype.cpp: 88 (JSC::getMap): 89 * runtime/NumberObject.cpp: 90 (JSC::NumberObject::finishCreation): 91 * runtime/NumberPrototype.cpp: 92 (JSC::toThisNumber): 93 (JSC::numberProtoFuncToExponential): 94 (JSC::numberProtoFuncToFixed): 95 (JSC::numberProtoFuncToPrecision): 96 (JSC::numberProtoFuncToString): 97 (JSC::numberProtoFuncToLocaleString): 98 (JSC::numberProtoFuncValueOf): 99 * runtime/ObjectConstructor.cpp: 100 (JSC::objectConstructorSeal): 101 (JSC::objectConstructorFreeze): 102 (JSC::objectConstructorIsSealed): 103 (JSC::objectConstructorIsFrozen): 104 * runtime/ProxyObject.cpp: 105 (JSC::ProxyObject::finishCreation): 106 * runtime/ScopedArguments.h: 107 (JSC::ScopedArguments::subspaceFor): Deleted. 108 (JSC::ScopedArguments::internalLength const): Deleted. 109 (JSC::ScopedArguments::length const): Deleted. 110 (JSC::ScopedArguments::isMappedArgument const): Deleted. 111 (JSC::ScopedArguments::isMappedArgumentInDFG const): Deleted. 112 (JSC::ScopedArguments::getIndexQuickly const): Deleted. 113 (JSC::ScopedArguments::setIndexQuickly): Deleted. 114 (JSC::ScopedArguments::callee): Deleted. 115 (JSC::ScopedArguments::overrodeThings const): Deleted. 116 (JSC::ScopedArguments::initModifiedArgumentsDescriptorIfNecessary): Deleted. 117 (JSC::ScopedArguments::setModifiedArgumentDescriptor): Deleted. 118 (JSC::ScopedArguments::isModifiedArgumentDescriptor): Deleted. 119 (JSC::ScopedArguments::offsetOfOverrodeThings): Deleted. 120 (JSC::ScopedArguments::offsetOfTotalLength): Deleted. 121 (JSC::ScopedArguments::offsetOfTable): Deleted. 122 (JSC::ScopedArguments::offsetOfScope): Deleted. 123 (JSC::ScopedArguments::overflowStorageOffset): Deleted. 124 (JSC::ScopedArguments::allocationSize): Deleted. 125 (JSC::ScopedArguments::overflowStorage const): Deleted. 126 * runtime/SetConstructor.cpp: 127 (JSC::constructSet): 128 (JSC::setPrivateFuncSetBucketHead): 129 * runtime/SetPrototype.cpp: 130 (JSC::getSet): 131 * runtime/StrictEvalActivation.h: 132 (JSC::StrictEvalActivation::create): Deleted. 133 (JSC::StrictEvalActivation::createStructure): Deleted. 134 * runtime/WeakMapPrototype.cpp: 135 (JSC::getWeakMap): 136 * runtime/WeakSetPrototype.cpp: 137 (JSC::getWeakSet): 138 1 139 2018-03-07 Dominik Infuehr <dinfuehr@igalia.com> 2 140 -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r228720 r229362 939 939 JSCell* calleeAsFunctionCell = getJSFunction(calleeAsValue); 940 940 if (!calleeAsFunctionCell) { 941 if ( calleeAsValue.isCell() && calleeAsValue.asCell()->type() == InternalFunctionType) {941 if (auto* internalFunction = jsDynamicCast<InternalFunction*>(*vm, calleeAsValue)) { 942 942 MacroAssemblerCodePtr codePtr = vm->getCTIInternalFunctionTrampolineFor(kind); 943 943 RELEASE_ASSERT(!!codePtr); … … 946 946 callLinkInfo->setSeen(); 947 947 else 948 linkFor(execCallee, *callLinkInfo, nullptr, asObject(calleeAsValue), codePtr);948 linkFor(execCallee, *callLinkInfo, nullptr, internalFunction, codePtr); 949 949 950 950 return encodeResult(codePtr.executableAddress(), reinterpret_cast<void*>(callLinkInfo->callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame)); … … 1061 1061 calleeAsFunctionCell = getJSFunction(calleeAsValue); 1062 1062 if (UNLIKELY(!calleeAsFunctionCell)) { 1063 if ( calleeAsValue.isCell() && calleeAsValue.asCell()->type() == InternalFunctionType) {1063 if (jsDynamicCast<InternalFunction*>(*vm, calleeAsValue)) { 1064 1064 MacroAssemblerCodePtr codePtr = vm->getCTIInternalFunctionTrampolineFor(kind); 1065 1065 ASSERT(!!codePtr); -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r229354 r229362 1374 1374 JSCell* calleeAsFunctionCell = getJSFunction(calleeAsValue); 1375 1375 if (!calleeAsFunctionCell) { 1376 if (calleeAsValue.isCell() && calleeAsValue.asCell()->type() == InternalFunctionType) { 1377 auto* internalFunction = jsCast<InternalFunction*>(calleeAsValue.asCell()); 1376 if (auto* internalFunction = jsDynamicCast<InternalFunction*>(vm, calleeAsValue)) { 1378 1377 MacroAssemblerCodePtr codePtr = vm.getCTIInternalFunctionTrampolineFor(kind); 1379 1378 ASSERT(!!codePtr); -
trunk/Source/JavaScriptCore/runtime/ClonedArguments.h
r208377 r229362 38 38 // the object claim to be "Arguments" from a toString standpoint, and to avoid materializing the 39 39 // caller/callee/@@iterator properties unless someone asks for them. 40 class ClonedArguments : public JSNonFinalObject {40 class ClonedArguments final : public JSNonFinalObject { 41 41 public: 42 42 typedef JSNonFinalObject Base; -
trunk/Source/JavaScriptCore/runtime/DirectArguments.h
r227643 r229362 42 42 // To speed allocation, this object will hold all of the arguments in-place. The arguments as well 43 43 // as a table of flags saying which arguments were overridden. 44 class DirectArguments : public GenericArguments<DirectArguments> {44 class DirectArguments final : public GenericArguments<DirectArguments> { 45 45 private: 46 46 DirectArguments(VM&, Structure*, unsigned length, unsigned capacity); -
trunk/Source/JavaScriptCore/runtime/JSCast.h
r228500 r229362 49 49 #define FOR_EACH_JS_DYNAMIC_CAST_JS_TYPE_OVERLOAD(macro) \ 50 50 macro(JSObject, JSType::ObjectType, JSType::LastJSCObjectType) \ 51 macro(JSFinalObject, JSType::FinalObjectType, JSType::FinalObjectType) \ 51 52 macro(JSFunction, JSType::JSFunctionType, JSType::JSFunctionType) \ 52 53 macro(InternalFunction, JSType::InternalFunctionType, JSType::InternalFunctionType) \ 53 54 macro(JSArray, JSType::ArrayType, JSType::DerivedArrayType) \ 54 55 macro(JSArrayBufferView, FirstTypedArrayType, LastTypedArrayType) \ 56 macro(JSSet, JSType::JSSetType, JSType::JSSetType) \ 57 macro(JSMap, JSType::JSMapType, JSType::JSMapType) \ 58 macro(JSWeakSet, JSType::JSWeakSetType, JSType::JSWeakSetType) \ 59 macro(JSWeakMap, JSType::JSWeakMapType, JSType::JSWeakMapType) \ 60 macro(NumberObject, JSType::NumberObjectType, JSType::NumberObjectType) \ 61 macro(ProxyObject, JSType::ProxyObjectType, JSType::ProxyObjectType) \ 62 macro(DirectArguments, JSType::DirectArgumentsType, JSType::DirectArgumentsType) \ 63 macro(ScopedArguments, JSType::ScopedArgumentsType, JSType::ScopedArgumentsType) \ 64 macro(ClonedArguments, JSType::ClonedArgumentsType, JSType::ClonedArgumentsType) \ 65 macro(JSGlobalObject, JSType::GlobalObjectType, JSType::GlobalObjectType) \ 66 macro(JSGlobalLexicalEnvironment, JSType::GlobalLexicalEnvironmentType, JSType::GlobalLexicalEnvironmentType) \ 67 macro(JSSegmentedVariableObject, JSType::GlobalObjectType, JSType::GlobalLexicalEnvironmentType) \ 68 macro(JSModuleEnvironment, JSType::ModuleEnvironmentType, JSType::ModuleEnvironmentType) \ 69 macro(JSLexicalEnvironment, JSType::LexicalEnvironmentType, JSType::ModuleEnvironmentType) \ 70 macro(JSSymbolTableObject, JSType::GlobalObjectType, JSType::ModuleEnvironmentType) \ 71 macro(JSScope, JSType::GlobalObjectType, JSType::WithScopeType) \ 55 72 56 73 -
trunk/Source/JavaScriptCore/runtime/JSGlobalLexicalEnvironment.h
r222143 r229362 30 30 namespace JSC { 31 31 32 class JSGlobalLexicalEnvironment : public JSSegmentedVariableObject {32 class JSGlobalLexicalEnvironment final : public JSSegmentedVariableObject { 33 33 34 34 public: 35 typedef JSSegmentedVariableObject Base;35 using Base = JSSegmentedVariableObject; 36 36 37 37 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r229161 r229362 1600 1600 init(vm); 1601 1601 setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, getPrototypeDirect(vm), PureForwardingProxyType), this)); 1602 ASSERT(type() == GlobalObjectType); 1602 1603 } 1603 1604 … … 1609 1610 init(vm); 1610 1611 setGlobalThis(vm, thisValue); 1612 ASSERT(type() == GlobalObjectType); 1611 1613 } 1612 1614 -
trunk/Source/JavaScriptCore/runtime/JSMap.h
r221110 r229362 67 67 }; 68 68 69 inline bool isJSMap(JSCell* from) 70 { 71 static_assert(std::is_final<JSMap>::value, ""); 72 return from->type() == JSMapType; 73 } 74 75 inline bool isJSMap(JSValue from) 76 { 77 static_assert(std::is_final<JSMap>::value, ""); 78 return from.isCell() && from.asCell()->type() == JSMapType; 79 } 69 static_assert(std::is_final<JSMap>::value, "Required for JSType based casting"); 80 70 81 71 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSModuleEnvironment.h
r209123 r229362 36 36 class Register; 37 37 38 class JSModuleEnvironment : public JSLexicalEnvironment {38 class JSModuleEnvironment final : public JSLexicalEnvironment { 39 39 friend class JIT; 40 40 friend class LLIntOffsetsExtractor; 41 41 public: 42 typedef JSLexicalEnvironment Base;42 using Base = JSLexicalEnvironment; 43 43 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames; 44 44 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r228576 r229362 2408 2408 } 2409 2409 2410 ALWAYS_INLINE static bool canDoFastPutDirectIndex( JSObject* object)2410 ALWAYS_INLINE static bool canDoFastPutDirectIndex(VM& vm, JSObject* object) 2411 2411 { 2412 2412 return isJSArray(object) 2413 || isJSFinalObject(object)2413 || jsDynamicCast<JSFinalObject*>(vm, object) 2414 2414 || TypeInfo::isArgumentsType(object->type()); 2415 2415 } … … 2428 2428 // however if the property currently exists missing attributes will override from their current 'true' 2429 2429 // state (i.e. defineOwnProperty could be used to set a value without needing to entering 'SparseMode'). 2430 if (!descriptor.attributes() && descriptor.value() && canDoFastPutDirectIndex( this)) {2430 if (!descriptor.attributes() && descriptor.value() && canDoFastPutDirectIndex(vm, this)) { 2431 2431 ASSERT(!descriptor.isAccessorDescriptor()); 2432 2432 scope.release(); … … 2882 2882 VM& vm = exec->vm(); 2883 2883 2884 if (!canDoFastPutDirectIndex( this)) {2884 if (!canDoFastPutDirectIndex(vm, this)) { 2885 2885 PropertyDescriptor descriptor; 2886 2886 descriptor.setDescriptor(value, attributes); -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r228552 r229362 1097 1097 class JSFinalObject; 1098 1098 1099 // JSFinalObject is a type of JSObject that contains suffic ent internal1100 // storage to fully make use of the coll octor cell containing it.1101 class JSFinalObject : public JSObject {1099 // JSFinalObject is a type of JSObject that contains sufficient internal 1100 // storage to fully make use of the collector cell containing it. 1101 class JSFinalObject final : public JSObject { 1102 1102 friend class JSObject; 1103 1103 … … 1194 1194 finalObject->finishCreation(vm); 1195 1195 return finalObject; 1196 }1197 1198 inline bool isJSFinalObject(JSCell* cell)1199 {1200 return cell->type() == FinalObjectType;1201 }1202 1203 inline bool isJSFinalObject(JSValue value)1204 {1205 return value.isCell() && isJSFinalObject(value.asCell());1206 1196 } 1207 1197 -
trunk/Source/JavaScriptCore/runtime/JSScope.cpp
r222143 r229362 40 40 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSScope); 41 41 42 const ClassInfo JSScope::s_info = { "Scope", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSScope) }; 43 42 44 void JSScope::visitChildren(JSCell* cell, SlotVisitor& visitor) 43 45 { -
trunk/Source/JavaScriptCore/runtime/JSScope.h
r222143 r229362 38 38 class JSScope : public JSNonFinalObject { 39 39 public: 40 typedef JSNonFinalObject Base;40 using Base = JSNonFinalObject; 41 41 static const unsigned StructureFlags = Base::StructureFlags | OverridesToThis; 42 43 DECLARE_EXPORT_INFO; 42 44 43 45 friend class LLIntOffsetsExtractor; -
trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp
r210912 r229362 34 34 35 35 namespace JSC { 36 37 const ClassInfo JSSegmentedVariableObject::s_info = { "SegmentedVariableObject", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSegmentedVariableObject) }; 36 38 37 39 ScopeOffset JSSegmentedVariableObject::findVariableIndex(void* variableAddress) -
trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
r225632 r229362 55 55 56 56 public: 57 typedef JSSymbolTableObject Base; 57 using Base = JSSymbolTableObject; 58 59 DECLARE_INFO; 58 60 59 61 bool isValidScopeOffset(ScopeOffset offset) -
trunk/Source/JavaScriptCore/runtime/JSSet.h
r221110 r229362 72 72 }; 73 73 74 inline bool isJSSet(JSCell* from) 75 { 76 static_assert(std::is_final<JSSet>::value, ""); 77 return from->type() == JSSetType; 78 } 79 80 inline bool isJSSet(JSValue from) 81 { 82 static_assert(std::is_final<JSSet>::value, ""); 83 return from.isCell() && from.asCell()->type() == JSSetType; 84 } 74 static_assert(std::is_final<JSSet>::value, "Required for JSType based casting"); 85 75 86 76 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSType.h
r228500 r229362 62 62 PureForwardingProxyType, 63 63 ImpureProxyType, 64 WithScopeType,65 64 DirectArgumentsType, 66 65 ScopedArgumentsType, … … 87 86 GetterSetterType, 88 87 88 // JSScope <- JSWithScope 89 // <- StrictEvalActivation 90 // <- JSSymbolTableObject <- JSLexicalEnvironment <- JSModuleEnvironment 91 // <- JSSegmentedVariableObject <- JSGlobalLexicalEnvironment 92 // <- JSGlobalObject 93 // Start JSScope types. 89 94 // Start environment record types. 90 95 GlobalObjectType, 96 GlobalLexicalEnvironmentType, 91 97 LexicalEnvironmentType, 92 GlobalLexicalEnvironmentType,93 98 ModuleEnvironmentType, 94 99 StrictEvalActivationType, 95 100 // End environment record types. 101 WithScopeType, 102 // End JSScope types. 96 103 97 104 RegExpObjectType, -
trunk/Source/JavaScriptCore/runtime/JSWeakMap.h
r225832 r229362 63 63 }; 64 64 65 inline bool isJSWeakMap(JSCell* from) 66 { 67 static_assert(std::is_final<JSWeakMap>::value, ""); 68 return from->type() == JSWeakMapType; 69 } 70 71 inline bool isJSWeakMap(JSValue from) 72 { 73 static_assert(std::is_final<JSWeakMap>::value, ""); 74 return from.isCell() && from.asCell()->type() == JSWeakMapType; 75 } 65 static_assert(std::is_final<JSWeakMap>::value, "Required for JSType based casting"); 76 66 77 67 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSWeakSet.h
r225832 r229362 58 58 }; 59 59 60 inline bool isJSWeakSet(JSCell* from) 61 { 62 static_assert(std::is_final<JSWeakSet>::value, ""); 63 return from->type() == JSWeakSetType; 64 } 65 66 inline bool isJSWeakSet(JSValue from) 67 { 68 static_assert(std::is_final<JSWeakSet>::value, ""); 69 return from.isCell() && from.asCell()->type() == JSWeakSetType; 70 } 60 static_assert(std::is_final<JSWeakSet>::value, "Required for JSType based casting"); 71 61 72 62 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSWithScope.h
r220778 r229362 30 30 namespace JSC { 31 31 32 class JSWithScope : public JSScope {32 class JSWithScope final : public JSScope { 33 33 public: 34 typedef JSScope Base;34 using Base = JSScope; 35 35 36 36 JS_EXPORT_PRIVATE static JSWithScope* create(VM&, JSGlobalObject*, JSScope* next, JSObject*); -
trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp
r224487 r229362 78 78 } 79 79 80 if (isJSMap(iterable)) { 81 JSMap* iterableMap = jsCast<JSMap*>(iterable); 80 if (auto* iterableMap = jsDynamicCast<JSMap*>(vm, iterable)) { 82 81 if (iterableMap->canCloneFastAndNonObservable(mapStructure)) { 83 82 scope.release(); … … 124 123 EncodedJSValue JSC_HOST_CALL mapPrivateFuncMapBucketHead(ExecState* exec) 125 124 { 126 ASSERT( isJSMap(exec->argument(0)));125 ASSERT(jsDynamicCast<JSMap*>(exec->vm(), exec->argument(0))); 127 126 JSMap* map = jsCast<JSMap*>(exec->uncheckedArgument(0)); 128 127 auto* head = map->head(); -
trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp
r225072 r229362 90 90 } 91 91 92 if (LIKELY(thisValue.asCell()->type() == JSMapType)) 93 return jsCast<JSMap*>(thisValue); 92 auto* map = jsDynamicCast<JSMap*>(vm, thisValue.asCell()); 93 if (LIKELY(map)) 94 return map; 94 95 throwTypeError(callFrame, scope, ASCIILiteral("Map operation called on non-Map object")); 95 96 return nullptr; -
trunk/Source/JavaScriptCore/runtime/NumberObject.cpp
r217108 r229362 42 42 Base::finishCreation(vm); 43 43 ASSERT(inherits(vm, info())); 44 ASSERT(type() == NumberObjectType); 44 45 } 45 46 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r227716 r229362 90 90 // ------------------------------ Functions --------------------------- 91 91 92 static ALWAYS_INLINE bool toThisNumber( JSValue thisValue, double& x)92 static ALWAYS_INLINE bool toThisNumber(VM& vm, JSValue thisValue, double& x) 93 93 { 94 94 if (thisValue.isInt32()) { … … 101 101 return true; 102 102 } 103 104 if ( thisValue.isCell() && thisValue.asCell()->type() == NumberObjectType) {105 x = static_cast<const NumberObject*>(thisValue.asCell())->internalValue().asNumber();103 104 if (auto* numberObject = jsDynamicCast<NumberObject*>(vm, thisValue)) { 105 x = numberObject->internalValue().asNumber(); 106 106 return true; 107 107 } … … 408 408 409 409 double x; 410 if (!toThisNumber( exec->thisValue(), x))410 if (!toThisNumber(vm, exec->thisValue(), x)) 411 411 return throwVMTypeError(exec, scope); 412 412 … … 445 445 446 446 double x; 447 if (!toThisNumber( exec->thisValue(), x))447 if (!toThisNumber(vm, exec->thisValue(), x)) 448 448 return throwVMTypeError(exec, scope); 449 449 … … 483 483 484 484 double x; 485 if (!toThisNumber( exec->thisValue(), x))485 if (!toThisNumber(vm, exec->thisValue(), x)) 486 486 return throwVMTypeError(exec, scope); 487 487 … … 581 581 582 582 double doubleValue; 583 if (!toThisNumber( state->thisValue(), doubleValue))583 if (!toThisNumber(vm, state->thisValue(), doubleValue)) 584 584 return throwVMTypeError(state, scope); 585 585 … … 596 596 597 597 double x; 598 if (!toThisNumber( exec->thisValue(), x))598 if (!toThisNumber(vm, exec->thisValue(), x)) 599 599 return throwVMTypeError(exec, scope); 600 600 … … 609 609 double x; 610 610 JSValue thisValue = exec->thisValue(); 611 if (!toThisNumber( thisValue, x))611 if (!toThisNumber(vm, thisValue, x)) 612 612 return throwVMTypeError(exec, scope, WTF::makeString("thisNumberValue called on incompatible ", asString(jsTypeStringForValue(exec, thisValue))->value(exec))); 613 613 return JSValue::encode(jsNumber(x)); -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r224784 r229362 716 716 JSObject* object = asObject(obj); 717 717 718 if ( isJSFinalObject(object) && !hasIndexedProperties(object->indexingType())) {718 if (jsDynamicCast<JSFinalObject*>(vm, object) && !hasIndexedProperties(object->indexingType())) { 719 719 object->seal(vm); 720 720 return JSValue::encode(obj); … … 736 736 auto scope = DECLARE_THROW_SCOPE(vm); 737 737 738 if ( isJSFinalObject(object) && !hasIndexedProperties(object->indexingType())) {738 if (jsDynamicCast<JSFinalObject*>(vm, object) && !hasIndexedProperties(object->indexingType())) { 739 739 object->freeze(vm); 740 740 return object; … … 783 783 784 784 // Quick check for final objects. 785 if ( isJSFinalObject(object) && !hasIndexedProperties(object->indexingType()))785 if (jsDynamicCast<JSFinalObject*>(vm, object) && !hasIndexedProperties(object->indexingType())) 786 786 return JSValue::encode(jsBoolean(object->isSealed(vm))); 787 787 … … 801 801 802 802 // Quick check for final objects. 803 if ( isJSFinalObject(object) && !hasIndexedProperties(object->indexingType()))803 if (jsDynamicCast<JSFinalObject*>(vm, object) && !hasIndexedProperties(object->indexingType())) 804 804 return JSValue::encode(jsBoolean(object->isFrozen(vm))); 805 805 -
trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp
r224309 r229362 88 88 auto scope = DECLARE_THROW_SCOPE(vm); 89 89 Base::finishCreation(vm); 90 ASSERT(type() == ProxyObjectType); 90 91 if (!target.isObject()) { 91 92 throwTypeError(exec, scope, ASCIILiteral("A Proxy's 'target' should be an Object")); -
trunk/Source/JavaScriptCore/runtime/ScopedArguments.h
r225314 r229362 37 37 // table's ScopedArgumentsTable and the activation, or its overflow storage, to handle all indexed 38 38 // lookups. 39 class ScopedArguments : public GenericArguments<ScopedArguments> {39 class ScopedArguments final : public GenericArguments<ScopedArguments> { 40 40 private: 41 41 ScopedArguments(VM&, Structure*, unsigned totalLength); -
trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp
r224487 r229362 78 78 } 79 79 80 if (isJSSet(iterable)) { 81 JSSet* iterableSet = jsCast<JSSet*>(iterable); 80 if (auto* iterableSet = jsDynamicCast<JSSet*>(vm, iterable)) { 82 81 if (iterableSet->canCloneFastAndNonObservable(setStructure)) { 83 82 scope.release(); … … 110 109 EncodedJSValue JSC_HOST_CALL setPrivateFuncSetBucketHead(ExecState* exec) 111 110 { 112 ASSERT( isJSSet(exec->argument(0)));111 ASSERT(jsDynamicCast<JSSet*>(exec->vm(), exec->argument(0))); 113 112 JSSet* set = jsCast<JSSet*>(exec->uncheckedArgument(0)); 114 113 auto* head = set->head(); -
trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp
r225072 r229362 87 87 return nullptr; 88 88 } 89 if (LIKELY(thisValue.asCell()->type() == JSSetType)) 90 return jsCast<JSSet*>(thisValue); 89 auto* set = jsDynamicCast<JSSet*>(vm, thisValue.asCell()); 90 if (LIKELY(set)) 91 return set; 91 92 throwTypeError(callFrame, scope, ASCIILiteral("Set operation called on non-Set object")); 92 93 return nullptr; -
trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.h
r222143 r229362 30 30 namespace JSC { 31 31 32 class StrictEvalActivation : public JSScope {32 class StrictEvalActivation final : public JSScope { 33 33 public: 34 typedef JSScope Base; 35 static const unsigned StructureFlags = Base::StructureFlags; 34 using Base = JSScope; 36 35 37 36 static StrictEvalActivation* create(ExecState* exec, JSScope* currentScope) -
trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp
r227723 r229362 63 63 } 64 64 65 if (LIKELY(isJSWeakMap(asObject(value)))) 66 return jsCast<JSWeakMap*>(value); 65 auto* map = jsDynamicCast<JSWeakMap*>(vm, asObject(value)); 66 if (LIKELY(map)) 67 return map; 67 68 68 69 throwTypeError(callFrame, scope, WTF::ASCIILiteral("Called WeakMap function on a non-WeakMap object")); -
trunk/Source/JavaScriptCore/runtime/WeakSetPrototype.cpp
r227723 r229362 61 61 } 62 62 63 if (LIKELY(isJSWeakSet(asObject(value)))) 64 return jsCast<JSWeakSet*>(value); 63 auto* set = jsDynamicCast<JSWeakSet*>(vm, asObject(value)); 64 if (LIKELY(set)) 65 return set; 65 66 66 67 throwTypeError(callFrame, scope, WTF::ASCIILiteral("Called WeakSet function on a non-WeakSet object"));
Note: See TracChangeset
for help on using the changeset viewer.