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

Side by Side Diff: src/bootstrapper.cc

Issue 988513003: Switch the order of experimental global initialization and running natives. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 9 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
« no previous file with comments | « no previous file | src/regexp.js » ('j') | src/regexp.js » ('J')
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 "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 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) 1699 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
1700 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) 1700 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode)
1701 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) 1701 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names)
1702 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) 1702 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
1703 1703
1704 void Genesis::InitializeGlobal_harmony_regexps() { 1704 void Genesis::InitializeGlobal_harmony_regexps() {
1705 Handle<JSObject> builtins(native_context()->builtins()); 1705 Handle<JSObject> builtins(native_context()->builtins());
1706 1706
1707 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() 1707 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value()
1708 : heap()->false_value()); 1708 : heap()->false_value());
1709 PropertyAttributes attributes = 1709 Runtime::SetObjectProperty(isolate(), builtins,
1710 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); 1710 factory()->harmony_regexps_string(), flag,
1711 Runtime::DefineObjectProperty(builtins, factory()->harmony_regexps_string(), 1711 STRICT).Assert();
1712 flag, attributes).Assert();
1713 } 1712 }
1714 1713
1715 1714
1716 void Genesis::InitializeGlobal_harmony_unicode_regexps() { 1715 void Genesis::InitializeGlobal_harmony_unicode_regexps() {
1717 Handle<JSObject> builtins(native_context()->builtins()); 1716 Handle<JSObject> builtins(native_context()->builtins());
1718 1717
1719 Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value() 1718 Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value()
1720 : heap()->false_value()); 1719 : heap()->false_value());
1721 PropertyAttributes attributes = 1720 Runtime::SetObjectProperty(isolate(), builtins,
1722 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); 1721 factory()->harmony_unicode_regexps_string(), flag,
1723 Runtime::DefineObjectProperty(builtins, 1722 STRICT).Assert();
1724 factory()->harmony_unicode_regexps_string(),
1725 flag, attributes).Assert();
1726 } 1723 }
1727 1724
1728 1725
1729 Handle<JSFunction> Genesis::InstallInternalArray( 1726 Handle<JSFunction> Genesis::InstallInternalArray(
1730 Handle<JSBuiltinsObject> builtins, 1727 Handle<JSBuiltinsObject> builtins,
1731 const char* name, 1728 const char* name,
1732 ElementsKind elements_kind) { 1729 ElementsKind elements_kind) {
1733 // --- I n t e r n a l A r r a y --- 1730 // --- I n t e r n a l A r r a y ---
1734 // An array constructor on the builtins object that works like 1731 // An array constructor on the builtins object that works like
1735 // the public Array constructor, except that its prototype 1732 // the public Array constructor, except that its prototype
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2883 2880
2884 MakeFunctionInstancePrototypeWritable(); 2881 MakeFunctionInstancePrototypeWritable();
2885 2882
2886 if (!ConfigureGlobalObjects(global_proxy_template)) return; 2883 if (!ConfigureGlobalObjects(global_proxy_template)) return;
2887 isolate->counters()->contexts_created_from_scratch()->Increment(); 2884 isolate->counters()->contexts_created_from_scratch()->Increment();
2888 } 2885 }
2889 2886
2890 // Install experimental natives. Do not include them into the snapshot as we 2887 // Install experimental natives. Do not include them into the snapshot as we
2891 // should be able to turn them off at runtime. Re-installing them after 2888 // should be able to turn them off at runtime. Re-installing them after
2892 // they have already been deserialized would also fail. 2889 // they have already been deserialized would also fail.
2893 if (!isolate->serializer_enabled() && !InstallExperimentalNatives()) return; 2890 if (!isolate->serializer_enabled()) {
2894 2891 InitializeExperimentalGlobal();
2895 InitializeExperimentalGlobal(); 2892 if (!InstallExperimentalNatives()) return;
2893 }
2896 2894
2897 // The serializer cannot serialize typed arrays. Reset those typed arrays 2895 // The serializer cannot serialize typed arrays. Reset those typed arrays
2898 // for each new context. 2896 // for each new context.
2899 InitializeBuiltinTypedArrays(); 2897 InitializeBuiltinTypedArrays();
2900 2898
2901 result_ = native_context(); 2899 result_ = native_context();
2902 } 2900 }
2903 2901
2904 2902
2905 // Support for thread preemption. 2903 // Support for thread preemption.
(...skipping 18 matching lines...) Expand all
2924 return from + sizeof(NestingCounterType); 2922 return from + sizeof(NestingCounterType);
2925 } 2923 }
2926 2924
2927 2925
2928 // Called when the top-level V8 mutex is destroyed. 2926 // Called when the top-level V8 mutex is destroyed.
2929 void Bootstrapper::FreeThreadResources() { 2927 void Bootstrapper::FreeThreadResources() {
2930 DCHECK(!IsActive()); 2928 DCHECK(!IsActive());
2931 } 2929 }
2932 2930
2933 } } // namespace v8::internal 2931 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/regexp.js » ('j') | src/regexp.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698