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

Unified Diff: src/bootstrapper.cc

Issue 239163012: Revert "ES6: Add support for Map/Set forEach" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « src/array-iterator.js ('k') | src/collection.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 7016b85b31a01c595e2f6bd03ab722236d6dcd0e..45f55f86e2bc6ee930d0af39e7975797956f73d5 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1304,16 +1304,6 @@ void Genesis::InitializeExperimentalGlobal() {
isolate()->initial_object_prototype(),
Builtins::kIllegal, true, true);
}
- { // -- S e t I t e r a t o r
- Handle<Map> map = isolate()->factory()->NewMap(
- JS_SET_ITERATOR_TYPE, JSSetIterator::kSize);
- native_context()->set_set_iterator_map(*map);
- }
- { // -- M a p I t e r a t o r
- Handle<Map> map = isolate()->factory()->NewMap(
- JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize);
- native_context()->set_map_iterator_map(*map);
- }
}
if (FLAG_harmony_weak_collections) {
@@ -1368,38 +1358,37 @@ void Genesis::InitializeExperimentalGlobal() {
*generator_object_prototype);
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());
+ // Create a map for generator result objects.
ASSERT(object_function->initial_map()->inobject_properties() == 0);
- Handle<Map> iterator_result_map = Map::Create(
+ STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2);
+ Handle<Map> generator_result_map = Map::Create(
object_function, JSGeneratorObject::kResultPropertyCount);
- ASSERT(iterator_result_map->inobject_properties() ==
+ ASSERT(generator_result_map->inobject_properties() ==
JSGeneratorObject::kResultPropertyCount);
Map::EnsureDescriptorSlack(
- iterator_result_map, JSGeneratorObject::kResultPropertyCount);
+ generator_result_map, JSGeneratorObject::kResultPropertyCount);
- FieldDescriptor value_descr(isolate()->factory()->value_string(),
+ Handle<String> value_string = factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("value"));
+ FieldDescriptor value_descr(value_string,
JSGeneratorObject::kResultValuePropertyIndex,
NONE,
Representation::Tagged());
- iterator_result_map->AppendDescriptor(&value_descr);
+ generator_result_map->AppendDescriptor(&value_descr);
- FieldDescriptor done_descr(isolate()->factory()->done_string(),
+ Handle<String> done_string = factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("done"));
+ FieldDescriptor done_descr(done_string,
JSGeneratorObject::kResultDonePropertyIndex,
NONE,
Representation::Tagged());
- iterator_result_map->AppendDescriptor(&done_descr);
+ generator_result_map->AppendDescriptor(&done_descr);
- iterator_result_map->set_unused_property_fields(0);
+ generator_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);
+ generator_result_map->instance_size());
+ native_context()->set_generator_result_map(*generator_result_map);
}
}
« no previous file with comments | « src/array-iterator.js ('k') | src/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698