| 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 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 array->set_elements(*elms); | 1846 array->set_elements(*elms); |
| 1847 array->set_length(Smi::FromInt(length)); | 1847 array->set_length(Smi::FromInt(length)); |
| 1848 } | 1848 } |
| 1849 | 1849 |
| 1850 Handle<JSModuleNamespace> Factory::NewJSModuleNamespace() { | 1850 Handle<JSModuleNamespace> Factory::NewJSModuleNamespace() { |
| 1851 Handle<Map> map = isolate()->js_module_namespace_map(); | 1851 Handle<Map> map = isolate()->js_module_namespace_map(); |
| 1852 Handle<JSModuleNamespace> module_namespace( | 1852 Handle<JSModuleNamespace> module_namespace( |
| 1853 Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map))); | 1853 Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map))); |
| 1854 FieldIndex index = FieldIndex::ForDescriptor( | 1854 FieldIndex index = FieldIndex::ForDescriptor( |
| 1855 *map, JSModuleNamespace::kToStringTagFieldIndex); | 1855 *map, JSModuleNamespace::kToStringTagFieldIndex); |
| 1856 Handle<String> to_string_value = NewStringFromAsciiChecked("Module"); | 1856 module_namespace->FastPropertyAtPut(index, |
| 1857 module_namespace->FastPropertyAtPut(index, *to_string_value); | 1857 isolate()->heap()->Module_string()); |
| 1858 return module_namespace; | 1858 return module_namespace; |
| 1859 } | 1859 } |
| 1860 | 1860 |
| 1861 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( | 1861 Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
| 1862 Handle<JSFunction> function) { | 1862 Handle<JSFunction> function) { |
| 1863 DCHECK(IsResumableFunction(function->shared()->kind())); | 1863 DCHECK(IsResumableFunction(function->shared()->kind())); |
| 1864 JSFunction::EnsureHasInitialMap(function); | 1864 JSFunction::EnsureHasInitialMap(function); |
| 1865 Handle<Map> map(function->initial_map()); | 1865 Handle<Map> map(function->initial_map()); |
| 1866 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); | 1866 DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); |
| 1867 CALL_HEAP_FUNCTION( | 1867 CALL_HEAP_FUNCTION( |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2803 Handle<AccessorInfo> prototype = | 2803 Handle<AccessorInfo> prototype = |
| 2804 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2804 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
| 2805 Descriptor d = Descriptor::AccessorConstant( | 2805 Descriptor d = Descriptor::AccessorConstant( |
| 2806 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); | 2806 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); |
| 2807 map->AppendDescriptor(&d); | 2807 map->AppendDescriptor(&d); |
| 2808 } | 2808 } |
| 2809 } | 2809 } |
| 2810 | 2810 |
| 2811 } // namespace internal | 2811 } // namespace internal |
| 2812 } // namespace v8 | 2812 } // namespace v8 |
| OLD | NEW |