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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 Handle<FixedArray> outdated_contexts) { | 888 Handle<FixedArray> outdated_contexts) { |
889 Handle<GlobalObject> global_object_from_snapshot( | 889 Handle<GlobalObject> global_object_from_snapshot( |
890 GlobalObject::cast(native_context()->extension())); | 890 GlobalObject::cast(native_context()->extension())); |
891 Handle<JSBuiltinsObject> builtins_global(native_context()->builtins()); | 891 Handle<JSBuiltinsObject> builtins_global(native_context()->builtins()); |
892 native_context()->set_extension(*global_object); | 892 native_context()->set_extension(*global_object); |
893 native_context()->set_security_token(*global_object); | 893 native_context()->set_security_token(*global_object); |
894 | 894 |
895 // Replace outdated global objects in deserialized contexts. | 895 // Replace outdated global objects in deserialized contexts. |
896 for (int i = 0; i < outdated_contexts->length(); ++i) { | 896 for (int i = 0; i < outdated_contexts->length(); ++i) { |
897 Context* context = Context::cast(outdated_contexts->get(i)); | 897 Context* context = Context::cast(outdated_contexts->get(i)); |
| 898 // Assert that there is only one native context. |
| 899 DCHECK(!context->IsNativeContext() || context == *native_context()); |
898 DCHECK_EQ(context->global_object(), *global_object_from_snapshot); | 900 DCHECK_EQ(context->global_object(), *global_object_from_snapshot); |
899 context->set_global_object(*global_object); | 901 context->set_global_object(*global_object); |
900 } | 902 } |
901 | 903 |
902 static const PropertyAttributes attributes = | 904 static const PropertyAttributes attributes = |
903 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 905 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
904 Runtime::DefineObjectProperty(builtins_global, factory()->global_string(), | 906 Runtime::DefineObjectProperty(builtins_global, factory()->global_string(), |
905 global_object, attributes).Assert(); | 907 global_object, attributes).Assert(); |
906 // Set up the reference from the global object to the builtins object. | 908 // Set up the reference from the global object to the builtins object. |
907 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global); | 909 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global); |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 return from + sizeof(NestingCounterType); | 2962 return from + sizeof(NestingCounterType); |
2961 } | 2963 } |
2962 | 2964 |
2963 | 2965 |
2964 // Called when the top-level V8 mutex is destroyed. | 2966 // Called when the top-level V8 mutex is destroyed. |
2965 void Bootstrapper::FreeThreadResources() { | 2967 void Bootstrapper::FreeThreadResources() { |
2966 DCHECK(!IsActive()); | 2968 DCHECK(!IsActive()); |
2967 } | 2969 } |
2968 | 2970 |
2969 } } // namespace v8::internal | 2971 } } // namespace v8::internal |
OLD | NEW |