| OLD | NEW |
| 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 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1968 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value, | 1968 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value, |
| 1969 bool done) { | 1969 bool done) { |
| 1970 Handle<Map> map(isolate()->native_context()->iterator_result_map()); | 1970 Handle<Map> map(isolate()->native_context()->iterator_result_map()); |
| 1971 Handle<JSIteratorResult> js_iter_result = | 1971 Handle<JSIteratorResult> js_iter_result = |
| 1972 Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map)); | 1972 Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map)); |
| 1973 js_iter_result->set_value(*value); | 1973 js_iter_result->set_value(*value); |
| 1974 js_iter_result->set_done(*ToBoolean(done)); | 1974 js_iter_result->set_done(*ToBoolean(done)); |
| 1975 return js_iter_result; | 1975 return js_iter_result; |
| 1976 } | 1976 } |
| 1977 | 1977 |
| 1978 Handle<JSAsyncFromSyncIterator> Factory::NewJSAsyncFromSyncIterator( |
| 1979 Handle<JSReceiver> sync_iterator) { |
| 1980 Handle<Map> map(isolate()->native_context()->async_from_sync_iterator_map()); |
| 1981 Handle<JSAsyncFromSyncIterator> iterator = |
| 1982 Handle<JSAsyncFromSyncIterator>::cast(NewJSObjectFromMap(map)); |
| 1983 |
| 1984 iterator->set_sync_iterator(*sync_iterator); |
| 1985 return iterator; |
| 1986 } |
| 1987 |
| 1978 Handle<JSMap> Factory::NewJSMap() { | 1988 Handle<JSMap> Factory::NewJSMap() { |
| 1979 Handle<Map> map(isolate()->native_context()->js_map_map()); | 1989 Handle<Map> map(isolate()->native_context()->js_map_map()); |
| 1980 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map)); | 1990 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map)); |
| 1981 JSMap::Initialize(js_map, isolate()); | 1991 JSMap::Initialize(js_map, isolate()); |
| 1982 return js_map; | 1992 return js_map; |
| 1983 } | 1993 } |
| 1984 | 1994 |
| 1985 | 1995 |
| 1986 Handle<JSSet> Factory::NewJSSet() { | 1996 Handle<JSSet> Factory::NewJSSet() { |
| 1987 Handle<Map> map(isolate()->native_context()->js_set_map()); | 1997 Handle<Map> map(isolate()->native_context()->js_set_map()); |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 Handle<AccessorInfo> prototype = | 2866 Handle<AccessorInfo> prototype = |
| 2857 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2867 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
| 2858 Descriptor d = Descriptor::AccessorConstant( | 2868 Descriptor d = Descriptor::AccessorConstant( |
| 2859 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); | 2869 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); |
| 2860 map->AppendDescriptor(&d); | 2870 map->AppendDescriptor(&d); |
| 2861 } | 2871 } |
| 2862 } | 2872 } |
| 2863 | 2873 |
| 2864 } // namespace internal | 2874 } // namespace internal |
| 2865 } // namespace v8 | 2875 } // namespace v8 |
| OLD | NEW |