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

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

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: Disable module tests for deopt fuzzer. Created 4 years, 3 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') | src/runtime/runtime-scopes.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 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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 bool success; 921 bool success;
922 LookupIterator it = LookupIterator::PropertyOrElement( 922 LookupIterator it = LookupIterator::PropertyOrElement(
923 isolate, o, key, &success, LookupIterator::OWN); 923 isolate, o, key, &success, LookupIterator::OWN);
924 if (!success) return isolate->heap()->exception(); 924 if (!success) return isolate->heap()->exception();
925 MAYBE_RETURN( 925 MAYBE_RETURN(
926 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), 926 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR),
927 isolate->heap()->exception()); 927 isolate->heap()->exception());
928 return *value; 928 return *value;
929 } 929 }
930 930
931 RUNTIME_FUNCTION(Runtime_LoadModuleExport) {
932 HandleScope scope(isolate);
933 DCHECK(args.length() == 1);
934 CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
935 Handle<JSModule> module(isolate->context()->module());
936 return *JSModule::LoadExport(module, name);
937 }
938
939 RUNTIME_FUNCTION(Runtime_StoreModuleExport) {
940 HandleScope scope(isolate);
941 DCHECK(args.length() == 2);
942 CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
943 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
944 Handle<JSModule> module(isolate->context()->module());
945 JSModule::StoreExport(module, name, value);
946 return isolate->heap()->undefined_value();
947 }
948
931 } // namespace internal 949 } // namespace internal
932 } // namespace v8 950 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698