Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Unified Diff: src/runtime/runtime-classes.cc

Issue 1270393002: [strong] Refactor out separate strong runtime call for class objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698