Chromium Code Reviews| Index: src/runtime/runtime-classes.cc |
| diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc |
| index 76c5c0068da4764a4bae6e81286184187a7ca2bc..bfd949a4522be0f7ead20c54af8e727a06416393 100644 |
| --- a/src/runtime/runtime-classes.cc |
| +++ b/src/runtime/runtime-classes.cc |
| @@ -262,27 +262,17 @@ RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { |
| JSObject::MigrateSlowToFast(prototype, 0, "RuntimeToFastProperties"); |
| JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); |
| + if (constructor->map()->is_strong()) { |
| + RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::Freeze(prototype)); |
|
rossberg
2015/08/05 14:25:58
How about adding a DCHECK(prototype->map()->is_str
conradw
2015/08/05 14:30:00
Done.
|
| + 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); |