Changeset 278253 in webkit for trunk/Source/JavaScriptCore/bytecompiler
- Timestamp:
- May 30, 2021, 9:11:40 AM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore/bytecompiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r278185 r278253 3012 3012 } 3013 3013 3014 Optional<PrivateNameEnvironment> BytecodeGenerator::getAvailablePrivateAccessNames()3014 std::optional<PrivateNameEnvironment> BytecodeGenerator::getAvailablePrivateAccessNames() 3015 3015 { 3016 3016 PrivateNameEnvironment result; … … 3267 3267 3268 3268 auto variablesUnderTDZ = getVariablesUnderTDZ(); 3269 Optional<PrivateNameEnvironment> parentPrivateNameEnvironment = getAvailablePrivateAccessNames();3269 std::optional<PrivateNameEnvironment> parentPrivateNameEnvironment = getAvailablePrivateAccessNames(); 3270 3270 SourceParseMode parseMode = SourceParseMode::ClassFieldInitializerMode; 3271 3271 ConstructAbility constructAbility = ConstructAbility::CannotConstruct; … … 4699 4699 } 4700 4700 4701 void BytecodeGenerator::pushStructureForInScope(RegisterID* localRegister, RegisterID* indexRegister, RegisterID* propertyRegister, RegisterID* enumeratorRegister, Optional<Variable> baseVariable)4701 void BytecodeGenerator::pushStructureForInScope(RegisterID* localRegister, RegisterID* indexRegister, RegisterID* propertyRegister, RegisterID* enumeratorRegister, std::optional<Variable> baseVariable) 4702 4702 { 4703 4703 if (!localRegister) -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r277926 r278253 311 311 using HasOwnPropertyJumpInst = std::tuple<unsigned, unsigned>; 312 312 313 StructureForInContext(RegisterID* localRegister, RegisterID* indexRegister, RegisterID* propertyRegister, RegisterID* enumeratorRegister, Optional<Variable> baseVariable, unsigned bodyBytecodeStartOffset)313 StructureForInContext(RegisterID* localRegister, RegisterID* indexRegister, RegisterID* propertyRegister, RegisterID* enumeratorRegister, std::optional<Variable> baseVariable, unsigned bodyBytecodeStartOffset) 314 314 : ForInContext(localRegister, Type::StructureForIn, bodyBytecodeStartOffset) 315 315 , m_indexRegister(indexRegister) … … 323 323 RegisterID* property() const { return m_propertyRegister.get(); } 324 324 RegisterID* enumerator() const { return m_enumeratorRegister.get(); } 325 const Optional<Variable>& baseVariable() const { return m_baseVariable; }325 const std::optional<Variable>& baseVariable() const { return m_baseVariable; } 326 326 327 327 void addGetInst(unsigned instIndex, int propertyRegIndex) … … 346 346 RefPtr<RegisterID> m_propertyRegister; 347 347 RefPtr<RegisterID> m_enumeratorRegister; 348 Optional<Variable> m_baseVariable;348 std::optional<Variable> m_baseVariable; 349 349 Vector<GetInst> m_getInsts; 350 350 Vector<InInst> m_inInsts; … … 598 598 { 599 599 if (node->isString()) { 600 if ( Optional<uint32_t> index = parseIndex(static_cast<StringNode*>(node)->value()))600 if (std::optional<uint32_t> index = parseIndex(static_cast<StringNode*>(node)->value())) 601 601 return emitLoad(dst, jsNumber(index.value())); 602 602 } … … 1057 1057 void pushIndexedForInScope(RegisterID* local, RegisterID* index); 1058 1058 void popIndexedForInScope(RegisterID* local); 1059 void pushStructureForInScope(RegisterID* local, RegisterID* index, RegisterID* property, RegisterID* enumerator, Optional<Variable> base);1059 void pushStructureForInScope(RegisterID* local, RegisterID* index, RegisterID* property, RegisterID* enumerator, std::optional<Variable> base); 1060 1060 void popStructureForInScope(RegisterID* local); 1061 1061 … … 1210 1210 1211 1211 auto optionalVariablesUnderTDZ = getVariablesUnderTDZ(); 1212 Optional<PrivateNameEnvironment> parentPrivateNameEnvironment = getAvailablePrivateAccessNames();1212 std::optional<PrivateNameEnvironment> parentPrivateNameEnvironment = getAvailablePrivateAccessNames(); 1213 1213 1214 1214 // FIXME: These flags, ParserModes and propagation to XXXCodeBlocks should be reorganized. … … 1223 1223 1224 1224 RefPtr<TDZEnvironmentLink> getVariablesUnderTDZ(); 1225 Optional<PrivateNameEnvironment> getAvailablePrivateAccessNames();1225 std::optional<PrivateNameEnvironment> getAvailablePrivateAccessNames(); 1226 1226 1227 1227 RegisterID* emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd, DebuggableCall); … … 1298 1298 Vector<TDZStackEntry> m_TDZStack; 1299 1299 Vector<PrivateNameEnvironment> m_privateNamesStack; 1300 Optional<size_t> m_varScopeLexicalScopeStackIndex;1300 std::optional<size_t> m_varScopeLexicalScopeStackIndex; 1301 1301 void pushTDZVariables(const VariableEnvironment&, TDZCheckOptimization, TDZRequirement); 1302 1302 -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r278244 r278253 860 860 if (const auto* identifier = node.name()) { 861 861 ASSERT(!propertyName); 862 Optional<uint32_t> optionalIndex = parseIndex(*identifier);862 std::optional<uint32_t> optionalIndex = parseIndex(*identifier); 863 863 if (!optionalIndex) { 864 864 generator.emitDirectPutById(newObj, *identifier, value.get()); … … 3019 3019 3020 3020 if (opcodeID == op_less || opcodeID == op_lesseq || opcodeID == op_greater || opcodeID == op_greatereq) { 3021 auto isUInt32 = [&] (ExpressionNode* node) -> Optional<UInt32Result> {3021 auto isUInt32 = [&] (ExpressionNode* node) -> std::optional<UInt32Result> { 3022 3022 if (node->isBinaryOpNode() && static_cast<BinaryOpNode*>(node)->opcodeID() == op_urshift) 3023 3023 return UInt32Result::UInt32; … … 4195 4195 RefPtr<RegisterID> enumeratorIndex; 4196 4196 4197 Optional<Variable> baseVariable;4197 std::optional<Variable> baseVariable; 4198 4198 if (m_expr->isResolveNode()) 4199 4199 baseVariable = generator.variable(static_cast<ResolveNode*>(m_expr)->identifier()); … … 4739 4739 RefPtr<Label> finallyLabel; 4740 4740 RefPtr<Label> finallyEndLabel; 4741 Optional<FinallyContext> finallyContext;4741 std::optional<FinallyContext> finallyContext; 4742 4742 4743 4743 if (m_finallyBlock) { … … 5543 5543 RefPtr<RegisterID> newObject; 5544 5544 IdentifierSet excludedSet; 5545 Optional<CallArguments> args;5545 std::optional<CallArguments> args; 5546 5546 unsigned numberOfComputedProperties = 0; 5547 5547 unsigned indexInArguments = 2; … … 5596 5596 5597 5597 if (!target.propertyExpression) { 5598 Optional<uint32_t> optionalIndex = parseIndex(target.propertyName);5598 std::optional<uint32_t> optionalIndex = parseIndex(target.propertyName); 5599 5599 if (!optionalIndex) 5600 5600 generator.emitGetById(temp.get(), rhs, target.propertyName);
Note:
See TracChangeset
for help on using the changeset viewer.