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

Unified Diff: src/bootstrapper.cc

Issue 429433003: DO NOT SUBMIT: Only for ES6 Collections try job (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix test-heap Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/d8.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index e58bf5abdb43b79699b32fea96f7fc6f340dfd08..1357eaaba105b46dd16a10179561aa5470d2f810 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1127,6 +1127,41 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
native_context()->set_data_view_fun(*data_view_fun);
}
+ // -- M a p
+ InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+
+ // -- S e t
+ InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+
+ { // Set up the iterator result object
+ STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2);
+ Handle<JSFunction> object_function(native_context()->object_function());
+ ASSERT(object_function->initial_map()->inobject_properties() == 0);
+ Handle<Map> iterator_result_map =
+ Map::Create(object_function, JSGeneratorObject::kResultPropertyCount);
+ ASSERT(iterator_result_map->inobject_properties() ==
+ JSGeneratorObject::kResultPropertyCount);
+ Map::EnsureDescriptorSlack(iterator_result_map,
+ JSGeneratorObject::kResultPropertyCount);
+
+ FieldDescriptor value_descr(factory->value_string(),
+ JSGeneratorObject::kResultValuePropertyIndex,
+ NONE, Representation::Tagged());
+ iterator_result_map->AppendDescriptor(&value_descr);
+
+ FieldDescriptor done_descr(factory->done_string(),
+ JSGeneratorObject::kResultDonePropertyIndex,
+ NONE, Representation::Tagged());
+ iterator_result_map->AppendDescriptor(&done_descr);
+
+ iterator_result_map->set_unused_property_fields(0);
+ ASSERT_EQ(JSGeneratorObject::kResultSize,
+ iterator_result_map->instance_size());
+ native_context()->set_iterator_result_map(*iterator_result_map);
+ }
+
// -- W e a k M a p
InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize,
isolate->initial_object_prototype(), Builtins::kIllegal);
@@ -1134,6 +1169,14 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize,
isolate->initial_object_prototype(), Builtins::kIllegal);
+ {
+ // --- S y m b o l ---
+ Handle<JSFunction> symbol_fun = InstallFunction(
+ global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
+ isolate->initial_object_prototype(), Builtins::kIllegal);
+ native_context()->set_symbol_function(*symbol_fun);
+ }
+
{ // --- sloppy arguments map
// Make sure we can recognize argument objects at runtime.
// This is done by introducing an anonymous function with
@@ -1303,48 +1346,9 @@ void Genesis::InstallTypedArray(
void Genesis::InitializeExperimentalGlobal() {
- Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
-
// TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no
// longer need to live behind flags, so functions get added to the snapshot.
- if (FLAG_harmony_symbols) {
- // --- S y m b o l ---
- Handle<JSFunction> symbol_fun = InstallFunction(
- global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
- isolate()->initial_object_prototype(), Builtins::kIllegal);
- native_context()->set_symbol_function(*symbol_fun);
- }
-
- if (FLAG_harmony_collections) {
- // -- M a p
- InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize,
- isolate()->initial_object_prototype(), Builtins::kIllegal);
- // -- S e t
- InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize,
- isolate()->initial_object_prototype(), Builtins::kIllegal);
- { // -- S e t I t e r a t o r
- Handle<JSObject> builtins(native_context()->builtins());
- Handle<JSFunction> set_iterator_function =
- InstallFunction(builtins, "SetIterator", JS_SET_ITERATOR_TYPE,
- JSSetIterator::kSize,
- isolate()->initial_object_prototype(),
- Builtins::kIllegal);
- native_context()->set_set_iterator_map(
- set_iterator_function->initial_map());
- }
- { // -- M a p I t e r a t o r
- Handle<JSObject> builtins(native_context()->builtins());
- Handle<JSFunction> map_iterator_function =
- InstallFunction(builtins, "MapIterator", JS_MAP_ITERATOR_TYPE,
- JSMapIterator::kSize,
- isolate()->initial_object_prototype(),
- Builtins::kIllegal);
- native_context()->set_map_iterator_map(
- map_iterator_function->initial_map());
- }
- }
-
if (FLAG_harmony_generators) {
// Create generator meta-objects and install them on the builtins object.
Handle<JSObject> builtins(native_context()->builtins());
@@ -1406,38 +1410,6 @@ void Genesis::InitializeExperimentalGlobal() {
native_context()->set_generator_object_prototype_map(
*generator_object_prototype_map);
}
-
- if (FLAG_harmony_collections || FLAG_harmony_generators) {
- // Collection forEach uses an iterator result object.
- // Generators return iteraror result objects.
-
- STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2);
- Handle<JSFunction> object_function(native_context()->object_function());
- ASSERT(object_function->initial_map()->inobject_properties() == 0);
- Handle<Map> iterator_result_map = Map::Create(
- object_function, JSGeneratorObject::kResultPropertyCount);
- ASSERT(iterator_result_map->inobject_properties() ==
- JSGeneratorObject::kResultPropertyCount);
- Map::EnsureDescriptorSlack(
- iterator_result_map, JSGeneratorObject::kResultPropertyCount);
-
- FieldDescriptor value_descr(isolate()->factory()->value_string(),
- JSGeneratorObject::kResultValuePropertyIndex,
- NONE,
- Representation::Tagged());
- iterator_result_map->AppendDescriptor(&value_descr);
-
- FieldDescriptor done_descr(isolate()->factory()->done_string(),
- JSGeneratorObject::kResultDonePropertyIndex,
- NONE,
- Representation::Tagged());
- iterator_result_map->AppendDescriptor(&done_descr);
-
- iterator_result_map->set_unused_property_fields(0);
- ASSERT_EQ(JSGeneratorObject::kResultSize,
- iterator_result_map->instance_size());
- native_context()->set_iterator_result_map(*iterator_result_map);
- }
}
@@ -1583,6 +1555,7 @@ void Genesis::InstallNativeFunctions() {
native_object_get_notifier);
INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange",
native_object_notifier_perform_change);
+ INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
}
@@ -1593,10 +1566,6 @@ void Genesis::InstallExperimentalNativeFunctions() {
INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap);
INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate);
}
-
- if (FLAG_harmony_symbols) {
- INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
- }
}
#undef INSTALL_NATIVE
@@ -1870,6 +1839,22 @@ bool Genesis::InstallNatives() {
InstallInternalArray(builtins, "InternalPackedArray", FAST_ELEMENTS);
}
+ { // -- S e t I t e r a t o r
+ Handle<JSFunction> set_iterator_function = InstallFunction(
+ builtins, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize,
+ isolate()->initial_object_prototype(), Builtins::kIllegal);
+ native_context()->set_set_iterator_map(
+ set_iterator_function->initial_map());
+ }
+
+ { // -- M a p I t e r a t o r
+ Handle<JSFunction> map_iterator_function = InstallFunction(
+ builtins, "MapIterator", JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize,
+ isolate()->initial_object_prototype(), Builtins::kIllegal);
+ native_context()->set_map_iterator_map(
+ map_iterator_function->initial_map());
+ }
+
if (FLAG_disable_native_files) {
PrintF("Warning: Running without installed natives!\n");
return true;
@@ -2013,10 +1998,7 @@ bool Genesis::InstallExperimentalNatives() {
for (int i = ExperimentalNatives::GetDebuggerCount();
i < ExperimentalNatives::GetBuiltinsCount();
i++) {
- INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js")
INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js")
- INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js")
- INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection-iterator.js")
INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js")
INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js")
INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "string-iterator.js")
« 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