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

Side by Side Diff: src/bootstrapper.cc

Issue 421313004: Enable ES6 Symbols by default (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/d8.js » ('j') | 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/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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 ASSERT(!function->has_initial_map()); 1170 ASSERT(!function->has_initial_map());
1171 function->set_initial_map(*map); 1171 function->set_initial_map(*map);
1172 map->set_constructor(*function); 1172 map->set_constructor(*function);
1173 1173
1174 ASSERT(map->inobject_properties() > Heap::kArgumentsCalleeIndex); 1174 ASSERT(map->inobject_properties() > Heap::kArgumentsCalleeIndex);
1175 ASSERT(map->inobject_properties() > Heap::kArgumentsLengthIndex); 1175 ASSERT(map->inobject_properties() > Heap::kArgumentsLengthIndex);
1176 ASSERT(!map->is_dictionary_map()); 1176 ASSERT(!map->is_dictionary_map());
1177 ASSERT(IsFastObjectElementsKind(map->elements_kind())); 1177 ASSERT(IsFastObjectElementsKind(map->elements_kind()));
1178 } 1178 }
1179 1179
1180 {
1181 // --- S y m b o l ---
1182 Handle<JSFunction> symbol_fun = InstallFunction(
1183 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
1184 isolate->initial_object_prototype(), Builtins::kIllegal);
1185 native_context()->set_symbol_function(*symbol_fun);
1186 }
1187
1180 { // --- aliased arguments map 1188 { // --- aliased arguments map
1181 Handle<Map> map = Map::Copy(isolate->sloppy_arguments_map()); 1189 Handle<Map> map = Map::Copy(isolate->sloppy_arguments_map());
1182 map->set_elements_kind(SLOPPY_ARGUMENTS_ELEMENTS); 1190 map->set_elements_kind(SLOPPY_ARGUMENTS_ELEMENTS);
1183 ASSERT_EQ(2, map->pre_allocated_property_fields()); 1191 ASSERT_EQ(2, map->pre_allocated_property_fields());
1184 native_context()->set_aliased_arguments_map(*map); 1192 native_context()->set_aliased_arguments_map(*map);
1185 } 1193 }
1186 1194
1187 { // --- strict mode arguments map 1195 { // --- strict mode arguments map
1188 const PropertyAttributes attributes = 1196 const PropertyAttributes attributes =
1189 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1197 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 *external_map = Map::AsElementsKind(initial_map, external_kind); 1309 *external_map = Map::AsElementsKind(initial_map, external_kind);
1302 } 1310 }
1303 1311
1304 1312
1305 void Genesis::InitializeExperimentalGlobal() { 1313 void Genesis::InitializeExperimentalGlobal() {
1306 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); 1314 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
1307 1315
1308 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no 1316 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no
1309 // longer need to live behind flags, so functions get added to the snapshot. 1317 // longer need to live behind flags, so functions get added to the snapshot.
1310 1318
1311 if (FLAG_harmony_symbols) {
1312 // --- S y m b o l ---
1313 Handle<JSFunction> symbol_fun = InstallFunction(
1314 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
1315 isolate()->initial_object_prototype(), Builtins::kIllegal);
1316 native_context()->set_symbol_function(*symbol_fun);
1317 }
1318
1319 if (FLAG_harmony_collections) { 1319 if (FLAG_harmony_collections) {
1320 // -- M a p 1320 // -- M a p
1321 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize, 1321 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize,
1322 isolate()->initial_object_prototype(), Builtins::kIllegal); 1322 isolate()->initial_object_prototype(), Builtins::kIllegal);
1323 // -- S e t 1323 // -- S e t
1324 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, 1324 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize,
1325 isolate()->initial_object_prototype(), Builtins::kIllegal); 1325 isolate()->initial_object_prototype(), Builtins::kIllegal);
1326 { // -- S e t I t e r a t o r 1326 { // -- S e t I t e r a t o r
1327 Handle<JSObject> builtins(native_context()->builtins()); 1327 Handle<JSObject> builtins(native_context()->builtins());
1328 Handle<JSFunction> set_iterator_function = 1328 Handle<JSFunction> set_iterator_function =
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", 1576 INSTALL_NATIVE(JSFunction, "BeginPerformSplice",
1577 observers_begin_perform_splice); 1577 observers_begin_perform_splice);
1578 INSTALL_NATIVE(JSFunction, "EndPerformSplice", 1578 INSTALL_NATIVE(JSFunction, "EndPerformSplice",
1579 observers_end_perform_splice); 1579 observers_end_perform_splice);
1580 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", 1580 INSTALL_NATIVE(JSFunction, "NativeObjectObserve",
1581 native_object_observe); 1581 native_object_observe);
1582 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", 1582 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier",
1583 native_object_get_notifier); 1583 native_object_get_notifier);
1584 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", 1584 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange",
1585 native_object_notifier_perform_change); 1585 native_object_notifier_perform_change);
1586 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
1586 } 1587 }
1587 1588
1588 1589
1589 void Genesis::InstallExperimentalNativeFunctions() { 1590 void Genesis::InstallExperimentalNativeFunctions() {
1590 if (FLAG_harmony_proxies) { 1591 if (FLAG_harmony_proxies) {
1591 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); 1592 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap);
1592 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); 1593 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap);
1593 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); 1594 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap);
1594 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); 1595 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate);
1595 } 1596 }
1596
1597 if (FLAG_harmony_symbols) {
1598 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
1599 }
1600 } 1597 }
1601 1598
1602 #undef INSTALL_NATIVE 1599 #undef INSTALL_NATIVE
1603 1600
1604 1601
1605 Handle<JSFunction> Genesis::InstallInternalArray( 1602 Handle<JSFunction> Genesis::InstallInternalArray(
1606 Handle<JSBuiltinsObject> builtins, 1603 Handle<JSBuiltinsObject> builtins,
1607 const char* name, 1604 const char* name,
1608 ElementsKind elements_kind) { 1605 ElementsKind elements_kind) {
1609 // --- I n t e r n a l A r r a y --- 1606 // --- I n t e r n a l A r r a y ---
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 strcmp(ExperimentalNatives::GetScriptName(i).start(), \ 2003 strcmp(ExperimentalNatives::GetScriptName(i).start(), \
2007 "native " file) == 0) { \ 2004 "native " file) == 0) { \
2008 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ 2005 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
2009 } 2006 }
2010 2007
2011 2008
2012 bool Genesis::InstallExperimentalNatives() { 2009 bool Genesis::InstallExperimentalNatives() {
2013 for (int i = ExperimentalNatives::GetDebuggerCount(); 2010 for (int i = ExperimentalNatives::GetDebuggerCount();
2014 i < ExperimentalNatives::GetBuiltinsCount(); 2011 i < ExperimentalNatives::GetBuiltinsCount();
2015 i++) { 2012 i++) {
2016 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js")
2017 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") 2013 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js")
2018 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") 2014 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js")
2019 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection-iterator.js") 2015 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection-iterator.js")
2020 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") 2016 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js")
2021 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") 2017 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js")
2022 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "string-iterator.js") 2018 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "string-iterator.js")
2023 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") 2019 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js")
2024 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") 2020 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js")
2025 } 2021 }
2026 2022
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 return from + sizeof(NestingCounterType); 2689 return from + sizeof(NestingCounterType);
2694 } 2690 }
2695 2691
2696 2692
2697 // Called when the top-level V8 mutex is destroyed. 2693 // Called when the top-level V8 mutex is destroyed.
2698 void Bootstrapper::FreeThreadResources() { 2694 void Bootstrapper::FreeThreadResources() {
2699 ASSERT(!IsActive()); 2695 ASSERT(!IsActive());
2700 } 2696 }
2701 2697
2702 } } // namespace v8::internal 2698 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/d8.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698