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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 } | 961 } |
962 | 962 |
963 RUNTIME_FUNCTION(Runtime_LoadModuleExport) { | 963 RUNTIME_FUNCTION(Runtime_LoadModuleExport) { |
964 HandleScope scope(isolate); | 964 HandleScope scope(isolate); |
965 DCHECK(args.length() == 1); | 965 DCHECK(args.length() == 1); |
966 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 966 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
967 Handle<Module> module(isolate->context()->module()); | 967 Handle<Module> module(isolate->context()->module()); |
968 return *Module::LoadExport(module, name); | 968 return *Module::LoadExport(module, name); |
969 } | 969 } |
970 | 970 |
| 971 RUNTIME_FUNCTION(Runtime_LoadModuleImport) { |
| 972 HandleScope scope(isolate); |
| 973 DCHECK(args.length() == 2); |
| 974 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 975 CONVERT_ARG_HANDLE_CHECKED(Smi, module_request, 1); |
| 976 Handle<Module> module(isolate->context()->module()); |
| 977 return *Module::LoadImport(module, name, module_request->value()); |
| 978 } |
| 979 |
971 RUNTIME_FUNCTION(Runtime_StoreModuleExport) { | 980 RUNTIME_FUNCTION(Runtime_StoreModuleExport) { |
972 HandleScope scope(isolate); | 981 HandleScope scope(isolate); |
973 DCHECK(args.length() == 2); | 982 DCHECK(args.length() == 2); |
974 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 983 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
975 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 984 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
976 Handle<Module> module(isolate->context()->module()); | 985 Handle<Module> module(isolate->context()->module()); |
977 Module::StoreExport(module, name, value); | 986 Module::StoreExport(module, name, value); |
978 return isolate->heap()->undefined_value(); | 987 return isolate->heap()->undefined_value(); |
979 } | 988 } |
980 | 989 |
981 } // namespace internal | 990 } // namespace internal |
982 } // namespace v8 | 991 } // namespace v8 |
OLD | NEW |