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

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

Issue 1540953004: [runtime] Rewrite Function.prototype.toString in C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typos. Created 5 years 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
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index e1e9c46e0bd3315ea7cab87ef11223d0367ef26f..d6c079ae6b63be37e5615e9debd3eef9d56bde45 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -38,15 +38,6 @@ RUNTIME_FUNCTION(Runtime_FunctionSetName) {
}
-RUNTIME_FUNCTION(Runtime_FunctionNameShouldPrintAsAnonymous) {
- SealHandleScope shs(isolate);
- DCHECK(args.length() == 1);
- CONVERT_ARG_CHECKED(JSFunction, f, 0);
- return isolate->heap()->ToBoolean(
- f->shared()->name_should_print_as_anonymous());
-}
-
-
RUNTIME_FUNCTION(Runtime_CompleteFunctionConstruction) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 3);
@@ -89,22 +80,6 @@ RUNTIME_FUNCTION(Runtime_CompleteFunctionConstruction) {
}
-RUNTIME_FUNCTION(Runtime_FunctionIsArrow) {
- SealHandleScope shs(isolate);
- DCHECK(args.length() == 1);
- CONVERT_ARG_CHECKED(JSFunction, f, 0);
- return isolate->heap()->ToBoolean(f->shared()->is_arrow());
-}
-
-
-RUNTIME_FUNCTION(Runtime_FunctionIsConciseMethod) {
- SealHandleScope shs(isolate);
- DCHECK(args.length() == 1);
- CONVERT_ARG_CHECKED(JSFunction, f, 0);
- return isolate->heap()->ToBoolean(f->shared()->is_concise_method());
-}
-
-
RUNTIME_FUNCTION(Runtime_FunctionRemovePrototype) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
@@ -210,18 +185,6 @@ RUNTIME_FUNCTION(Runtime_FunctionIsAPIFunction) {
}
-RUNTIME_FUNCTION(Runtime_FunctionHidesSource) {
- SealHandleScope shs(isolate);
- DCHECK(args.length() == 1);
- CONVERT_ARG_CHECKED(JSFunction, f, 0);
-
- SharedFunctionInfo* shared = f->shared();
- bool hide_source = !shared->script()->IsScript() ||
- Script::cast(shared->script())->hide_source();
- return isolate->heap()->ToBoolean(hide_source);
-}
-
-
RUNTIME_FUNCTION(Runtime_SetCode) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
@@ -619,5 +582,13 @@ RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) {
NewTypeError(MessageTemplate::kStrongArity));
}
+
+RUNTIME_FUNCTION(Runtime_FunctionToString) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
+ return *JSFunction::ToString(function);
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698