Changeset 269801 in webkit for trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
- Timestamp:
- Nov 13, 2020, 2:32:01 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r268489 r269801 803 803 RefPtr<RegisterID> propertyExpr; 804 804 805 // The 'name' refers to a synthetic numeric variable name in the private namescope, where the property key is saved for later use.805 // The 'name' refers to a synthetic private name in the class scope, where the property key is saved for later use. 806 806 const Identifier& description = *node.name(); 807 807 Variable var = generator.variable(description); … … 4818 4818 { 4819 4819 RefPtr<RegisterID> value = generator.newTemporary(); 4820 bool shouldSetFunctionName = false; 4820 4821 4821 4822 if (!m_assign) … … 4823 4824 else { 4824 4825 generator.emitNode(value.get(), m_assign); 4825 if (m_ident && generator.shouldSetFunctionName(m_assign)) 4826 shouldSetFunctionName = generator.shouldSetFunctionName(m_assign); 4827 if (m_ident && shouldSetFunctionName && m_type != DefineFieldNode::Type::ComputedName) 4826 4828 generator.emitSetFunctionName(value.get(), *m_ident); 4827 4829 } … … 4851 4853 4852 4854 // For ComputedNames, the expression has already been evaluated earlier during evaluation of a ClassExprNode. 4853 // Here, `m_ident` refers to an integerID in a class lexical scope, containing the value already converted to an Expression.4855 // Here, `m_ident` refers to private symbol ID in a class lexical scope, containing the value already converted to an Expression. 4854 4856 Variable var = generator.variable(*m_ident); 4855 4857 ASSERT_WITH_MESSAGE(!var.local(), "Computed names must be stored in captured variables"); … … 4859 4861 RefPtr<RegisterID> privateName = generator.newTemporary(); 4860 4862 generator.emitGetFromScope(privateName.get(), scope.get(), var, ThrowIfNotFound); 4863 if (shouldSetFunctionName) 4864 generator.emitSetFunctionName(value.get(), privateName.get()); 4861 4865 generator.emitProfileType(privateName.get(), var, m_position, m_position + m_ident->length()); 4862 4866 generator.emitCallDefineProperty(generator.thisRegister(), privateName.get(), value.get(), nullptr, nullptr, BytecodeGenerator::PropertyConfigurable | BytecodeGenerator::PropertyWritable | BytecodeGenerator::PropertyEnumerable, m_position);
Note:
See TracChangeset
for help on using the changeset viewer.