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

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

Issue 1478303002: Revert of [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/profiler/heap-snapshot-generator.cc ('k') | src/snapshot/serialize.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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 769
770 // Allocate module context. 770 // Allocate module context.
771 HandleScope scope(isolate); 771 HandleScope scope(isolate);
772 Factory* factory = isolate->factory(); 772 Factory* factory = isolate->factory();
773 Handle<Context> context = factory->NewModuleContext(scope_info); 773 Handle<Context> context = factory->NewModuleContext(scope_info);
774 Handle<JSModule> module = factory->NewJSModule(context, scope_info); 774 Handle<JSModule> module = factory->NewJSModule(context, scope_info);
775 context->set_module(*module); 775 context->set_module(*module);
776 Context* previous = isolate->context(); 776 Context* previous = isolate->context();
777 context->set_previous(previous); 777 context->set_previous(previous);
778 context->set_closure(previous->closure()); 778 context->set_closure(previous->closure());
779 context->set_native_context(previous->native_context()); 779 context->set_global_object(previous->global_object());
780 isolate->set_context(*context); 780 isolate->set_context(*context);
781 781
782 // Find hosting scope and initialize internal variable holding module there. 782 // Find hosting scope and initialize internal variable holding module there.
783 previous->script_context()->set(index, *context); 783 previous->script_context()->set(index, *context);
784 784
785 return *context; 785 return *context;
786 } 786 }
787 787
788 788
789 RUNTIME_FUNCTION(Runtime_DeclareModules) { 789 RUNTIME_FUNCTION(Runtime_DeclareModules) {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 1128
1129 // Lookup in the initial Object.prototype object. 1129 // Lookup in the initial Object.prototype object.
1130 Handle<Object> result; 1130 Handle<Object> result;
1131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1132 isolate, result, 1132 isolate, result,
1133 Object::GetProperty(isolate->initial_object_prototype(), key)); 1133 Object::GetProperty(isolate->initial_object_prototype(), key));
1134 return *result; 1134 return *result;
1135 } 1135 }
1136 } // namespace internal 1136 } // namespace internal
1137 } // namespace v8 1137 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698