Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 5565e01f547fc2db137c61a1c82d8594b4cdef41..73ddde2ec77b91d2d652e99b1f4d79b2b1fbee0c 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -1414,6 +1414,7 @@ void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { |
.StoreAccumulatorInRegister(prototype); |
VisitClassLiteralProperties(expr, literal, prototype); |
+ BuildClassLiteralNameProperty(expr, literal); |
builder()->CallRuntime(Runtime::kToFastProperties, literal); |
// Assign to class variable. |
if (expr->class_variable_proxy() != nullptr) { |
@@ -1512,6 +1513,18 @@ void BytecodeGenerator::VisitClassLiteralProperties(ClassLiteral* expr, |
} |
} |
+void BytecodeGenerator::BuildClassLiteralNameProperty(ClassLiteral* expr, |
+ Register literal) { |
+ if (!expr->has_name_static_property() && |
+ !expr->constructor()->raw_name()->IsEmpty()) { |
+ Runtime::FunctionId runtime_id = |
+ expr->has_static_computed_names() |
+ ? Runtime::kInstallClassNameAccessorWithCheck |
+ : Runtime::kInstallClassNameAccessor; |
+ builder()->CallRuntime(runtime_id, literal); |
+ } |
+} |
+ |
void BytecodeGenerator::VisitNativeFunctionLiteral( |
NativeFunctionLiteral* expr) { |
size_t entry = builder()->AllocateConstantPoolEntry(); |