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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 bool success; | 953 bool success; |
954 LookupIterator it = LookupIterator::PropertyOrElement( | 954 LookupIterator it = LookupIterator::PropertyOrElement( |
955 isolate, o, key, &success, LookupIterator::OWN); | 955 isolate, o, key, &success, LookupIterator::OWN); |
956 if (!success) return isolate->heap()->exception(); | 956 if (!success) return isolate->heap()->exception(); |
957 MAYBE_RETURN( | 957 MAYBE_RETURN( |
958 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 958 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
959 isolate->heap()->exception()); | 959 isolate->heap()->exception()); |
960 return *value; | 960 return *value; |
961 } | 961 } |
962 | 962 |
963 RUNTIME_FUNCTION(Runtime_GetModuleNamespace) { | |
964 HandleScope scope(isolate); | |
965 DCHECK(args.length() == 1); | |
966 CONVERT_SMI_ARG_CHECKED(module_request, 0); | |
967 Handle<Module> module(isolate->context()->module()); | |
968 return *Module::GetModuleNamespace(module, module_request); | |
969 } | |
970 | |
971 RUNTIME_FUNCTION(Runtime_LoadModuleExport) { | |
972 HandleScope scope(isolate); | |
973 DCHECK(args.length() == 1); | |
974 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | |
975 Handle<Module> module(isolate->context()->module()); | |
976 return *Module::LoadExport(module, name); | |
977 } | |
978 | |
979 RUNTIME_FUNCTION(Runtime_LoadModuleImport) { | |
980 HandleScope scope(isolate); | |
981 DCHECK(args.length() == 2); | |
982 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | |
983 CONVERT_SMI_ARG_CHECKED(module_request, 1); | |
984 Handle<Module> module(isolate->context()->module()); | |
985 return *Module::LoadImport(module, name, module_request); | |
986 } | |
987 | |
988 RUNTIME_FUNCTION(Runtime_StoreModuleExport) { | |
989 HandleScope scope(isolate); | |
990 DCHECK(args.length() == 2); | |
991 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | |
992 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | |
993 Handle<Module> module(isolate->context()->module()); | |
994 Module::StoreExport(module, name, value); | |
995 return isolate->heap()->undefined_value(); | |
996 } | |
997 | 963 |
998 } // namespace internal | 964 } // namespace internal |
999 } // namespace v8 | 965 } // namespace v8 |
OLD | NEW |