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

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

Issue 2314483002: Store the ScopeInfo in WithContexts (Closed)
Patch Set: updates 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
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 <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
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/interpreter/bytecode_expectations/WithStatement.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698