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 "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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 } | 751 } |
752 | 752 |
753 Handle<String> global_name = factory()->InternalizeOneByteString( | 753 Handle<String> global_name = factory()->InternalizeOneByteString( |
754 STATIC_ASCII_VECTOR("global")); | 754 STATIC_ASCII_VECTOR("global")); |
755 global_proxy_function->shared()->set_instance_class_name(*global_name); | 755 global_proxy_function->shared()->set_instance_class_name(*global_name); |
756 global_proxy_function->initial_map()->set_is_access_check_needed(true); | 756 global_proxy_function->initial_map()->set_is_access_check_needed(true); |
757 | 757 |
758 // Set global_proxy.__proto__ to js_global after ConfigureGlobalObjects | 758 // Set global_proxy.__proto__ to js_global after ConfigureGlobalObjects |
759 // Return the global proxy. | 759 // Return the global proxy. |
760 | 760 |
| 761 Handle<JSGlobalProxy> global_proxy; |
761 if (global_object.location() != NULL) { | 762 if (global_object.location() != NULL) { |
762 ASSERT(global_object->IsJSGlobalProxy()); | 763 ASSERT(global_object->IsJSGlobalProxy()); |
763 Handle<JSGlobalProxy> global_proxy = | 764 global_proxy = Handle<JSGlobalProxy>::cast(global_object); |
764 Handle<JSGlobalProxy>::cast(global_object); | |
765 factory()->ReinitializeJSGlobalProxy(global_proxy, global_proxy_function); | 765 factory()->ReinitializeJSGlobalProxy(global_proxy, global_proxy_function); |
766 return global_proxy; | |
767 } else { | 766 } else { |
768 return Handle<JSGlobalProxy>::cast( | 767 global_proxy = Handle<JSGlobalProxy>::cast( |
769 factory()->NewJSObject(global_proxy_function, TENURED)); | 768 factory()->NewJSObject(global_proxy_function, TENURED)); |
| 769 global_proxy->set_hash(heap()->undefined_value()); |
770 } | 770 } |
| 771 return global_proxy; |
771 } | 772 } |
772 | 773 |
773 | 774 |
774 void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global, | 775 void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global, |
775 Handle<JSGlobalProxy> global_proxy) { | 776 Handle<JSGlobalProxy> global_proxy) { |
776 // Set the native context for the global object. | 777 // Set the native context for the global object. |
777 inner_global->set_native_context(*native_context()); | 778 inner_global->set_native_context(*native_context()); |
778 inner_global->set_global_context(*native_context()); | 779 inner_global->set_global_context(*native_context()); |
779 inner_global->set_global_receiver(*global_proxy); | 780 inner_global->set_global_receiver(*global_proxy); |
780 global_proxy->set_native_context(*native_context()); | 781 global_proxy->set_native_context(*native_context()); |
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2682 return from + sizeof(NestingCounterType); | 2683 return from + sizeof(NestingCounterType); |
2683 } | 2684 } |
2684 | 2685 |
2685 | 2686 |
2686 // Called when the top-level V8 mutex is destroyed. | 2687 // Called when the top-level V8 mutex is destroyed. |
2687 void Bootstrapper::FreeThreadResources() { | 2688 void Bootstrapper::FreeThreadResources() { |
2688 ASSERT(!IsActive()); | 2689 ASSERT(!IsActive()); |
2689 } | 2690 } |
2690 | 2691 |
2691 } } // namespace v8::internal | 2692 } } // namespace v8::internal |
OLD | NEW |