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

Side by Side Diff: src/bootstrapper.cc

Issue 2410823002: [modules] Simplify installation of @@toStringTag on namespace objects. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/accessors.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 2133
2134 { // -- J S M o d u l e N a m e s p a c e 2134 { // -- J S M o d u l e N a m e s p a c e
2135 Handle<Map> map = 2135 Handle<Map> map =
2136 factory->NewMap(JS_MODULE_NAMESPACE_TYPE, JSModuleNamespace::kSize); 2136 factory->NewMap(JS_MODULE_NAMESPACE_TYPE, JSModuleNamespace::kSize);
2137 Map::SetPrototype(map, isolate->factory()->null_value()); 2137 Map::SetPrototype(map, isolate->factory()->null_value());
2138 native_context()->set_js_module_namespace_map(*map); 2138 native_context()->set_js_module_namespace_map(*map);
2139 2139
2140 // Install @@toStringTag. 2140 // Install @@toStringTag.
2141 PropertyAttributes attribs = 2141 PropertyAttributes attribs =
2142 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); 2142 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
2143 Handle<AccessorInfo> toStringTag = 2143 DataConstantDescriptor d(factory->to_string_tag_symbol(),
2144 Accessors::ModuleNamespaceToStringTagInfo(isolate, attribs); 2144 factory->NewStringFromAsciiChecked("Module"),
2145 AccessorConstantDescriptor d(factory->to_string_tag_symbol(), toStringTag, 2145 attribs);
2146 attribs);
2147 Map::EnsureDescriptorSlack(map, 1); 2146 Map::EnsureDescriptorSlack(map, 1);
2148 map->AppendDescriptor(&d); 2147 map->AppendDescriptor(&d);
2149 2148
2150 // TODO(neis): Implement and install @@iterator. 2149 // TODO(neis): Implement and install @@iterator.
2151 } 2150 }
2152 2151
2153 { // -- I t e r a t o r R e s u l t 2152 { // -- I t e r a t o r R e s u l t
2154 Handle<Map> map = 2153 Handle<Map> map =
2155 factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize); 2154 factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize);
2156 Map::SetPrototype(map, isolate->initial_object_prototype()); 2155 Map::SetPrototype(map, isolate->initial_object_prototype());
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after
4382 } 4381 }
4383 4382
4384 4383
4385 // Called when the top-level V8 mutex is destroyed. 4384 // Called when the top-level V8 mutex is destroyed.
4386 void Bootstrapper::FreeThreadResources() { 4385 void Bootstrapper::FreeThreadResources() {
4387 DCHECK(!IsActive()); 4386 DCHECK(!IsActive());
4388 } 4387 }
4389 4388
4390 } // namespace internal 4389 } // namespace internal
4391 } // namespace v8 4390 } // namespace v8
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698