Commit 3cc12b4a authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[runtime] Deprecate Runtime_FinalizeClassDefinition entry.

By now the runtime entry function in question is a duplicate of the
existing Runtime_ToFastProperties function. This just gets rid of the
duplication.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/1963973003
Cr-Commit-Position: refs/heads/master@{#36161}
parent ea0dcad0
...@@ -1667,12 +1667,11 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) { ...@@ -1667,12 +1667,11 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
} }
} }
// Set both the prototype and constructor to have fast properties. // Set the constructor to have fast properties.
prototype = environment()->Pop(); prototype = environment()->Pop();
literal = environment()->Pop(); literal = environment()->Pop();
const Operator* op = const Operator* op = javascript()->CallRuntime(Runtime::kToFastProperties);
javascript()->CallRuntime(Runtime::kFinalizeClassDefinition); literal = NewNode(op, literal);
literal = NewNode(op, literal, prototype);
// Assign to class variable. // Assign to class variable.
if (expr->class_variable_proxy() != nullptr) { if (expr->class_variable_proxy() != nullptr) {
......
...@@ -142,7 +142,6 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { ...@@ -142,7 +142,6 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kDefineDataPropertyInLiteral: case Runtime::kDefineDataPropertyInLiteral:
case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe?
case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe?
case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe?
case Runtime::kForInDone: case Runtime::kForInDone:
case Runtime::kForInStep: case Runtime::kForInStep:
case Runtime::kGeneratorSetContext: case Runtime::kGeneratorSetContext:
...@@ -165,6 +164,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { ...@@ -165,6 +164,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kStringLessThanOrEqual: case Runtime::kStringLessThanOrEqual:
case Runtime::kStringGreaterThan: case Runtime::kStringGreaterThan:
case Runtime::kStringGreaterThanOrEqual: case Runtime::kStringGreaterThanOrEqual:
case Runtime::kToFastProperties: // TODO(conradw): Is it safe?
case Runtime::kTraceEnter: case Runtime::kTraceEnter:
case Runtime::kTraceExit: case Runtime::kTraceExit:
return 0; return 0;
......
...@@ -1529,9 +1529,10 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) { ...@@ -1529,9 +1529,10 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
PushOperand(result_register()); PushOperand(result_register());
EmitClassDefineProperties(lit); EmitClassDefineProperties(lit);
DropOperands(1);
// Set both the prototype and constructor to have fast properties. // Set the constructor to have fast properties.
CallRuntimeWithOperands(Runtime::kFinalizeClassDefinition); CallRuntimeWithOperands(Runtime::kToFastProperties);
if (lit->class_variable_proxy() != nullptr) { if (lit->class_variable_proxy() != nullptr) {
EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT,
......
...@@ -1393,7 +1393,7 @@ void BytecodeGenerator::VisitClassLiteralContents(ClassLiteral* expr) { ...@@ -1393,7 +1393,7 @@ void BytecodeGenerator::VisitClassLiteralContents(ClassLiteral* expr) {
.StoreAccumulatorInRegister(prototype); .StoreAccumulatorInRegister(prototype);
VisitClassLiteralProperties(expr, literal, prototype); VisitClassLiteralProperties(expr, literal, prototype);
builder()->CallRuntime(Runtime::kFinalizeClassDefinition, literal, 2); builder()->CallRuntime(Runtime::kToFastProperties, literal, 1);
// Assign to class variable. // Assign to class variable.
if (expr->class_variable_proxy() != nullptr) { if (expr->class_variable_proxy() != nullptr) {
Variable* var = expr->class_variable_proxy()->var(); Variable* var = expr->class_variable_proxy()->var();
......
...@@ -194,14 +194,6 @@ RUNTIME_FUNCTION(Runtime_DefineClass) { ...@@ -194,14 +194,6 @@ RUNTIME_FUNCTION(Runtime_DefineClass) {
} }
RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0);
JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties");
return *constructor;
}
static MaybeHandle<Object> LoadFromSuper(Isolate* isolate, static MaybeHandle<Object> LoadFromSuper(Isolate* isolate,
Handle<Object> receiver, Handle<Object> receiver,
Handle<JSObject> home_object, Handle<JSObject> home_object,
......
...@@ -82,7 +82,6 @@ namespace internal { ...@@ -82,7 +82,6 @@ namespace internal {
F(ThrowIfStaticPrototype, 1, 1) \ F(ThrowIfStaticPrototype, 1, 1) \
F(HomeObjectSymbol, 0, 1) \ F(HomeObjectSymbol, 0, 1) \
F(DefineClass, 4, 1) \ F(DefineClass, 4, 1) \
F(FinalizeClassDefinition, 2, 1) \
F(LoadFromSuper, 3, 1) \ F(LoadFromSuper, 3, 1) \
F(LoadKeyedFromSuper, 3, 1) \ F(LoadKeyedFromSuper, 3, 1) \
F(StoreToSuper_Strict, 4, 1) \ F(StoreToSuper_Strict, 4, 1) \
......
...@@ -45,7 +45,7 @@ bytecodes: [ ...@@ -45,7 +45,7 @@ bytecodes: [
B(LdaZero), B(LdaZero),
B(Star), R(8), B(Star), R(8),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5), B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5),
B(CallRuntime), U16(Runtime::kFinalizeClassDefinition), R(2), U8(2), B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0), B(Star), R(0),
B(Star), R(1), B(Star), R(1),
B(LdaUndefined), B(LdaUndefined),
...@@ -98,7 +98,7 @@ bytecodes: [ ...@@ -98,7 +98,7 @@ bytecodes: [
B(LdaZero), B(LdaZero),
B(Star), R(8), B(Star), R(8),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5), B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5),
B(CallRuntime), U16(Runtime::kFinalizeClassDefinition), R(2), U8(2), B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0), B(Star), R(0),
B(Star), R(1), B(Star), R(1),
B(LdaUndefined), B(LdaUndefined),
...@@ -173,7 +173,7 @@ bytecodes: [ ...@@ -173,7 +173,7 @@ bytecodes: [
B(LdaSmi), U8(1), B(LdaSmi), U8(1),
B(Star), R(9), B(Star), R(9),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5), B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5),
B(CallRuntime), U16(Runtime::kFinalizeClassDefinition), R(3), U8(2), B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0), B(Star), R(0),
B(Star), R(1), B(Star), R(1),
B(LdaUndefined), B(LdaUndefined),
...@@ -221,7 +221,7 @@ bytecodes: [ ...@@ -221,7 +221,7 @@ bytecodes: [
B(Star), R(3), B(Star), R(3),
B(LoadIC), R(3), U8(1), U8(1), B(LoadIC), R(3), U8(1), U8(1),
B(Star), R(4), B(Star), R(4),
B(CallRuntime), U16(Runtime::kFinalizeClassDefinition), R(3), U8(2), B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0), B(Star), R(0),
B(Star), R(1), B(Star), R(1),
B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment