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

Side by Side Diff: src/factory.cc

Issue 2645313003: [async-iteration] implement Async-from-Sync Iterator (Closed)
Patch Set: attempt #3 to fix merge conflicts Created 3 years, 11 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
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 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value, 1951 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value,
1952 bool done) { 1952 bool done) {
1953 Handle<Map> map(isolate()->native_context()->iterator_result_map()); 1953 Handle<Map> map(isolate()->native_context()->iterator_result_map());
1954 Handle<JSIteratorResult> js_iter_result = 1954 Handle<JSIteratorResult> js_iter_result =
1955 Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map)); 1955 Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map));
1956 js_iter_result->set_value(*value); 1956 js_iter_result->set_value(*value);
1957 js_iter_result->set_done(*ToBoolean(done)); 1957 js_iter_result->set_done(*ToBoolean(done));
1958 return js_iter_result; 1958 return js_iter_result;
1959 } 1959 }
1960 1960
1961 Handle<JSAsyncFromSyncIterator> Factory::NewJSAsyncFromSyncIterator(
1962 Handle<HeapObject> sync_iterator) {
1963 Handle<Map> map(isolate()->native_context()->async_from_sync_iterator_map());
1964 Handle<JSAsyncFromSyncIterator> iterator =
1965 Handle<JSAsyncFromSyncIterator>::cast(NewJSObjectFromMap(map));
1966
1967 iterator->set_sync_iterator(*sync_iterator);
1968 return iterator;
1969 }
1970
1961 Handle<JSMap> Factory::NewJSMap() { 1971 Handle<JSMap> Factory::NewJSMap() {
1962 Handle<Map> map(isolate()->native_context()->js_map_map()); 1972 Handle<Map> map(isolate()->native_context()->js_map_map());
1963 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map)); 1973 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map));
1964 JSMap::Initialize(js_map, isolate()); 1974 JSMap::Initialize(js_map, isolate());
1965 return js_map; 1975 return js_map;
1966 } 1976 }
1967 1977
1968 1978
1969 Handle<JSSet> Factory::NewJSSet() { 1979 Handle<JSSet> Factory::NewJSSet() {
1970 Handle<Map> map(isolate()->native_context()->js_set_map()); 1980 Handle<Map> map(isolate()->native_context()->js_set_map());
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
2842 Handle<AccessorInfo> prototype = 2852 Handle<AccessorInfo> prototype =
2843 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); 2853 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs);
2844 Descriptor d = Descriptor::AccessorConstant( 2854 Descriptor d = Descriptor::AccessorConstant(
2845 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); 2855 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs);
2846 map->AppendDescriptor(&d); 2856 map->AppendDescriptor(&d);
2847 } 2857 }
2848 } 2858 }
2849 2859
2850 } // namespace internal 2860 } // namespace internal
2851 } // namespace v8 2861 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698