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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 681 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
682 | 682 |
683 DCHECK(function->context() == isolate->context()); | 683 DCHECK(function->context() == isolate->context()); |
684 int length = function->shared()->scope_info()->ContextLength(); | 684 int length = function->shared()->scope_info()->ContextLength(); |
685 return *isolate->factory()->NewFunctionContext(length, function); | 685 return *isolate->factory()->NewFunctionContext(length, function); |
686 } | 686 } |
687 | 687 |
688 | 688 |
689 RUNTIME_FUNCTION(Runtime_PushWithContext) { | 689 RUNTIME_FUNCTION(Runtime_PushWithContext) { |
690 HandleScope scope(isolate); | 690 HandleScope scope(isolate); |
691 DCHECK_EQ(2, args.length()); | 691 DCHECK_EQ(3, 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(ScopeInfo, scope_info, 1); |
| 694 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2); |
694 Handle<Context> current(isolate->context()); | 695 Handle<Context> current(isolate->context()); |
695 Handle<Context> context = | 696 Handle<Context> context = isolate->factory()->NewWithContext( |
696 isolate->factory()->NewWithContext(function, current, extension_object); | 697 function, current, scope_info, extension_object); |
697 isolate->set_context(*context); | 698 isolate->set_context(*context); |
698 return *context; | 699 return *context; |
699 } | 700 } |
700 | 701 |
701 | 702 |
702 RUNTIME_FUNCTION(Runtime_PushCatchContext) { | 703 RUNTIME_FUNCTION(Runtime_PushCatchContext) { |
703 HandleScope scope(isolate); | 704 HandleScope scope(isolate); |
704 DCHECK_EQ(4, args.length()); | 705 DCHECK_EQ(4, args.length()); |
705 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 706 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
706 CONVERT_ARG_HANDLE_CHECKED(Object, thrown_object, 1); | 707 CONVERT_ARG_HANDLE_CHECKED(Object, thrown_object, 1); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 932 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { |
932 HandleScope scope(isolate); | 933 HandleScope scope(isolate); |
933 DCHECK_EQ(2, args.length()); | 934 DCHECK_EQ(2, args.length()); |
934 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 935 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
935 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 936 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
936 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 937 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); |
937 } | 938 } |
938 | 939 |
939 } // namespace internal | 940 } // namespace internal |
940 } // namespace v8 | 941 } // namespace v8 |
OLD | NEW |