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

Unified Diff: src/bootstrapper.cc

Issue 1607943003: [runtime] Introduce maps for the likely cases of FromPropertyDescriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 4 years, 11 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 | « no previous file | src/contexts.h » ('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 d372494250ab6ccc26f0a2b7798c8eef6323b9fc..af97787b7f3d184c6a0e2daac9a98cb77d85393d 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2728,6 +2728,89 @@ bool Genesis::InstallNatives(ContextType context_type) {
InstallBuiltinFunctionIds();
+ // Create a map for accessor property descriptors (a variant of JSObject
+ // that predefines four properties get, set, configurable and enumerable).
+ {
+ // AccessorPropertyDescriptor initial map.
+ Handle<Map> map =
+ factory()->NewMap(JS_OBJECT_TYPE, JSAccessorPropertyDescriptor::kSize);
+ // Create the descriptor array for the property descriptor object.
+ Map::EnsureDescriptorSlack(map, 4);
+
+ { // get
+ DataDescriptor d(factory()->get_string(),
+ JSAccessorPropertyDescriptor::kGetIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+ { // set
+ DataDescriptor d(factory()->set_string(),
+ JSAccessorPropertyDescriptor::kSetIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+ { // enumerable
+ DataDescriptor d(factory()->enumerable_string(),
+ JSAccessorPropertyDescriptor::kEnumerableIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+ { // configurable
+ DataDescriptor d(factory()->configurable_string(),
+ JSAccessorPropertyDescriptor::kConfigurableIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+
+ Map::SetPrototype(map, isolate()->initial_object_prototype());
+ map->SetInObjectProperties(4);
+ map->set_unused_property_fields(0);
+
+ native_context()->set_accessor_property_descriptor_map(*map);
+ }
+
+ // Create a map for data property descriptors (a variant of JSObject
+ // that predefines four properties value, writable, configurable and
+ // enumerable).
+ {
+ // DataPropertyDescriptor initial map.
+ Handle<Map> map =
+ factory()->NewMap(JS_OBJECT_TYPE, JSDataPropertyDescriptor::kSize);
+ // Create the descriptor array for the property descriptor object.
+ Map::EnsureDescriptorSlack(map, 4);
+
+ { // value
+ DataDescriptor d(factory()->value_string(),
+ JSDataPropertyDescriptor::kValueIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+ { // writable
+ DataDescriptor d(factory()->writable_string(),
+ JSDataPropertyDescriptor::kWritableIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+ { // enumerable
+ DataDescriptor d(factory()->enumerable_string(),
+ JSDataPropertyDescriptor::kEnumerableIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+ { // configurable
+ DataDescriptor d(factory()->configurable_string(),
+ JSDataPropertyDescriptor::kConfigurableIndex, NONE,
+ Representation::Tagged());
+ map->AppendDescriptor(&d);
+ }
+
+ Map::SetPrototype(map, isolate()->initial_object_prototype());
+ map->SetInObjectProperties(4);
+ map->set_unused_property_fields(0);
+
+ native_context()->set_data_property_descriptor_map(*map);
+ }
+
// Create a constructor for RegExp results (a variant of Array that
// predefines the two properties index and match).
{
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698