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

Unified Diff: src/bootstrapper.cc

Issue 342453002: Arguments object has @@iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased, adapted to getdataproperty change 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.cc ('k') | src/contexts.h » ('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 fc0af002ab8be2d8f1f4e63787bcb19d0913aed6..7a27035acb58da5ff710bed02482efd04d36a06e 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1204,6 +1204,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
DONT_ENUM, Representation::Tagged());
map->AppendDescriptor(&d);
}
+ // @@iterator method is added later.
map->set_function_with_prototype(true);
map->set_pre_allocated_property_fields(2);
@@ -1262,6 +1263,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
CallbacksDescriptor d(factory->caller_string(), caller, attributes);
map->AppendDescriptor(&d);
}
+ // @@iterator method is added later.
map->set_function_with_prototype(true);
map->set_prototype(native_context()->object_function()->prototype());
@@ -1596,6 +1598,7 @@ void Genesis::InstallNativeFunctions() {
INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
INSTALL_NATIVE(Symbol, "symbolUnscopables", unscopables_symbol);
+ INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator);
INSTALL_NATIVE_MATH(abs)
INSTALL_NATIVE_MATH(acos)
@@ -2039,6 +2042,34 @@ bool Genesis::InstallNatives() {
native_context()->set_regexp_result_map(*initial_map);
}
+ // Add @@iterator method to the arguments object maps.
+ {
+ PropertyAttributes attribs = DONT_ENUM;
+ Handle<AccessorInfo> arguments_iterator =
+ Accessors::ArgumentsIteratorInfo(isolate(), attribs);
+ {
+ CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()),
+ arguments_iterator, attribs);
+ Handle<Map> map(native_context()->sloppy_arguments_map());
+ Map::EnsureDescriptorSlack(map, 1);
+ map->AppendDescriptor(&d);
+ }
+ {
+ CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()),
+ arguments_iterator, attribs);
+ Handle<Map> map(native_context()->aliased_arguments_map());
+ Map::EnsureDescriptorSlack(map, 1);
+ map->AppendDescriptor(&d);
+ }
+ {
+ CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()),
+ arguments_iterator, attribs);
+ Handle<Map> map(native_context()->strict_arguments_map());
+ Map::EnsureDescriptorSlack(map, 1);
+ map->AppendDescriptor(&d);
+ }
+ }
+
#ifdef VERIFY_HEAP
builtins->ObjectVerify();
#endif
« no previous file with comments | « src/accessors.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698