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

Unified Diff: src/factory.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/builtins.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 99f80ed37b04624790c4cbdf0087dc73fea7ca7a..4bfbc780bbb4b0995d8d5171bc516a12cc7e2806 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1960,13 +1960,9 @@ MaybeHandle<JSBoundFunction> Factory::NewJSBoundFunction(
}
// Setup the map for the JSBoundFunction instance.
- Handle<Map> map = handle(
- target_function->IsConstructor()
- ? isolate()->native_context()->bound_function_with_constructor_map()
- : isolate()
- ->native_context()
- ->bound_function_without_constructor_map(),
- isolate());
+ Handle<Map> map = target_function->IsConstructor()
+ ? isolate()->bound_function_with_constructor_map()
+ : isolate()->bound_function_without_constructor_map();
if (map->prototype() != *prototype) {
map = Map::TransitionToPrototype(map, prototype, REGULAR_PROTOTYPE);
}
@@ -1978,8 +1974,6 @@ MaybeHandle<JSBoundFunction> Factory::NewJSBoundFunction(
result->set_bound_target_function(*target_function);
result->set_bound_this(*bound_this);
result->set_bound_arguments(*bound_arguments);
- result->set_length(Smi::FromInt(0));
- result->set_name(*undefined_value(), SKIP_WRITE_BARRIER);
return result;
}
« no previous file with comments | « src/builtins.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698