| 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, | 1304 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, |
| 1305 isolate()->initial_object_prototype(), | 1305 isolate()->initial_object_prototype(), |
| 1306 Builtins::kIllegal, true, true); | 1306 Builtins::kIllegal, true, true); |
| 1307 } | 1307 } |
| 1308 { // -- S e t | 1308 { // -- S e t |
| 1309 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, | 1309 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, |
| 1310 isolate()->initial_object_prototype(), | 1310 isolate()->initial_object_prototype(), |
| 1311 Builtins::kIllegal, true, true); | 1311 Builtins::kIllegal, true, true); |
| 1312 } | 1312 } |
| 1313 { // -- S e t I t e r a t o r | 1313 { // -- S e t I t e r a t o r |
| 1314 Handle<Map> map = isolate()->factory()->NewMap( | 1314 Handle<JSObject> builtins(native_context()->builtins()); |
| 1315 JS_SET_ITERATOR_TYPE, JSSetIterator::kSize); | 1315 Handle<JSObject> set_iterator_prototype = |
| 1316 native_context()->set_set_iterator_map(*map); | 1316 factory()->NewJSObject(isolate()->object_function(), TENURED); |
| 1317 Handle<JSFunction> set_iterator_function = |
| 1318 InstallFunction(builtins, "SetIterator", JS_SET_ITERATOR_TYPE, |
| 1319 JSSetIterator::kSize, |
| 1320 set_iterator_prototype, |
| 1321 Builtins::kIllegal, true, false); |
| 1322 |
| 1323 Map* map = set_iterator_function->initial_map(); |
| 1324 native_context()->set_set_iterator_map(map); |
| 1317 } | 1325 } |
| 1318 { // -- M a p I t e r a t o r | 1326 { // -- M a p I t e r a t o r |
| 1319 Handle<Map> map = isolate()->factory()->NewMap( | 1327 Handle<JSObject> builtins(native_context()->builtins()); |
| 1320 JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize); | 1328 Handle<JSObject> map_iterator_prototype = |
| 1321 native_context()->set_map_iterator_map(*map); | 1329 factory()->NewJSObject(isolate()->object_function(), TENURED); |
| 1330 |
| 1331 Handle<JSFunction> map_iterator_function = |
| 1332 InstallFunction(builtins, "MapIterator", JS_MAP_ITERATOR_TYPE, |
| 1333 JSMapIterator::kSize, |
| 1334 map_iterator_prototype, |
| 1335 Builtins::kIllegal, true, false); |
| 1336 |
| 1337 Map* map = map_iterator_function->initial_map(); |
| 1338 native_context()->set_map_iterator_map(map); |
| 1322 } | 1339 } |
| 1323 } | 1340 } |
| 1324 | 1341 |
| 1325 if (FLAG_harmony_weak_collections) { | 1342 if (FLAG_harmony_weak_collections) { |
| 1326 { // -- W e a k M a p | 1343 { // -- W e a k M a p |
| 1327 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, | 1344 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
| 1328 isolate()->initial_object_prototype(), | 1345 isolate()->initial_object_prototype(), |
| 1329 Builtins::kIllegal, true, true); | 1346 Builtins::kIllegal, true, true); |
| 1330 } | 1347 } |
| 1331 { // -- W e a k S e t | 1348 { // -- W e a k S e t |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1984 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") | 2001 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") |
| 1985 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") | 2002 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
| 1986 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") | 2003 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") |
| 1987 INSTALL_EXPERIMENTAL_NATIVE(i, weak_collections, "weak_collection.js") | 2004 INSTALL_EXPERIMENTAL_NATIVE(i, weak_collections, "weak_collection.js") |
| 1988 INSTALL_EXPERIMENTAL_NATIVE(i, promises, "promise.js") | 2005 INSTALL_EXPERIMENTAL_NATIVE(i, promises, "promise.js") |
| 1989 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") | 2006 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
| 1990 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") | 2007 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
| 1991 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") | 2008 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |
| 1992 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") | 2009 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") |
| 1993 INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js") | 2010 INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js") |
| 2011 INSTALL_EXPERIMENTAL_NATIVE(i, collection_iterators, |
| 2012 "collection-iterator.js") |
| 1994 } | 2013 } |
| 1995 | 2014 |
| 1996 InstallExperimentalNativeFunctions(); | 2015 InstallExperimentalNativeFunctions(); |
| 1997 InstallExperimentalBuiltinFunctionIds(); | 2016 InstallExperimentalBuiltinFunctionIds(); |
| 1998 return true; | 2017 return true; |
| 1999 } | 2018 } |
| 2000 | 2019 |
| 2001 | 2020 |
| 2002 static Handle<JSObject> ResolveBuiltinIdHolder( | 2021 static Handle<JSObject> ResolveBuiltinIdHolder( |
| 2003 Handle<Context> native_context, | 2022 Handle<Context> native_context, |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2683 return from + sizeof(NestingCounterType); | 2702 return from + sizeof(NestingCounterType); |
| 2684 } | 2703 } |
| 2685 | 2704 |
| 2686 | 2705 |
| 2687 // Called when the top-level V8 mutex is destroyed. | 2706 // Called when the top-level V8 mutex is destroyed. |
| 2688 void Bootstrapper::FreeThreadResources() { | 2707 void Bootstrapper::FreeThreadResources() { |
| 2689 ASSERT(!IsActive()); | 2708 ASSERT(!IsActive()); |
| 2690 } | 2709 } |
| 2691 | 2710 |
| 2692 } } // namespace v8::internal | 2711 } } // namespace v8::internal |
| OLD | NEW |