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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 { // length 1202 { // length
1203 FieldDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex, 1203 FieldDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
1204 DONT_ENUM, Representation::Tagged()); 1204 DONT_ENUM, Representation::Tagged());
1205 map->AppendDescriptor(&d); 1205 map->AppendDescriptor(&d);
1206 } 1206 }
1207 { // callee 1207 { // callee
1208 FieldDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex, 1208 FieldDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex,
1209 DONT_ENUM, Representation::Tagged()); 1209 DONT_ENUM, Representation::Tagged());
1210 map->AppendDescriptor(&d); 1210 map->AppendDescriptor(&d);
1211 } 1211 }
1212 // @@iterator method is added later.
1212 1213
1213 map->set_function_with_prototype(true); 1214 map->set_function_with_prototype(true);
1214 map->set_pre_allocated_property_fields(2); 1215 map->set_pre_allocated_property_fields(2);
1215 map->set_inobject_properties(2); 1216 map->set_inobject_properties(2);
1216 native_context()->set_sloppy_arguments_map(*map); 1217 native_context()->set_sloppy_arguments_map(*map);
1217 1218
1218 DCHECK(!function->has_initial_map()); 1219 DCHECK(!function->has_initial_map());
1219 JSFunction::SetInitialMap(function, map, 1220 JSFunction::SetInitialMap(function, map,
1220 isolate->initial_object_prototype()); 1221 isolate->initial_object_prototype());
1221 1222
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 map->AppendDescriptor(&d); 1261 map->AppendDescriptor(&d);
1261 } 1262 }
1262 { // callee 1263 { // callee
1263 CallbacksDescriptor d(factory->callee_string(), callee, attributes); 1264 CallbacksDescriptor d(factory->callee_string(), callee, attributes);
1264 map->AppendDescriptor(&d); 1265 map->AppendDescriptor(&d);
1265 } 1266 }
1266 { // caller 1267 { // caller
1267 CallbacksDescriptor d(factory->caller_string(), caller, attributes); 1268 CallbacksDescriptor d(factory->caller_string(), caller, attributes);
1268 map->AppendDescriptor(&d); 1269 map->AppendDescriptor(&d);
1269 } 1270 }
1271 // @@iterator method is added later.
1270 1272
1271 map->set_function_with_prototype(true); 1273 map->set_function_with_prototype(true);
1272 map->set_prototype(native_context()->object_function()->prototype()); 1274 map->set_prototype(native_context()->object_function()->prototype());
1273 map->set_pre_allocated_property_fields(1); 1275 map->set_pre_allocated_property_fields(1);
1274 map->set_inobject_properties(1); 1276 map->set_inobject_properties(1);
1275 1277
1276 // Copy constructor from the sloppy arguments boilerplate. 1278 // Copy constructor from the sloppy arguments boilerplate.
1277 map->set_constructor( 1279 map->set_constructor(
1278 native_context()->sloppy_arguments_map()->constructor()); 1280 native_context()->sloppy_arguments_map()->constructor());
1279 1281
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 observers_end_perform_splice); 1596 observers_end_perform_splice);
1595 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", 1597 INSTALL_NATIVE(JSFunction, "NativeObjectObserve",
1596 native_object_observe); 1598 native_object_observe);
1597 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", 1599 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier",
1598 native_object_get_notifier); 1600 native_object_get_notifier);
1599 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", 1601 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange",
1600 native_object_notifier_perform_change); 1602 native_object_notifier_perform_change);
1601 1603
1602 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol); 1604 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol);
1603 INSTALL_NATIVE(Symbol, "symbolUnscopables", unscopables_symbol); 1605 INSTALL_NATIVE(Symbol, "symbolUnscopables", unscopables_symbol);
1606 INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator);
1604 1607
1605 INSTALL_NATIVE_MATH(abs) 1608 INSTALL_NATIVE_MATH(abs)
1606 INSTALL_NATIVE_MATH(acos) 1609 INSTALL_NATIVE_MATH(acos)
1607 INSTALL_NATIVE_MATH(asin) 1610 INSTALL_NATIVE_MATH(asin)
1608 INSTALL_NATIVE_MATH(atan) 1611 INSTALL_NATIVE_MATH(atan)
1609 INSTALL_NATIVE_MATH(atan2) 1612 INSTALL_NATIVE_MATH(atan2)
1610 INSTALL_NATIVE_MATH(ceil) 1613 INSTALL_NATIVE_MATH(ceil)
1611 INSTALL_NATIVE_MATH(cos) 1614 INSTALL_NATIVE_MATH(cos)
1612 INSTALL_NATIVE_MATH(exp) 1615 INSTALL_NATIVE_MATH(exp)
1613 INSTALL_NATIVE_MATH(floor) 1616 INSTALL_NATIVE_MATH(floor)
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 initial_map->AppendDescriptor(&input_field); 2039 initial_map->AppendDescriptor(&input_field);
2037 } 2040 }
2038 2041
2039 initial_map->set_inobject_properties(2); 2042 initial_map->set_inobject_properties(2);
2040 initial_map->set_pre_allocated_property_fields(2); 2043 initial_map->set_pre_allocated_property_fields(2);
2041 initial_map->set_unused_property_fields(0); 2044 initial_map->set_unused_property_fields(0);
2042 2045
2043 native_context()->set_regexp_result_map(*initial_map); 2046 native_context()->set_regexp_result_map(*initial_map);
2044 } 2047 }
2045 2048
2049 // Add @@iterator method to the arguments object maps.
2050 {
2051 PropertyAttributes attribs = DONT_ENUM;
2052 Handle<AccessorInfo> arguments_iterator =
2053 Accessors::ArgumentsIteratorInfo(isolate(), attribs);
2054 {
2055 CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()),
2056 arguments_iterator, attribs);
2057 Handle<Map> map(native_context()->sloppy_arguments_map());
2058 Map::EnsureDescriptorSlack(map, 1);
2059 map->AppendDescriptor(&d);
2060 }
2061 {
2062 CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()),
2063 arguments_iterator, attribs);
2064 Handle<Map> map(native_context()->aliased_arguments_map());
2065 Map::EnsureDescriptorSlack(map, 1);
2066 map->AppendDescriptor(&d);
2067 }
2068 {
2069 CallbacksDescriptor d(Handle<Name>(native_context()->iterator_symbol()),
2070 arguments_iterator, attribs);
2071 Handle<Map> map(native_context()->strict_arguments_map());
2072 Map::EnsureDescriptorSlack(map, 1);
2073 map->AppendDescriptor(&d);
2074 }
2075 }
2076
2046 #ifdef VERIFY_HEAP 2077 #ifdef VERIFY_HEAP
2047 builtins->ObjectVerify(); 2078 builtins->ObjectVerify();
2048 #endif 2079 #endif
2049 2080
2050 return true; 2081 return true;
2051 } 2082 }
2052 2083
2053 2084
2054 #define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \ 2085 #define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \
2055 if (FLAG_harmony_##flag && \ 2086 if (FLAG_harmony_##flag && \
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 return from + sizeof(NestingCounterType); 2726 return from + sizeof(NestingCounterType);
2696 } 2727 }
2697 2728
2698 2729
2699 // Called when the top-level V8 mutex is destroyed. 2730 // Called when the top-level V8 mutex is destroyed.
2700 void Bootstrapper::FreeThreadResources() { 2731 void Bootstrapper::FreeThreadResources() {
2701 DCHECK(!IsActive()); 2732 DCHECK(!IsActive());
2702 } 2733 }
2703 2734
2704 } } // namespace v8::internal 2735 } } // namespace v8::internal
OLDNEW
« 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