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

Unified Diff: src/bootstrapper.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/api.cc ('k') | src/builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 0d1c070e47e36418ee566dd637d97f72a2fcd8ec..2120cdb6e3458d037427085c2397226fb27b71b4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1705,18 +1705,21 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
Map::EnsureDescriptorSlack(map, 2);
+ Handle<AccessorInfo> bound_length =
+ Accessors::BoundFunctionLengthInfo(isolate, roc_attribs);
{ // length
- DataDescriptor d(factory->length_string(), JSBoundFunction::kLengthIndex,
- roc_attribs, Representation::Tagged());
+ AccessorConstantDescriptor d(factory->length_string(), bound_length,
+ roc_attribs);
map->AppendDescriptor(&d);
}
- { // name
- DataDescriptor d(factory->name_string(), JSBoundFunction::kNameIndex,
- roc_attribs, Representation::Tagged());
+ Handle<AccessorInfo> bound_name =
+ Accessors::BoundFunctionNameInfo(isolate, roc_attribs);
+ { // length
+ AccessorConstantDescriptor d(factory->name_string(), bound_name,
+ roc_attribs);
map->AppendDescriptor(&d);
}
-
- map->SetInObjectProperties(2);
+ map->SetInObjectProperties(0);
native_context()->set_bound_function_without_constructor_map(*map);
map = Map::Copy(map, "IsConstructor");
« no previous file with comments | « src/api.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698