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

Side by Side Diff: src/bootstrapper.cc

Issue 254433002: Store JSGlobalProxy's identity hash directly on the proxy itself (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged to trunk, removed Object.observe workaround Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/factory.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 "bootstrapper.h" 5 #include "bootstrapper.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "isolate-inl.h" 8 #include "isolate-inl.h"
9 #include "natives.h" 9 #include "natives.h"
10 #include "snapshot.h" 10 #include "snapshot.h"
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 } 762 }
763 763
764 Handle<String> global_name = factory()->InternalizeOneByteString( 764 Handle<String> global_name = factory()->InternalizeOneByteString(
765 STATIC_ASCII_VECTOR("global")); 765 STATIC_ASCII_VECTOR("global"));
766 global_proxy_function->shared()->set_instance_class_name(*global_name); 766 global_proxy_function->shared()->set_instance_class_name(*global_name);
767 global_proxy_function->initial_map()->set_is_access_check_needed(true); 767 global_proxy_function->initial_map()->set_is_access_check_needed(true);
768 768
769 // Set global_proxy.__proto__ to js_global after ConfigureGlobalObjects 769 // Set global_proxy.__proto__ to js_global after ConfigureGlobalObjects
770 // Return the global proxy. 770 // Return the global proxy.
771 771
772 Handle<JSGlobalProxy> global_proxy;
772 if (global_object.location() != NULL) { 773 if (global_object.location() != NULL) {
773 ASSERT(global_object->IsJSGlobalProxy()); 774 ASSERT(global_object->IsJSGlobalProxy());
774 Handle<JSGlobalProxy> global_proxy = 775 global_proxy = Handle<JSGlobalProxy>::cast(global_object);
775 Handle<JSGlobalProxy>::cast(global_object);
776 factory()->ReinitializeJSGlobalProxy(global_proxy, global_proxy_function); 776 factory()->ReinitializeJSGlobalProxy(global_proxy, global_proxy_function);
777 return global_proxy;
778 } else { 777 } else {
779 return Handle<JSGlobalProxy>::cast( 778 global_proxy = Handle<JSGlobalProxy>::cast(
780 factory()->NewJSObject(global_proxy_function, TENURED)); 779 factory()->NewJSObject(global_proxy_function, TENURED));
780 global_proxy->set_hash(heap()->undefined_value());
781 } 781 }
782 return global_proxy;
782 } 783 }
783 784
784 785
785 void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global, 786 void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global,
786 Handle<JSGlobalProxy> global_proxy) { 787 Handle<JSGlobalProxy> global_proxy) {
787 // Set the native context for the global object. 788 // Set the native context for the global object.
788 inner_global->set_native_context(*native_context()); 789 inner_global->set_native_context(*native_context());
789 inner_global->set_global_context(*native_context()); 790 inner_global->set_global_context(*native_context());
790 inner_global->set_global_receiver(*global_proxy); 791 inner_global->set_global_receiver(*global_proxy);
791 global_proxy->set_native_context(*native_context()); 792 global_proxy->set_native_context(*native_context());
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 return from + sizeof(NestingCounterType); 2698 return from + sizeof(NestingCounterType);
2698 } 2699 }
2699 2700
2700 2701
2701 // Called when the top-level V8 mutex is destroyed. 2702 // Called when the top-level V8 mutex is destroyed.
2702 void Bootstrapper::FreeThreadResources() { 2703 void Bootstrapper::FreeThreadResources() {
2703 ASSERT(!IsActive()); 2704 ASSERT(!IsActive());
2704 } 2705 }
2705 2706
2706 } } // namespace v8::internal 2707 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698