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