Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/JSGlobalObject.cpp (241705 => 241706)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-02-18 16:16:14 UTC (rev 241705)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-02-18 16:16:19 UTC (rev 241706)
@@ -328,6 +328,7 @@
Date JSGlobalObject::m_dateStructure DontEnum|ClassStructure
Boolean JSGlobalObject::m_booleanObjectStructure DontEnum|ClassStructure
Number JSGlobalObject::m_numberObjectStructure DontEnum|ClassStructure
+ Symbol JSGlobalObject::m_symbolObjectStructure DontEnum|ClassStructure
WeakMap JSGlobalObject::m_weakMapStructure DontEnum|ClassStructure
WeakSet JSGlobalObject::m_weakSetStructure DontEnum|ClassStructure
@end
@@ -763,7 +764,6 @@
m_asyncGeneratorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, m_asyncGeneratorFunctionPrototype.get(), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
m_asyncGeneratorFunctionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->prototype, m_asyncGeneratorPrototype.get(), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
-
m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
m_functionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, functionConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
m_arrayPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, arrayConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
@@ -906,7 +906,6 @@
GlobalPropertyInfo(vm.propertyNames->builtinNames().instanceOfPrivateName(), privateFuncInstanceOf, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().BuiltinLogPrivateName(), builtinLog, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().BuiltinDescribePrivateName(), builtinDescribe, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
- GlobalPropertyInfo(vm.propertyNames->builtinNames().NumberPrivateName(), numberConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().RegExpPrivateName(), regExpConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().StringPrivateName(), stringConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().absPrivateName(), privateFuncAbs, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
@@ -1024,91 +1023,93 @@
}
#endif // ENABLE(WEBASSEMBLY)
- {
+ auto setupAdaptiveWatchpoint = [&] (JSObject* base, const Identifier& ident) -> ObjectPropertyCondition {
+ // Performing these gets should not throw.
ExecState* exec = globalExec();
+ PropertySlot slot(base, PropertySlot::InternalMethodType::Get);
+ bool result = base->getOwnPropertySlot(base, exec, ident, slot);
+ ASSERT_UNUSED(result, result);
+ catchScope.assertNoException();
+ RELEASE_ASSERT(slot.isCacheableValue());
+ JSValue functionValue = slot.getValue(exec, ident);
+ catchScope.assertNoException();
+ ASSERT(jsDynamicCast<JSFunction*>(vm, functionValue));
- auto setupAdaptiveWatchpoint = [&] (JSObject* base, const Identifier& ident) -> ObjectPropertyCondition {
- // Performing these gets should not throw.
- PropertySlot slot(base, PropertySlot::InternalMethodType::Get);
- bool result = base->getOwnPropertySlot(base, exec, ident, slot);
- ASSERT_UNUSED(result, result);
- catchScope.assertNoException();
- RELEASE_ASSERT(slot.isCacheableValue());
- JSValue functionValue = slot.getValue(exec, ident);
- catchScope.assertNoException();
- ASSERT(jsDynamicCast<JSFunction*>(vm, functionValue));
+ ObjectPropertyCondition condition = generateConditionForSelfEquivalence(m_vm, nullptr, base, ident.impl());
+ RELEASE_ASSERT(condition.requiredValue() == functionValue);
- ObjectPropertyCondition condition = generateConditionForSelfEquivalence(m_vm, nullptr, base, ident.impl());
- RELEASE_ASSERT(condition.requiredValue() == functionValue);
+ bool isWatchable = condition.isWatchable(PropertyCondition::EnsureWatchability);
+ RELEASE_ASSERT(isWatchable); // We allow this to install the necessary watchpoints.
- bool isWatchable = condition.isWatchable(PropertyCondition::EnsureWatchability);
- RELEASE_ASSERT(isWatchable); // We allow this to install the necessary watchpoints.
+ return condition;
+ };
- return condition;
- };
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(arrayIteratorPrototype, m_vm.propertyNames->next);
+ m_arrayIteratorPrototypeNext = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_arrayIteratorProtocolWatchpoint);
+ m_arrayIteratorPrototypeNext->install(vm);
+ }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(this->arrayPrototype(), m_vm.propertyNames->iteratorSymbol);
+ m_arrayPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_arrayIteratorProtocolWatchpoint);
+ m_arrayPrototypeSymbolIteratorWatchpoint->install(vm);
+ }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(arrayIteratorPrototype, m_vm.propertyNames->next);
- m_arrayIteratorPrototypeNext = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_arrayIteratorProtocolWatchpoint);
- m_arrayIteratorPrototypeNext->install(vm);
- }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(this->arrayPrototype(), m_vm.propertyNames->iteratorSymbol);
- m_arrayPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_arrayIteratorProtocolWatchpoint);
- m_arrayPrototypeSymbolIteratorWatchpoint->install(vm);
- }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(mapIteratorPrototype, m_vm.propertyNames->next);
+ m_mapIteratorPrototypeNextWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_mapIteratorProtocolWatchpoint);
+ m_mapIteratorPrototypeNextWatchpoint->install(vm);
+ }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_mapPrototype.get(), m_vm.propertyNames->iteratorSymbol);
+ m_mapPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_mapIteratorProtocolWatchpoint);
+ m_mapPrototypeSymbolIteratorWatchpoint->install(vm);
+ }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(mapIteratorPrototype, m_vm.propertyNames->next);
- m_mapIteratorPrototypeNextWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_mapIteratorProtocolWatchpoint);
- m_mapIteratorPrototypeNextWatchpoint->install(vm);
- }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_mapPrototype.get(), m_vm.propertyNames->iteratorSymbol);
- m_mapPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_mapIteratorProtocolWatchpoint);
- m_mapPrototypeSymbolIteratorWatchpoint->install(vm);
- }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(setIteratorPrototype, m_vm.propertyNames->next);
+ m_setIteratorPrototypeNextWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_setIteratorProtocolWatchpoint);
+ m_setIteratorPrototypeNextWatchpoint->install(vm);
+ }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_setPrototype.get(), m_vm.propertyNames->iteratorSymbol);
+ m_setPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_setIteratorProtocolWatchpoint);
+ m_setPrototypeSymbolIteratorWatchpoint->install(vm);
+ }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(setIteratorPrototype, m_vm.propertyNames->next);
- m_setIteratorPrototypeNextWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_setIteratorProtocolWatchpoint);
- m_setIteratorPrototypeNextWatchpoint->install(vm);
- }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_setPrototype.get(), m_vm.propertyNames->iteratorSymbol);
- m_setPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_setIteratorProtocolWatchpoint);
- m_setPrototypeSymbolIteratorWatchpoint->install(vm);
- }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_stringIteratorPrototype.get(), m_vm.propertyNames->next);
+ m_stringIteratorPrototypeNextWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_stringIteratorProtocolWatchpoint);
+ m_stringIteratorPrototypeNextWatchpoint->install(vm);
+ }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_stringPrototype.get(), m_vm.propertyNames->iteratorSymbol);
+ m_stringPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_stringIteratorProtocolWatchpoint);
+ m_stringPrototypeSymbolIteratorWatchpoint->install(vm);
+ }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_stringIteratorPrototype.get(), m_vm.propertyNames->next);
- m_stringIteratorPrototypeNextWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_stringIteratorProtocolWatchpoint);
- m_stringIteratorPrototypeNextWatchpoint->install(vm);
- }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_stringPrototype.get(), m_vm.propertyNames->iteratorSymbol);
- m_stringPrototypeSymbolIteratorWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_stringIteratorProtocolWatchpoint);
- m_stringPrototypeSymbolIteratorWatchpoint->install(vm);
- }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_mapPrototype.get(), m_vm.propertyNames->set);
+ m_mapPrototypeSetWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_mapSetWatchpoint);
+ m_mapPrototypeSetWatchpoint->install(vm);
+ }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_mapPrototype.get(), m_vm.propertyNames->set);
- m_mapPrototypeSetWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_mapSetWatchpoint);
- m_mapPrototypeSetWatchpoint->install(vm);
- }
+ {
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_setPrototype.get(), m_vm.propertyNames->add);
+ m_setPrototypeAddWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_setAddWatchpoint);
+ m_setPrototypeAddWatchpoint->install(vm);
+ }
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_setPrototype.get(), m_vm.propertyNames->add);
- m_setPrototypeAddWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_setAddWatchpoint);
- m_setPrototypeAddWatchpoint->install(vm);
- }
+ // Unfortunately, the prototype objects of the builtin objects can be touched from concurrent compilers. So eagerly initialize them only if we use JIT.
+ if (VM::canUseJIT()) {
+ this->booleanPrototype();
+ auto* numberPrototype = this->numberPrototype();
+ this->symbolPrototype();
- {
- ObjectPropertyCondition condition = setupAdaptiveWatchpoint(numberPrototype(), m_vm.propertyNames->toString);
- m_numberPrototypeToStringWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_numberToStringWatchpoint);
- m_numberPrototypeToStringWatchpoint->install(vm);
- m_numberProtoToStringFunction.set(vm, this, jsCast<JSFunction*>(numberPrototype()->getDirect(vm, vm.propertyNames->toString)));
- }
+ ObjectPropertyCondition condition = setupAdaptiveWatchpoint(numberPrototype, m_vm.propertyNames->toString);
+ m_numberPrototypeToStringWatchpoint = std::make_unique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(condition, m_numberToStringWatchpoint);
+ m_numberPrototypeToStringWatchpoint->install(vm);
+ m_numberProtoToStringFunction.set(vm, this, jsCast<JSFunction*>(numberPrototype->getDirect(vm, vm.propertyNames->toString)));
}
resetPrototype(vm, getPrototypeDirect(vm));
@@ -1651,7 +1652,6 @@
visitor.append(thisObject->m_getterSetterStructure);
thisObject->m_nativeStdFunctionStructure.visit(visitor);
visitor.append(thisObject->m_bigIntObjectStructure);
- visitor.append(thisObject->m_symbolObjectStructure);
visitor.append(thisObject->m_regExpStructure);
visitor.append(thisObject->m_generatorFunctionStructure);
visitor.append(thisObject->m_asyncFunctionStructure);
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/JSGlobalObject.h (241705 => 241706)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/JSGlobalObject.h 2019-02-18 16:16:14 UTC (rev 241705)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/JSGlobalObject.h 2019-02-18 16:16:19 UTC (rev 241706)
@@ -129,9 +129,6 @@
#define FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \
macro(String, string, stringObject, StringObject, String, object) \
- macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object) \
- macro(Number, number, numberObject, NumberObject, Number, object) \
- macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object) \
macro(Error, error, error, ErrorInstance, Error, object) \
macro(Map, map, map, JSMap, Map, object) \
macro(Set, set, set, JSSet, Set, object) \
@@ -148,7 +145,10 @@
macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise, object) \
#define FOR_EACH_LAZY_BUILTIN_TYPE(macro) \
+ macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object) \
macro(Date, date, date, DateInstance, Date, object) \
+ macro(Number, number, numberObject, NumberObject, Number, object) \
+ macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object) \
DEFINE_STANDARD_BUILTIN(macro, WeakMap, weakMap) \
DEFINE_STANDARD_BUILTIN(macro, WeakSet, weakSet) \
@@ -456,7 +456,11 @@
InlineWatchpointSet& mapSetWatchpoint() { return m_mapSetWatchpoint; }
InlineWatchpointSet& setAddWatchpoint() { return m_setAddWatchpoint; }
InlineWatchpointSet& arraySpeciesWatchpoint() { return m_arraySpeciesWatchpoint; }
- InlineWatchpointSet& numberToStringWatchpoint() { return m_numberToStringWatchpoint; }
+ InlineWatchpointSet& numberToStringWatchpoint()
+ {
+ RELEASE_ASSERT(VM::canUseJIT());
+ return m_numberToStringWatchpoint;
+ }
// If this hasn't been invalidated, it means the array iterator protocol
// is not observable to user code yet.
InlineWatchpointSet m_arrayIteratorProtocolWatchpoint;
@@ -618,12 +622,12 @@
ObjectPrototype* objectPrototype() const { return m_objectPrototype.get(); }
FunctionPrototype* functionPrototype() const { return m_functionPrototype.get(); }
ArrayPrototype* arrayPrototype() const { return m_arrayPrototype.get(); }
- BooleanPrototype* booleanPrototype() const { return m_booleanPrototype.get(); }
+ JSObject* booleanPrototype() const { return m_booleanObjectStructure.prototype(this); }
StringPrototype* stringPrototype() const { return m_stringPrototype.get(); }
- SymbolPrototype* symbolPrototype() const { return m_symbolPrototype.get(); }
- NumberPrototype* numberPrototype() const { return m_numberPrototype.get(); }
+ JSObject* numberPrototype() const { return m_numberObjectStructure.prototype(this); }
BigIntPrototype* bigIntPrototype() const { return m_bigIntPrototype.get(); }
JSObject* datePrototype() const { return m_dateStructure.prototype(this); }
+ JSObject* symbolPrototype() const { return m_symbolObjectStructure.prototype(this); }
RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); }
ErrorPrototype* errorPrototype() const { return m_errorPrototype.get(); }
IteratorPrototype* iteratorPrototype() const { return m_iteratorPrototype.get(); }
@@ -671,7 +675,7 @@
return originalArrayStructureForIndexingType(structure->indexingMode() | IsArray) == structure;
}
- Structure* booleanObjectStructure() const { return m_booleanObjectStructure.get(); }
+ Structure* booleanObjectStructure() const { return m_booleanObjectStructure.get(this); }
Structure* callbackConstructorStructure() const { return m_callbackConstructorStructure.get(this); }
Structure* callbackFunctionStructure() const { return m_callbackFunctionStructure.get(this); }
Structure* callbackObjectStructure() const { return m_callbackObjectStructure.get(this); }
@@ -684,6 +688,7 @@
Structure* glibWrapperObjectStructure() const { return m_glibWrapperObjectStructure.get(this); }
#endif
Structure* dateStructure() const { return m_dateStructure.get(this); }
+ Structure* symbolObjectStructure() const { return m_symbolObjectStructure.get(this); }
Structure* nullPrototypeObjectStructure() const { return m_nullPrototypeObjectStructure.get(); }
Structure* errorStructure() const { return m_errorStructure.get(); }
Structure* errorStructure(ErrorType errorType) const
@@ -734,7 +739,7 @@
Structure* getterSetterStructure() const { return m_getterSetterStructure.get(); }
Structure* nativeStdFunctionStructure() const { return m_nativeStdFunctionStructure.get(this); }
PropertyOffset functionNameOffset() const { return m_functionNameOffset; }
- Structure* numberObjectStructure() const { return m_numberObjectStructure.get(); }
+ Structure* numberObjectStructure() const { return m_numberObjectStructure.get(this); }
Structure* mapStructure() const { return m_mapStructure.get(); }
Structure* regExpStructure() const { return m_regExpStructure.get(); }
Structure* generatorFunctionStructure() const { return m_generatorFunctionStructure.get(); }
@@ -741,7 +746,6 @@
Structure* asyncFunctionStructure() const { return m_asyncFunctionStructure.get(); }
Structure* asyncGeneratorFunctionStructure() const { return m_asyncGeneratorFunctionStructure.get(); }
Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); }
- Structure* symbolObjectStructure() const { return m_symbolObjectStructure.get(); }
Structure* bigIntObjectStructure() const { return m_bigIntObjectStructure.get(); }
Structure* iteratorResultObjectStructure() const { return m_iteratorResultObjectStructure.get(); }
Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }