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

Side by Side Diff: src/bootstrapper.cc

Issue 1072083002: [es6] don't "replace" Object.prototype.toString for --harmony-tostring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Final fixup... Created 5 years, 8 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/harmony-tostring.js » ('j') | no next file with comments »
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 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 1682
1683 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ 1683 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
1684 void Genesis::InitializeGlobal_##id() {} 1684 void Genesis::InitializeGlobal_##id() {}
1685 1685
1686 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) 1686 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules)
1687 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrays) 1687 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrays)
1688 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes) 1688 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes)
1689 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes) 1689 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes)
1690 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals) 1690 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals)
1691 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions) 1691 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions)
1692 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring)
1693 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies) 1692 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies)
1694 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) 1693 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
1695 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) 1694 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode)
1696 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) 1695 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names)
1697 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) 1696 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
1698 1697
1699 void Genesis::InitializeGlobal_harmony_regexps() { 1698 void Genesis::InitializeGlobal_harmony_regexps() {
1700 Handle<JSObject> builtins(native_context()->builtins()); 1699 Handle<JSObject> builtins(native_context()->builtins());
1701 1700
1702 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() 1701 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value()
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 Handle<JSGlobalObject> global(JSGlobalObject::cast( 1752 Handle<JSGlobalObject> global(JSGlobalObject::cast(
1754 native_context()->global_object())); 1753 native_context()->global_object()));
1755 Handle<String> reflect_string = 1754 Handle<String> reflect_string =
1756 factory()->NewStringFromStaticChars("Reflect"); 1755 factory()->NewStringFromStaticChars("Reflect");
1757 Handle<Object> reflect = 1756 Handle<Object> reflect =
1758 factory()->NewJSObject(isolate()->object_function(), TENURED); 1757 factory()->NewJSObject(isolate()->object_function(), TENURED);
1759 JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM); 1758 JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM);
1760 } 1759 }
1761 1760
1762 1761
1762 void Genesis::InitializeGlobal_harmony_tostring() {
1763 Handle<JSObject> builtins(native_context()->builtins());
1764
1765 Handle<HeapObject> flag(FLAG_harmony_tostring ? heap()->true_value()
1766 : heap()->false_value());
1767 Runtime::SetObjectProperty(isolate(), builtins,
1768 factory()->harmony_tostring_string(), flag,
1769 STRICT).Assert();
1770 }
1771
1772
1763 Handle<JSFunction> Genesis::InstallInternalArray( 1773 Handle<JSFunction> Genesis::InstallInternalArray(
1764 Handle<JSBuiltinsObject> builtins, 1774 Handle<JSBuiltinsObject> builtins,
1765 const char* name, 1775 const char* name,
1766 ElementsKind elements_kind) { 1776 ElementsKind elements_kind) {
1767 // --- I n t e r n a l A r r a y --- 1777 // --- I n t e r n a l A r r a y ---
1768 // An array constructor on the builtins object that works like 1778 // An array constructor on the builtins object that works like
1769 // the public Array constructor, except that its prototype 1779 // the public Array constructor, except that its prototype
1770 // doesn't inherit from Object.prototype. 1780 // doesn't inherit from Object.prototype.
1771 // To be used only for internal work by builtins. Instances 1781 // To be used only for internal work by builtins. Instances
1772 // must not be leaked to user code. 1782 // must not be leaked to user code.
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 return from + sizeof(NestingCounterType); 2974 return from + sizeof(NestingCounterType);
2965 } 2975 }
2966 2976
2967 2977
2968 // Called when the top-level V8 mutex is destroyed. 2978 // Called when the top-level V8 mutex is destroyed.
2969 void Bootstrapper::FreeThreadResources() { 2979 void Bootstrapper::FreeThreadResources() {
2970 DCHECK(!IsActive()); 2980 DCHECK(!IsActive());
2971 } 2981 }
2972 2982
2973 } } // namespace v8::internal 2983 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/harmony-tostring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698