Index: src/runtime/runtime-classes.cc |
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc |
index 76c5c0068da4764a4bae6e81286184187a7ca2bc..6513b84b28461e5aff9358454b9c518697a0e8bc 100644 |
--- a/src/runtime/runtime-classes.cc |
+++ b/src/runtime/runtime-classes.cc |
@@ -262,27 +262,18 @@ RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { |
JSObject::MigrateSlowToFast(prototype, 0, "RuntimeToFastProperties"); |
JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); |
+ if (constructor->map()->is_strong()) { |
+ DCHECK(prototype->map()->is_strong()); |
+ RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::Freeze(prototype)); |
+ Handle<Object> result; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
+ JSObject::Freeze(constructor)); |
+ return *result; |
+ } |
return *constructor; |
} |
-RUNTIME_FUNCTION(Runtime_FinalizeClassDefinitionStrong) { |
- HandleScope scope(isolate); |
- DCHECK(args.length() == 2); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1); |
- |
- JSObject::MigrateSlowToFast(prototype, 0, "RuntimeToFastProperties"); |
- JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); |
- |
- RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::Freeze(prototype)); |
- Handle<Object> result; |
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
- JSObject::Freeze(constructor)); |
- return *result; |
-} |
- |
- |
RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) { |
HandleScope shs(isolate); |
DCHECK(args.length() == 1); |