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

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

Issue 1871503002: Lazily compute boundfunction .name and .length if possible (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed Created 4 years, 8 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/objects-inl.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-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index a2144ebe7147bb0c917915092fcddcb5c69dbd3a..e59ed027078b7b1570a5d193aa3a26a195b6248d 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -1454,11 +1454,14 @@ RUNTIME_FUNCTION(Runtime_FunctionGetDebugName) {
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0);
+ Handle<Object> name;
if (function->IsJSBoundFunction()) {
- return Handle<JSBoundFunction>::cast(function)->name();
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, name, JSBoundFunction::GetName(
+ isolate, Handle<JSBoundFunction>::cast(function)));
+ } else {
+ name = JSFunction::GetDebugName(Handle<JSFunction>::cast(function));
}
- Handle<Object> name =
- JSFunction::GetDebugName(Handle<JSFunction>::cast(function));
return *name;
}
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698