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 "bootstrapper.h" | 5 #include "bootstrapper.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "natives.h" | 9 #include "natives.h" |
10 #include "snapshot.h" | 10 #include "snapshot.h" |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1336 } | 1336 } |
1337 | 1337 |
1338 if (FLAG_harmony_collections) { | 1338 if (FLAG_harmony_collections) { |
1339 // -- M a p | 1339 // -- M a p |
1340 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, | 1340 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, |
1341 isolate()->initial_object_prototype(), Builtins::kIllegal); | 1341 isolate()->initial_object_prototype(), Builtins::kIllegal); |
1342 // -- S e t | 1342 // -- S e t |
1343 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, | 1343 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, |
1344 isolate()->initial_object_prototype(), Builtins::kIllegal); | 1344 isolate()->initial_object_prototype(), Builtins::kIllegal); |
1345 { // -- S e t I t e r a t o r | 1345 { // -- S e t I t e r a t o r |
1346 Handle<Map> map = isolate()->factory()->NewMap( | 1346 Handle<JSObject> builtins(native_context()->builtins()); |
1347 JS_SET_ITERATOR_TYPE, JSSetIterator::kSize); | 1347 Handle<JSFunction> set_iterator_function = |
1348 map->set_constructor(native_context()->closure()); | 1348 InstallFunction(builtins, "SetIterator", JS_SET_ITERATOR_TYPE, |
1349 native_context()->set_set_iterator_map(*map); | 1349 JSSetIterator::kSize, |
1350 isolate()->initial_object_prototype(), | |
1351 Builtins::kIllegal); | |
1352 native_context()->set_set_iterator_map( | |
1353 set_iterator_function->initial_map()); | |
1350 } | 1354 } |
1351 { // -- M a p I t e r a t o r | 1355 { // -- M a p I t e r a t o r |
1352 Handle<Map> map = isolate()->factory()->NewMap( | 1356 Handle<JSObject> builtins(native_context()->builtins()); |
1353 JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize); | 1357 Handle<JSFunction> map_iterator_function = |
1354 map->set_constructor(native_context()->closure()); | 1358 InstallFunction(builtins, "MapIterator", JS_MAP_ITERATOR_TYPE, |
1355 native_context()->set_map_iterator_map(*map); | 1359 JSMapIterator::kSize, |
1360 isolate()->initial_object_prototype(), | |
1361 Builtins::kIllegal); | |
1362 native_context()->set_map_iterator_map( | |
1363 map_iterator_function->initial_map()); | |
1356 } | 1364 } |
1357 } | 1365 } |
1358 | 1366 |
1359 if (FLAG_harmony_generators) { | 1367 if (FLAG_harmony_generators) { |
1360 // Create generator meta-objects and install them on the builtins object. | 1368 // Create generator meta-objects and install them on the builtins object. |
1361 Handle<JSObject> builtins(native_context()->builtins()); | 1369 Handle<JSObject> builtins(native_context()->builtins()); |
1362 Handle<JSObject> generator_object_prototype = | 1370 Handle<JSObject> generator_object_prototype = |
1363 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1371 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1364 Handle<JSFunction> generator_function_prototype = InstallFunction( | 1372 Handle<JSFunction> generator_function_prototype = InstallFunction( |
1365 builtins, "GeneratorFunctionPrototype", JS_FUNCTION_TYPE, | 1373 builtins, "GeneratorFunctionPrototype", JS_FUNCTION_TYPE, |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2002 } | 2010 } |
2003 | 2011 |
2004 | 2012 |
2005 bool Genesis::InstallExperimentalNatives() { | 2013 bool Genesis::InstallExperimentalNatives() { |
2006 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2014 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2007 i < ExperimentalNatives::GetBuiltinsCount(); | 2015 i < ExperimentalNatives::GetBuiltinsCount(); |
2008 i++) { | 2016 i++) { |
2009 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") | 2017 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") |
2010 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") | 2018 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
2011 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") | 2019 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") |
2020 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection-iterator.js") | |
Michael Starzinger
2014/06/02 11:53:36
Just out of curiosity, is there a particular reaso
arv (Not doing code reviews)
2014/06/02 23:40:52
The initial reason was that I had them under a dif
| |
2012 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") | 2021 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
2013 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") | 2022 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
2014 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") | 2023 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |
2015 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") | 2024 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") |
2016 INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js") | 2025 INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js") |
2017 } | 2026 } |
2018 | 2027 |
2019 InstallExperimentalNativeFunctions(); | 2028 InstallExperimentalNativeFunctions(); |
2020 InstallExperimentalBuiltinFunctionIds(); | 2029 InstallExperimentalBuiltinFunctionIds(); |
2021 return true; | 2030 return true; |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2701 return from + sizeof(NestingCounterType); | 2710 return from + sizeof(NestingCounterType); |
2702 } | 2711 } |
2703 | 2712 |
2704 | 2713 |
2705 // Called when the top-level V8 mutex is destroyed. | 2714 // Called when the top-level V8 mutex is destroyed. |
2706 void Bootstrapper::FreeThreadResources() { | 2715 void Bootstrapper::FreeThreadResources() { |
2707 ASSERT(!IsActive()); | 2716 ASSERT(!IsActive()); |
2708 } | 2717 } |
2709 | 2718 |
2710 } } // namespace v8::internal | 2719 } } // namespace v8::internal |
OLD | NEW |