Changeset 292118 in webkit for trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp
- Timestamp:
- Mar 30, 2022, 1:41:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp
r291779 r292118 528 528 VM& vm = globalObject->vm(); 529 529 CustomGetter* thisObject = jsCast<CustomGetter*>(object); 530 if (propertyName == PropertyName(Identifier::fromString(vm, "customGetter" ))) {530 if (propertyName == PropertyName(Identifier::fromString(vm, "customGetter"_s))) { 531 531 slot.setCacheableCustom(thisObject, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, customGetterValueGetter); 532 532 return true; 533 533 } 534 534 535 if (propertyName == PropertyName(Identifier::fromString(vm, "customGetterAccessor" ))) {535 if (propertyName == PropertyName(Identifier::fromString(vm, "customGetterAccessor"_s))) { 536 536 slot.setCacheableCustom(thisObject, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::CustomAccessor, customGetterAcessorGetter); 537 537 return true; … … 551 551 if (!thisObject) 552 552 return throwVMTypeError(globalObject, scope); 553 bool shouldThrow = thisObject->get(globalObject, PropertyName(Identifier::fromString(vm, "shouldThrow" ))).toBoolean(globalObject);553 bool shouldThrow = thisObject->get(globalObject, PropertyName(Identifier::fromString(vm, "shouldThrow"_s))).toBoolean(globalObject); 554 554 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 555 555 if (shouldThrow) … … 567 567 if (!thisObject) 568 568 return throwVMTypeError(globalObject, scope); 569 bool shouldThrow = thisObject->get(globalObject, PropertyName(Identifier::fromString(vm, "shouldThrow" ))).toBoolean(globalObject);569 bool shouldThrow = thisObject->get(globalObject, PropertyName(Identifier::fromString(vm, "shouldThrow"_s))).toBoolean(globalObject); 570 570 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 571 571 if (shouldThrow) … … 714 714 return throwVMTypeError(globalObject, scope); 715 715 716 if (JSValue result = thisObject->getDirect(vm, PropertyName(Identifier::fromString(vm, "testField" ))))716 if (JSValue result = thisObject->getDirect(vm, PropertyName(Identifier::fromString(vm, "testField"_s)))) 717 717 return JSValue::encode(result); 718 718 return JSValue::encode(jsUndefined()); … … 730 730 RELEASE_ASSERT(thisObject); 731 731 732 return thisObject->putDirect(vm, PropertyName(Identifier::fromString(vm, "testField" )), JSValue::decode(value));732 return thisObject->putDirect(vm, PropertyName(Identifier::fromString(vm, "testField"_s)), JSValue::decode(value)); 733 733 } 734 734 … … 817 817 return throwVMTypeError(globalObject, scope); 818 818 819 return thisObject->putDirect(vm, PropertyName(Identifier::fromString(vm, "testStaticValue" )), JSValue::decode(value));819 return thisObject->putDirect(vm, PropertyName(Identifier::fromString(vm, "testStaticValue"_s)), JSValue::decode(value)); 820 820 } 821 821 … … 830 830 return throwVMTypeError(globalObject, scope); 831 831 832 return thisObject->putDirect(vm, PropertyName(Identifier::fromString(vm, "testStaticValueSetterCalled" )), jsBoolean(true));832 return thisObject->putDirect(vm, PropertyName(Identifier::fromString(vm, "testStaticValueSetterCalled"_s)), jsBoolean(true)); 833 833 } 834 834 … … 1066 1066 const DOMJIT::GetterSetter* domJIT = &DOMJITGetterDOMJIT; 1067 1067 auto* customGetterSetter = DOMAttributeGetterSetter::create(vm, domJIT->getter(), nullptr, DOMAttributeAnnotation { DOMJITNode::info(), domJIT }); 1068 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter" ), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor);1068 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter"_s), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor); 1069 1069 } 1070 1070 { 1071 1071 auto* customGetterSetter = DOMAttributeGetterSetter::create(vm, domJITGetterCustomGetter, nullptr, DOMAttributeAnnotation { DOMJITNode::info(), nullptr }); 1072 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter2" ), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor);1072 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter2"_s), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor); 1073 1073 } 1074 1074 } … … 1316 1316 const DOMJIT::GetterSetter* domJIT = &DOMJITGetterComplexDOMJIT; 1317 1317 auto* customGetterSetter = DOMAttributeGetterSetter::create(vm, domJIT->getter(), nullptr, DOMAttributeAnnotation { DOMJITGetterComplex::info(), domJIT }); 1318 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter" ), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor);1319 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "enableException" ), 0, functionDOMJITGetterComplexEnableException, NoIntrinsic, 0);1318 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter"_s), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor); 1319 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "enableException"_s), 0, functionDOMJITGetterComplexEnableException, NoIntrinsic, 0); 1320 1320 } 1321 1321 … … 1398 1398 DollarVMAssertScope assertScope; 1399 1399 Base::finishCreation(vm); 1400 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "func" ), 0, functionDOMJITFunctionObjectWithTypeCheck, NoIntrinsic, &DOMJITFunctionObjectSignature, static_cast<unsigned>(PropertyAttribute::ReadOnly));1400 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "func"_s), 0, functionDOMJITFunctionObjectWithTypeCheck, NoIntrinsic, &DOMJITFunctionObjectSignature, static_cast<unsigned>(PropertyAttribute::ReadOnly)); 1401 1401 } 1402 1402 … … 1460 1460 DollarVMAssertScope assertScope; 1461 1461 Base::finishCreation(vm); 1462 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "func" ), 0, functionDOMJITCheckJSCastObjectWithTypeCheck, NoIntrinsic, &DOMJITCheckJSCastObjectSignature, static_cast<unsigned>(PropertyAttribute::ReadOnly));1462 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "func"_s), 0, functionDOMJITCheckJSCastObjectWithTypeCheck, NoIntrinsic, &DOMJITCheckJSCastObjectSignature, static_cast<unsigned>(PropertyAttribute::ReadOnly)); 1463 1463 } 1464 1464 … … 1538 1538 const DOMJIT::GetterSetter* domJIT = &DOMJITGetterBaseJSObjectDOMJIT; 1539 1539 auto* customGetterSetter = DOMAttributeGetterSetter::create(vm, domJIT->getter(), nullptr, DOMAttributeAnnotation { JSObject::info(), domJIT }); 1540 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter" ), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor);1540 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customGetter"_s), customGetterSetter, PropertyAttribute::ReadOnly | PropertyAttribute::CustomAccessor); 1541 1541 } 1542 1542 … … 1645 1645 1646 1646 auto* target = jsCast<JSTestCustomGetterSetter*>(JSValue::decode(slotValue)); 1647 JSValue value = target->getDirect(vm, Identifier::fromString(vm, "value2" ));1647 JSValue value = target->getDirect(vm, Identifier::fromString(vm, "value2"_s)); 1648 1648 return JSValue::encode(value ? value : jsUndefined()); 1649 1649 } … … 1670 1670 JSObject* object = asObject(value); 1671 1671 PutPropertySlot slot(object); 1672 object->put(object, globalObject, Identifier::fromString(vm, "result" ), JSValue::decode(thisObject), slot);1672 object->put(object, globalObject, Identifier::fromString(vm, "result"_s), JSValue::decode(thisObject), slot); 1673 1673 1674 1674 return true; … … 1686 1686 JSObject* object = asObject(value); 1687 1687 PutPropertySlot slot(object); 1688 object->put(object, globalObject, Identifier::fromString(vm, "result" ), globalObject, slot);1688 object->put(object, globalObject, Identifier::fromString(vm, "result"_s), globalObject, slot); 1689 1689 1690 1690 return true; … … 1704 1704 JSObject* object = asObject(value); 1705 1705 PutPropertySlot slot(object); 1706 object->put(object, globalObject, Identifier::fromString(vm, "result" ), JSValue::decode(slotValue), slot);1706 object->put(object, globalObject, Identifier::fromString(vm, "result"_s), JSValue::decode(slotValue), slot); 1707 1707 1708 1708 return true; … … 1722 1722 JSObject* object = asObject(value); 1723 1723 PutPropertySlot slot(object); 1724 object->put(object, globalObject, Identifier::fromString(vm, "result" ), globalObject, slot);1724 object->put(object, globalObject, Identifier::fromString(vm, "result"_s), globalObject, slot); 1725 1725 1726 1726 return true; … … 1735 1735 auto* target = jsCast<JSTestCustomGetterSetter*>(JSValue::decode(slotValue)); 1736 1736 PutPropertySlot slot(target); 1737 target->putDirect(vm, Identifier::fromString(vm, "value2" ), JSValue::decode(encodedValue));1737 target->putDirect(vm, Identifier::fromString(vm, "value2"_s), JSValue::decode(encodedValue)); 1738 1738 return true; 1739 1739 } … … 1761 1761 Base::finishCreation(vm); 1762 1762 1763 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValue" ),1763 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValue"_s), 1764 1764 CustomGetterSetter::create(vm, customGetValue, customSetValue), 0); 1765 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValue2" ),1765 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValue2"_s), 1766 1766 CustomGetterSetter::create(vm, customGetValue2, customSetValue2), static_cast<unsigned>(PropertyAttribute::CustomValue)); 1767 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customAccessor" ),1767 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customAccessor"_s), 1768 1768 CustomGetterSetter::create(vm, customGetAccessor, customSetAccessor), static_cast<unsigned>(PropertyAttribute::CustomAccessor)); 1769 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValueGlobalObject" ),1769 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValueGlobalObject"_s), 1770 1770 CustomGetterSetter::create(vm, customGetValueGlobalObject, customSetValueGlobalObject), static_cast<unsigned>(PropertyAttribute::CustomValue)); 1771 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customAccessorGlobalObject" ),1771 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customAccessorGlobalObject"_s), 1772 1772 CustomGetterSetter::create(vm, customGetAccessorGlobalObject, customSetAccessorGlobalObject), static_cast<unsigned>(PropertyAttribute::CustomAccessor)); 1773 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValueNoSetter" ),1773 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customValueNoSetter"_s), 1774 1774 CustomGetterSetter::create(vm, customGetValue, nullptr), static_cast<unsigned>(PropertyAttribute::CustomValue)); 1775 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customAccessorReadOnly" ),1775 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customAccessorReadOnly"_s), 1776 1776 CustomGetterSetter::create(vm, customGetAccessor, nullptr), PropertyAttribute::CustomAccessor | PropertyAttribute::ReadOnly); 1777 1777 1778 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customFunction" ),1778 putDirectCustomAccessor(vm, Identifier::fromString(vm, "customFunction"_s), 1779 1779 CustomGetterSetter::create(vm, customGetAccessor, customFunctionSetter), static_cast<unsigned>(PropertyAttribute::CustomAccessor)); 1780 1780 … … 1885 1885 1886 1886 JSGlobalObject* globalObject = this->globalObject(vm); 1887 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "addBytes" ), 0, functionWasmStreamingParserAddBytes, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));1888 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "finalize" ), 0, functionWasmStreamingParserFinalize, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));1887 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "addBytes"_s), 0, functionWasmStreamingParserAddBytes, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum)); 1888 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "finalize"_s), 0, functionWasmStreamingParserFinalize, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum)); 1889 1889 } 1890 1890 … … 1974 1974 1975 1975 JSGlobalObject* globalObject = this->globalObject(vm); 1976 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "addBytes" ), 0, functionWasmStreamingCompilerAddBytes, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));1976 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "addBytes"_s), 0, functionWasmStreamingCompilerAddBytes, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum)); 1977 1977 } 1978 1978 … … 3152 3152 3153 3153 SourceCode source = makeSource(functionText, { }); 3154 JSFunction* func = JSFunction::create(vm, createBuiltinExecutable(vm, source, Identifier::fromString(vm, "foo" ), ConstructorKind::None, ConstructAbility::CannotConstruct)->link(vm, nullptr, source), globalObject);3154 JSFunction* func = JSFunction::create(vm, createBuiltinExecutable(vm, source, Identifier::fromString(vm, "foo"_s), ConstructorKind::None, ConstructAbility::CannotConstruct)->link(vm, nullptr, source), globalObject); 3155 3155 3156 3156 return JSValue::encode(func); … … 3872 3872 addFunction(vm, "breakpoint", functionBreakpoint, 0); 3873 3873 3874 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "dfgTrue" ), 0, functionDFGTrue, DFGTrueIntrinsic, jsDollarVMPropertyAttributes);3875 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "ftlTrue" ), 0, functionFTLTrue, FTLTrueIntrinsic, jsDollarVMPropertyAttributes);3876 3877 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuMfence" ), 0, functionCpuMfence, CPUMfenceIntrinsic, jsDollarVMPropertyAttributes);3878 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuRdtsc" ), 0, functionCpuRdtsc, CPURdtscIntrinsic, jsDollarVMPropertyAttributes);3879 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuCpuid" ), 0, functionCpuCpuid, CPUCpuidIntrinsic, jsDollarVMPropertyAttributes);3880 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuPause" ), 0, functionCpuPause, CPUPauseIntrinsic, jsDollarVMPropertyAttributes);3874 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "dfgTrue"_s), 0, functionDFGTrue, DFGTrueIntrinsic, jsDollarVMPropertyAttributes); 3875 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "ftlTrue"_s), 0, functionFTLTrue, FTLTrueIntrinsic, jsDollarVMPropertyAttributes); 3876 3877 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuMfence"_s), 0, functionCpuMfence, CPUMfenceIntrinsic, jsDollarVMPropertyAttributes); 3878 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuRdtsc"_s), 0, functionCpuRdtsc, CPURdtscIntrinsic, jsDollarVMPropertyAttributes); 3879 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuCpuid"_s), 0, functionCpuCpuid, CPUCpuidIntrinsic, jsDollarVMPropertyAttributes); 3880 putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "cpuPause"_s), 0, functionCpuPause, CPUPauseIntrinsic, jsDollarVMPropertyAttributes); 3881 3881 addFunction(vm, "cpuClflush", functionCpuClflush, 2); 3882 3882
Note:
See TracChangeset
for help on using the changeset viewer.