Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 4aeef9d4558b7a59c3dcb06aa3d2d8052d022b92..4f7b1b16f6ce5c0c21555a510c8d432607536de9 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -2050,6 +2050,25 @@ RUNTIME_FUNCTION(Runtime_PreventExtensions) { |
} |
+RUNTIME_FUNCTION(Runtime_ToMethod) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); |
+ Handle<JSFunction> clone = JSFunction::CloneClosure(fun); |
+ Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); |
+ JSObject::SetOwnPropertyIgnoreAttributes(clone, home_object_symbol, |
+ home_object, DONT_ENUM).Assert(); |
+ return *clone; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { |
+ DCHECK(args.length() == 0); |
+ return isolate->heap()->home_object_symbol(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_IsExtensible) { |
SealHandleScope shs(isolate); |
DCHECK(args.length() == 1); |