| 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/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 for (int i = 0; i < outdated_contexts->length(); ++i) { | 933 for (int i = 0; i < outdated_contexts->length(); ++i) { |
| 934 Context* context = Context::cast(outdated_contexts->get(i)); | 934 Context* context = Context::cast(outdated_contexts->get(i)); |
| 935 // Assert that there is only one native context. | 935 // Assert that there is only one native context. |
| 936 DCHECK(!context->IsNativeContext() || context == *native_context()); | 936 DCHECK(!context->IsNativeContext() || context == *native_context()); |
| 937 DCHECK_EQ(context->global_object(), *global_object_from_snapshot); | 937 DCHECK_EQ(context->global_object(), *global_object_from_snapshot); |
| 938 context->set_global_object(*global_object); | 938 context->set_global_object(*global_object); |
| 939 } | 939 } |
| 940 | 940 |
| 941 static const PropertyAttributes attributes = | 941 static const PropertyAttributes attributes = |
| 942 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 942 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
| 943 JSObject::SetOwnPropertyIgnoreAttributes(builtins_global, | 943 Runtime::DefineObjectProperty(builtins_global, factory()->global_string(), |
| 944 factory()->global_string(), | 944 global_object, attributes).Assert(); |
| 945 global_object, attributes).Assert(); | |
| 946 // Set up the reference from the global object to the builtins object. | 945 // Set up the reference from the global object to the builtins object. |
| 947 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global); | 946 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global); |
| 948 TransferNamedProperties(global_object_from_snapshot, global_object); | 947 TransferNamedProperties(global_object_from_snapshot, global_object); |
| 949 TransferIndexedProperties(global_object_from_snapshot, global_object); | 948 TransferIndexedProperties(global_object_from_snapshot, global_object); |
| 950 } | 949 } |
| 951 | 950 |
| 952 | 951 |
| 953 // This is only called if we are not using snapshots. The equivalent | 952 // This is only called if we are not using snapshots. The equivalent |
| 954 // work in the snapshot case is done in HookUpGlobalObject. | 953 // work in the snapshot case is done in HookUpGlobalObject. |
| 955 void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, | 954 void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, |
| (...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3149 } | 3148 } |
| 3150 | 3149 |
| 3151 | 3150 |
| 3152 // Called when the top-level V8 mutex is destroyed. | 3151 // Called when the top-level V8 mutex is destroyed. |
| 3153 void Bootstrapper::FreeThreadResources() { | 3152 void Bootstrapper::FreeThreadResources() { |
| 3154 DCHECK(!IsActive()); | 3153 DCHECK(!IsActive()); |
| 3155 } | 3154 } |
| 3156 | 3155 |
| 3157 } // namespace internal | 3156 } // namespace internal |
| 3158 } // namespace v8 | 3157 } // namespace v8 |
| OLD | NEW |