| 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 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 : empty_fixed_array(); | 1923 : empty_fixed_array(); |
| 1924 | 1924 |
| 1925 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); | 1925 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); |
| 1926 module->set_code(*code); | 1926 module->set_code(*code); |
| 1927 module->set_exports(*exports); | 1927 module->set_exports(*exports); |
| 1928 module->set_regular_exports(*regular_exports); | 1928 module->set_regular_exports(*regular_exports); |
| 1929 module->set_regular_imports(*regular_imports); | 1929 module->set_regular_imports(*regular_imports); |
| 1930 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); | 1930 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); |
| 1931 module->set_module_namespace(isolate()->heap()->undefined_value()); | 1931 module->set_module_namespace(isolate()->heap()->undefined_value()); |
| 1932 module->set_requested_modules(*requested_modules); | 1932 module->set_requested_modules(*requested_modules); |
| 1933 module->set_script(code->script()); |
| 1934 if (code->script()->IsScript()) { |
| 1935 Script::cast(code->script())->set_module(*module); |
| 1936 } |
| 1933 DCHECK(!module->instantiated()); | 1937 DCHECK(!module->instantiated()); |
| 1934 DCHECK(!module->evaluated()); | 1938 DCHECK(!module->evaluated()); |
| 1935 return module; | 1939 return module; |
| 1936 } | 1940 } |
| 1937 | 1941 |
| 1938 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, | 1942 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, |
| 1939 PretenureFlag pretenure) { | 1943 PretenureFlag pretenure) { |
| 1940 Handle<JSFunction> array_buffer_fun( | 1944 Handle<JSFunction> array_buffer_fun( |
| 1941 shared == SharedFlag::kShared | 1945 shared == SharedFlag::kShared |
| 1942 ? isolate()->native_context()->shared_array_buffer_fun() | 1946 ? isolate()->native_context()->shared_array_buffer_fun() |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2850 Handle<AccessorInfo> prototype = | 2854 Handle<AccessorInfo> prototype = |
| 2851 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2855 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
| 2852 Descriptor d = Descriptor::AccessorConstant( | 2856 Descriptor d = Descriptor::AccessorConstant( |
| 2853 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); | 2857 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); |
| 2854 map->AppendDescriptor(&d); | 2858 map->AppendDescriptor(&d); |
| 2855 } | 2859 } |
| 2856 } | 2860 } |
| 2857 | 2861 |
| 2858 } // namespace internal | 2862 } // namespace internal |
| 2859 } // namespace v8 | 2863 } // namespace v8 |
| OLD | NEW |