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

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

Issue 2661933003: [ESnext] Parse dynamic import expression (Closed)
Patch Set: fix Created 3 years, 10 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 | « src/runtime/runtime.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 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 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
11 11
12 RUNTIME_FUNCTION(Runtime_DynamicImportCall) {
13 HandleScope scope(isolate);
14 DCHECK_EQ(1, args.length());
15 // TODO(gsathya): Implement ImportCall.
16 return isolate->heap()->undefined_value();
17 }
18
12 RUNTIME_FUNCTION(Runtime_GetModuleNamespace) { 19 RUNTIME_FUNCTION(Runtime_GetModuleNamespace) {
13 HandleScope scope(isolate); 20 HandleScope scope(isolate);
14 DCHECK_EQ(1, args.length()); 21 DCHECK_EQ(1, args.length());
15 CONVERT_SMI_ARG_CHECKED(module_request, 0); 22 CONVERT_SMI_ARG_CHECKED(module_request, 0);
16 Handle<Module> module(isolate->context()->module()); 23 Handle<Module> module(isolate->context()->module());
17 return *Module::GetModuleNamespace(module, module_request); 24 return *Module::GetModuleNamespace(module, module_request);
18 } 25 }
19 26
20 RUNTIME_FUNCTION(Runtime_LoadModuleVariable) { 27 RUNTIME_FUNCTION(Runtime_LoadModuleVariable) {
21 HandleScope scope(isolate); 28 HandleScope scope(isolate);
22 DCHECK_EQ(1, args.length()); 29 DCHECK_EQ(1, args.length());
23 CONVERT_SMI_ARG_CHECKED(index, 0); 30 CONVERT_SMI_ARG_CHECKED(index, 0);
24 Handle<Module> module(isolate->context()->module()); 31 Handle<Module> module(isolate->context()->module());
25 return *Module::LoadVariable(module, index); 32 return *Module::LoadVariable(module, index);
26 } 33 }
27 34
28 RUNTIME_FUNCTION(Runtime_StoreModuleVariable) { 35 RUNTIME_FUNCTION(Runtime_StoreModuleVariable) {
29 HandleScope scope(isolate); 36 HandleScope scope(isolate);
30 DCHECK_EQ(2, args.length()); 37 DCHECK_EQ(2, args.length());
31 CONVERT_SMI_ARG_CHECKED(index, 0); 38 CONVERT_SMI_ARG_CHECKED(index, 0);
32 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); 39 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
33 Handle<Module> module(isolate->context()->module()); 40 Handle<Module> module(isolate->context()->module());
34 Module::StoreVariable(module, index, value); 41 Module::StoreVariable(module, index, value);
35 return isolate->heap()->undefined_value(); 42 return isolate->heap()->undefined_value();
36 } 43 }
37 44
38 } // namespace internal 45 } // namespace internal
39 } // namespace v8 46 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698