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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, extension_object, 0); | 692 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, extension_object, 0); |
693 CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 1); | 693 CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 1); |
694 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2); | 694 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2); |
695 Handle<Context> current(isolate->context()); | 695 Handle<Context> current(isolate->context()); |
696 Handle<Context> context = isolate->factory()->NewWithContext( | 696 Handle<Context> context = isolate->factory()->NewWithContext( |
697 function, current, scope_info, extension_object); | 697 function, current, scope_info, extension_object); |
698 isolate->set_context(*context); | 698 isolate->set_context(*context); |
699 return *context; | 699 return *context; |
700 } | 700 } |
701 | 701 |
702 RUNTIME_FUNCTION(Runtime_PushModuleContext) { | |
703 HandleScope scope(isolate); | |
704 DCHECK_EQ(3, args.length()); | |
705 CONVERT_ARG_HANDLE_CHECKED(JSModule, module, 0); | |
706 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 1); | |
707 CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 2); | |
708 DCHECK(function->context() == isolate->context()); | |
709 | |
710 Handle<Context> context = | |
711 isolate->factory()->NewModuleContext(module, function, scope_info); | |
712 isolate->set_context(*context); | |
713 return *context; | |
714 } | |
715 | 702 |
716 RUNTIME_FUNCTION(Runtime_PushCatchContext) { | 703 RUNTIME_FUNCTION(Runtime_PushCatchContext) { |
717 HandleScope scope(isolate); | 704 HandleScope scope(isolate); |
718 DCHECK_EQ(4, args.length()); | 705 DCHECK_EQ(4, args.length()); |
719 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 706 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
720 CONVERT_ARG_HANDLE_CHECKED(Object, thrown_object, 1); | 707 CONVERT_ARG_HANDLE_CHECKED(Object, thrown_object, 1); |
721 CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 2); | 708 CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 2); |
722 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 3); | 709 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 3); |
723 Handle<Context> current(isolate->context()); | 710 Handle<Context> current(isolate->context()); |
724 Handle<Context> context = isolate->factory()->NewCatchContext( | 711 Handle<Context> context = isolate->factory()->NewCatchContext( |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 932 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { |
946 HandleScope scope(isolate); | 933 HandleScope scope(isolate); |
947 DCHECK_EQ(2, args.length()); | 934 DCHECK_EQ(2, args.length()); |
948 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 935 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
949 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 936 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
950 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 937 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); |
951 } | 938 } |
952 | 939 |
953 } // namespace internal | 940 } // namespace internal |
954 } // namespace v8 | 941 } // namespace v8 |
OLD | NEW |