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/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/extensions/externalize-string-extension.h" | 9 #include "src/extensions/externalize-string-extension.h" |
10 #include "src/extensions/free-buffer-extension.h" | 10 #include "src/extensions/free-buffer-extension.h" |
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1554 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", | 1554 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", |
1555 observers_begin_perform_splice); | 1555 observers_begin_perform_splice); |
1556 INSTALL_NATIVE(JSFunction, "EndPerformSplice", | 1556 INSTALL_NATIVE(JSFunction, "EndPerformSplice", |
1557 observers_end_perform_splice); | 1557 observers_end_perform_splice); |
1558 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", | 1558 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", |
1559 native_object_observe); | 1559 native_object_observe); |
1560 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", | 1560 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", |
1561 native_object_get_notifier); | 1561 native_object_get_notifier); |
1562 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", | 1562 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", |
1563 native_object_notifier_perform_change); | 1563 native_object_notifier_perform_change); |
1564 | |
1565 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol); | |
1566 INSTALL_NATIVE(Symbol, "symbolUnscopables", unscopables_symbol); | |
1567 INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator); | 1564 INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator); |
1568 | 1565 |
1569 #define INSTALL_NATIVE_FUNCTIONS_FOR(id, descr) InstallNativeFunctions_##id(); | 1566 #define INSTALL_NATIVE_FUNCTIONS_FOR(id, descr) InstallNativeFunctions_##id(); |
1570 HARMONY_SHIPPING(INSTALL_NATIVE_FUNCTIONS_FOR) | 1567 HARMONY_SHIPPING(INSTALL_NATIVE_FUNCTIONS_FOR) |
1571 #undef INSTALL_NATIVE_FUNCTIONS_FOR | 1568 #undef INSTALL_NATIVE_FUNCTIONS_FOR |
1572 } | 1569 } |
1573 | 1570 |
1574 | 1571 |
1575 void Genesis::InstallExperimentalNativeFunctions() { | 1572 void Genesis::InstallExperimentalNativeFunctions() { |
1576 if (FLAG_harmony_proxies) { | 1573 if (FLAG_harmony_proxies) { |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1981 generator_object_prototype_map->set_prototype(*generator_object_prototype); | 1978 generator_object_prototype_map->set_prototype(*generator_object_prototype); |
1982 native_context()->set_generator_object_prototype_map( | 1979 native_context()->set_generator_object_prototype_map( |
1983 *generator_object_prototype_map); | 1980 *generator_object_prototype_map); |
1984 } | 1981 } |
1985 | 1982 |
1986 if (FLAG_disable_native_files) { | 1983 if (FLAG_disable_native_files) { |
1987 PrintF("Warning: Running without installed natives!\n"); | 1984 PrintF("Warning: Running without installed natives!\n"); |
1988 return true; | 1985 return true; |
1989 } | 1986 } |
1990 | 1987 |
1988 // Install public symbols. | |
1989 { | |
1990 static const PropertyAttributes attributes = | |
1991 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | |
1992 #define INSTALL_PUBLIC_SYMBOL(name, varname, description) \ | |
1993 Handle<String> varname = factory()->NewStringFromStaticChars(#varname); \ | |
1994 JSObject::AddProperty(builtins, varname, factory()->name(), attributes); | |
Yang
2014/11/12 17:18:32
This installs the public symbols on the builtins o
| |
1995 PUBLIC_SYMBOL_LIST(INSTALL_PUBLIC_SYMBOL) | |
1996 #undef INSTALL_PUBLIC_SYMBOL | |
1997 } | |
1998 | |
1991 // Install natives. | 1999 // Install natives. |
1992 for (int i = Natives::GetDebuggerCount(); | 2000 for (int i = Natives::GetDebuggerCount(); |
1993 i < Natives::GetBuiltinsCount(); | 2001 i < Natives::GetBuiltinsCount(); |
1994 i++) { | 2002 i++) { |
1995 if (!CompileBuiltin(isolate(), i)) return false; | 2003 if (!CompileBuiltin(isolate(), i)) return false; |
1996 // TODO(ager): We really only need to install the JS builtin | 2004 // TODO(ager): We really only need to install the JS builtin |
1997 // functions on the builtins object after compiling and running | 2005 // functions on the builtins object after compiling and running |
1998 // runtime.js. | 2006 // runtime.js. |
1999 if (!InstallJSBuiltins(builtins)) return false; | 2007 if (!InstallJSBuiltins(builtins)) return false; |
2000 } | 2008 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2107 | 2115 |
2108 native_context()->set_regexp_result_map(*initial_map); | 2116 native_context()->set_regexp_result_map(*initial_map); |
2109 } | 2117 } |
2110 | 2118 |
2111 // Add @@iterator method to the arguments object maps. | 2119 // Add @@iterator method to the arguments object maps. |
2112 { | 2120 { |
2113 PropertyAttributes attribs = DONT_ENUM; | 2121 PropertyAttributes attribs = DONT_ENUM; |
2114 Handle<AccessorInfo> arguments_iterator = | 2122 Handle<AccessorInfo> arguments_iterator = |
2115 Accessors::ArgumentsIteratorInfo(isolate(), attribs); | 2123 Accessors::ArgumentsIteratorInfo(isolate(), attribs); |
2116 { | 2124 { |
2117 CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()), | 2125 CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator, |
2118 arguments_iterator, attribs); | 2126 attribs); |
2119 Handle<Map> map(native_context()->sloppy_arguments_map()); | 2127 Handle<Map> map(native_context()->sloppy_arguments_map()); |
2120 Map::EnsureDescriptorSlack(map, 1); | 2128 Map::EnsureDescriptorSlack(map, 1); |
2121 map->AppendDescriptor(&d); | 2129 map->AppendDescriptor(&d); |
2122 } | 2130 } |
2123 { | 2131 { |
2124 CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()), | 2132 CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator, |
2125 arguments_iterator, attribs); | 2133 attribs); |
2126 Handle<Map> map(native_context()->aliased_arguments_map()); | 2134 Handle<Map> map(native_context()->aliased_arguments_map()); |
2127 Map::EnsureDescriptorSlack(map, 1); | 2135 Map::EnsureDescriptorSlack(map, 1); |
2128 map->AppendDescriptor(&d); | 2136 map->AppendDescriptor(&d); |
2129 } | 2137 } |
2130 { | 2138 { |
2131 CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()), | 2139 CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator, |
2132 arguments_iterator, attribs); | 2140 attribs); |
2133 Handle<Map> map(native_context()->strict_arguments_map()); | 2141 Handle<Map> map(native_context()->strict_arguments_map()); |
2134 Map::EnsureDescriptorSlack(map, 1); | 2142 Map::EnsureDescriptorSlack(map, 1); |
2135 map->AppendDescriptor(&d); | 2143 map->AppendDescriptor(&d); |
2136 } | 2144 } |
2137 } | 2145 } |
2138 | 2146 |
2139 #ifdef VERIFY_HEAP | 2147 #ifdef VERIFY_HEAP |
2140 builtins->ObjectVerify(); | 2148 builtins->ObjectVerify(); |
2141 #endif | 2149 #endif |
2142 | 2150 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2823 return from + sizeof(NestingCounterType); | 2831 return from + sizeof(NestingCounterType); |
2824 } | 2832 } |
2825 | 2833 |
2826 | 2834 |
2827 // Called when the top-level V8 mutex is destroyed. | 2835 // Called when the top-level V8 mutex is destroyed. |
2828 void Bootstrapper::FreeThreadResources() { | 2836 void Bootstrapper::FreeThreadResources() { |
2829 DCHECK(!IsActive()); | 2837 DCHECK(!IsActive()); |
2830 } | 2838 } |
2831 | 2839 |
2832 } } // namespace v8::internal | 2840 } } // namespace v8::internal |
OLD | NEW |