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 Runtime::DefineObjectProperty(builtins_global, factory()->global_string(), | 943 JSObject::SetOwnPropertyIgnoreAttributes(builtins_global, |
944 global_object, attributes).Assert(); | 944 factory()->global_string(), |
| 945 global_object, attributes).Assert(); |
945 // Set up the reference from the global object to the builtins object. | 946 // Set up the reference from the global object to the builtins object. |
946 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global); | 947 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global); |
947 TransferNamedProperties(global_object_from_snapshot, global_object); | 948 TransferNamedProperties(global_object_from_snapshot, global_object); |
948 TransferIndexedProperties(global_object_from_snapshot, global_object); | 949 TransferIndexedProperties(global_object_from_snapshot, global_object); |
949 } | 950 } |
950 | 951 |
951 | 952 |
952 // This is only called if we are not using snapshots. The equivalent | 953 // This is only called if we are not using snapshots. The equivalent |
953 // work in the snapshot case is done in HookUpGlobalObject. | 954 // work in the snapshot case is done in HookUpGlobalObject. |
954 void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, | 955 void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 } | 3149 } |
3149 | 3150 |
3150 | 3151 |
3151 // Called when the top-level V8 mutex is destroyed. | 3152 // Called when the top-level V8 mutex is destroyed. |
3152 void Bootstrapper::FreeThreadResources() { | 3153 void Bootstrapper::FreeThreadResources() { |
3153 DCHECK(!IsActive()); | 3154 DCHECK(!IsActive()); |
3154 } | 3155 } |
3155 | 3156 |
3156 } // namespace internal | 3157 } // namespace internal |
3157 } // namespace v8 | 3158 } // namespace v8 |
OLD | NEW |