Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: src/runtime/runtime-module.cc

Issue 2404243002: [modules] Move runtime functions into new file (runtime-module.cc). (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/runtime/runtime-utils.h"
6
7 #include "src/arguments.h"
8
9 namespace v8 {
10 namespace internal {
11
12 RUNTIME_FUNCTION(Runtime_GetModuleNamespace) {
13 HandleScope scope(isolate);
14 DCHECK(args.length() == 1);
15 CONVERT_SMI_ARG_CHECKED(module_request, 0);
16 Handle<Module> module(isolate->context()->module());
17 return *Module::GetModuleNamespace(module, module_request);
18 }
19
20 RUNTIME_FUNCTION(Runtime_LoadModuleExport) {
21 HandleScope scope(isolate);
22 DCHECK(args.length() == 1);
23 CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
24 Handle<Module> module(isolate->context()->module());
25 return *Module::LoadExport(module, name);
26 }
27
28 RUNTIME_FUNCTION(Runtime_LoadModuleImport) {
29 HandleScope scope(isolate);
30 DCHECK(args.length() == 2);
31 CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
32 CONVERT_SMI_ARG_CHECKED(module_request, 1);
33 Handle<Module> module(isolate->context()->module());
34 return *Module::LoadImport(module, name, module_request);
35 }
36
37 RUNTIME_FUNCTION(Runtime_StoreModuleExport) {
38 HandleScope scope(isolate);
39 DCHECK(args.length() == 2);
40 CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
41 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
42 Handle<Module> module(isolate->context()->module());
43 Module::StoreExport(module, name, value);
44 return isolate->heap()->undefined_value();
45 }
46
47 } // namespace internal
48 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698