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

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

Issue 1266573003: Move final parts of class literal setup into a single runtime call (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 92df7fe0645d1e4e43017fe68c2ea8e109c0a4a1..317d34b8f5b0b4828a49b0034eb226255e1c68ad 100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -253,6 +253,36 @@ RUNTIME_FUNCTION(Runtime_DefineClassMethod) {
}
+RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) {
+ 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 *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