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

Side by Side Diff: src/factory.cc

Issue 2578053003: [modules] Remove @@iterator on namespace objects. (Closed)
Patch Set: Skip out-of-date tests262 tests. Created 4 years 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
« no previous file with comments | « src/factory.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 { 2757 {
2758 // Add prototype. 2758 // Add prototype.
2759 Handle<AccessorInfo> prototype = 2759 Handle<AccessorInfo> prototype =
2760 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); 2760 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs);
2761 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), 2761 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
2762 prototype, rw_attribs); 2762 prototype, rw_attribs);
2763 map->AppendDescriptor(&d); 2763 map->AppendDescriptor(&d);
2764 } 2764 }
2765 } 2765 }
2766 2766
2767 Handle<JSFixedArrayIterator> Factory::NewJSFixedArrayIterator(
2768 Handle<FixedArray> array) {
2769 // Create the "next" function (must be unique per iterator object).
2770 Handle<Code> code(
2771 isolate()->builtins()->builtin(Builtins::kFixedArrayIteratorNext));
2772 // TODO(neis): Don't create a new SharedFunctionInfo each time.
2773 Handle<JSFunction> next = isolate()->factory()->NewFunctionWithoutPrototype(
2774 isolate()->factory()->next_string(), code, false);
2775 next->shared()->set_native(true);
2776
2777 // Create the iterator.
2778 Handle<Map> map(isolate()->native_context()->fixed_array_iterator_map());
2779 Handle<JSFixedArrayIterator> iterator =
2780 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2781 iterator->set_initial_next(*next);
2782 iterator->set_array(*array);
2783 iterator->set_index(0);
2784 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2785 return iterator;
2786 }
2787
2788 } // namespace internal 2767 } // namespace internal
2789 } // namespace v8 2768 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698