OLD | NEW |
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 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 } | 1962 } |
1963 | 1963 |
1964 { // -- S e t | 1964 { // -- S e t |
1965 Handle<JSFunction> js_set_fun = InstallFunction( | 1965 Handle<JSFunction> js_set_fun = InstallFunction( |
1966 global, "Set", JS_SET_TYPE, JSSet::kSize, | 1966 global, "Set", JS_SET_TYPE, JSSet::kSize, |
1967 isolate->initial_object_prototype(), Builtins::kIllegal); | 1967 isolate->initial_object_prototype(), Builtins::kIllegal); |
1968 InstallWithIntrinsicDefaultProto(isolate, js_set_fun, | 1968 InstallWithIntrinsicDefaultProto(isolate, js_set_fun, |
1969 Context::JS_SET_FUN_INDEX); | 1969 Context::JS_SET_FUN_INDEX); |
1970 } | 1970 } |
1971 | 1971 |
| 1972 { // -- J S M o d u l e N a m e s p a c e |
| 1973 Handle<Map> map = |
| 1974 factory->NewMap(JS_MODULE_NAMESPACE_TYPE, JSModuleNamespace::kSize); |
| 1975 Map::SetPrototype(map, isolate->factory()->null_value()); |
| 1976 native_context()->set_js_module_namespace_map(*map); |
| 1977 |
| 1978 // Install @@toStringTag. |
| 1979 PropertyAttributes attribs = |
| 1980 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); |
| 1981 Handle<AccessorInfo> toStringTag = |
| 1982 Accessors::ModuleNamespaceToStringTagInfo(isolate, attribs); |
| 1983 AccessorConstantDescriptor d(factory->to_string_tag_symbol(), toStringTag, |
| 1984 attribs); |
| 1985 Map::EnsureDescriptorSlack(map, 1); |
| 1986 map->AppendDescriptor(&d); |
| 1987 |
| 1988 // TODO(neis): Implement and install @@iterator. |
| 1989 } |
| 1990 |
1972 { // -- I t e r a t o r R e s u l t | 1991 { // -- I t e r a t o r R e s u l t |
1973 Handle<Map> map = | 1992 Handle<Map> map = |
1974 factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize); | 1993 factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize); |
1975 Map::SetPrototype(map, isolate->initial_object_prototype()); | 1994 Map::SetPrototype(map, isolate->initial_object_prototype()); |
1976 Map::EnsureDescriptorSlack(map, 2); | 1995 Map::EnsureDescriptorSlack(map, 2); |
1977 | 1996 |
1978 { // value | 1997 { // value |
1979 DataDescriptor d(factory->value_string(), JSIteratorResult::kValueIndex, | 1998 DataDescriptor d(factory->value_string(), JSIteratorResult::kValueIndex, |
1980 NONE, Representation::Tagged()); | 1999 NONE, Representation::Tagged()); |
1981 map->AppendDescriptor(&d); | 2000 map->AppendDescriptor(&d); |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4202 } | 4221 } |
4203 | 4222 |
4204 | 4223 |
4205 // Called when the top-level V8 mutex is destroyed. | 4224 // Called when the top-level V8 mutex is destroyed. |
4206 void Bootstrapper::FreeThreadResources() { | 4225 void Bootstrapper::FreeThreadResources() { |
4207 DCHECK(!IsActive()); | 4226 DCHECK(!IsActive()); |
4208 } | 4227 } |
4209 | 4228 |
4210 } // namespace internal | 4229 } // namespace internal |
4211 } // namespace v8 | 4230 } // namespace v8 |
OLD | NEW |