| 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 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value, | 1974 Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value, |
| 1975 bool done) { | 1975 bool done) { |
| 1976 Handle<Map> map(isolate()->native_context()->iterator_result_map()); | 1976 Handle<Map> map(isolate()->native_context()->iterator_result_map()); |
| 1977 Handle<JSIteratorResult> js_iter_result = | 1977 Handle<JSIteratorResult> js_iter_result = |
| 1978 Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map)); | 1978 Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map)); |
| 1979 js_iter_result->set_value(*value); | 1979 js_iter_result->set_value(*value); |
| 1980 js_iter_result->set_done(*ToBoolean(done)); | 1980 js_iter_result->set_done(*ToBoolean(done)); |
| 1981 return js_iter_result; | 1981 return js_iter_result; |
| 1982 } | 1982 } |
| 1983 | 1983 |
| 1984 Handle<JSAsyncFromSyncIterator> Factory::NewJSAsyncFromSyncIterator( |
| 1985 Handle<HeapObject> sync_iterator) { |
| 1986 Handle<Map> map(isolate()->native_context()->async_from_sync_iterator_map()); |
| 1987 Handle<JSAsyncFromSyncIterator> iterator = |
| 1988 Handle<JSAsyncFromSyncIterator>::cast(NewJSObjectFromMap(map)); |
| 1989 |
| 1990 iterator->set_sync_iterator(*sync_iterator); |
| 1991 return iterator; |
| 1992 } |
| 1993 |
| 1984 Handle<JSMap> Factory::NewJSMap() { | 1994 Handle<JSMap> Factory::NewJSMap() { |
| 1985 Handle<Map> map(isolate()->native_context()->js_map_map()); | 1995 Handle<Map> map(isolate()->native_context()->js_map_map()); |
| 1986 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map)); | 1996 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map)); |
| 1987 JSMap::Initialize(js_map, isolate()); | 1997 JSMap::Initialize(js_map, isolate()); |
| 1988 return js_map; | 1998 return js_map; |
| 1989 } | 1999 } |
| 1990 | 2000 |
| 1991 | 2001 |
| 1992 Handle<JSSet> Factory::NewJSSet() { | 2002 Handle<JSSet> Factory::NewJSSet() { |
| 1993 Handle<Map> map(isolate()->native_context()->js_set_map()); | 2003 Handle<Map> map(isolate()->native_context()->js_set_map()); |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2865 Handle<AccessorInfo> prototype = | 2875 Handle<AccessorInfo> prototype = |
| 2866 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2876 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
| 2867 Descriptor d = Descriptor::AccessorConstant( | 2877 Descriptor d = Descriptor::AccessorConstant( |
| 2868 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); | 2878 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); |
| 2869 map->AppendDescriptor(&d); | 2879 map->AppendDescriptor(&d); |
| 2870 } | 2880 } |
| 2871 } | 2881 } |
| 2872 | 2882 |
| 2873 } // namespace internal | 2883 } // namespace internal |
| 2874 } // namespace v8 | 2884 } // namespace v8 |
| OLD | NEW |