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

Unified Diff: src/bootstrapper.cc

Issue 342453002: Arguments object has @@iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added more thorough test for own property descriptor 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
« src/accessors.cc ('K') | « 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 240be719187df946dd347f6583c8f3e3868a4d2a..a97aec63b7ce0816b42eed0a57e3d60cde9361b2 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1209,6 +1209,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);
@@ -1267,6 +1268,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());
@@ -1601,6 +1603,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)
@@ -2043,6 +2046,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
« src/accessors.cc ('K') | « src/accessors.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698