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

Side by Side Diff: src/bootstrapper.cc

Issue 1316943002: Move (uppercase) JS builtins from js builtins object to native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove Isolate::js_builtins_object Created 5 years, 3 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 | « src/bootstrapper.h ('k') | src/builtins.h » ('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/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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 { // Initialize a result array for rempio2 calculation 1745 { // Initialize a result array for rempio2 calculation
1746 const size_t num_elements = 2; 1746 const size_t num_elements = 2;
1747 double* data = 1747 double* data =
1748 SetBuiltinTypedArray<double>(isolate(), builtins, kExternalFloat64Array, 1748 SetBuiltinTypedArray<double>(isolate(), builtins, kExternalFloat64Array,
1749 NULL, num_elements, "rempio2result"); 1749 NULL, num_elements, "rempio2result");
1750 for (size_t i = 0; i < num_elements; i++) data[i] = 0; 1750 for (size_t i = 0; i < num_elements; i++) data[i] = 0;
1751 } 1751 }
1752 } 1752 }
1753 1753
1754 1754
1755 bool Bootstrapper::InstallJSBuiltins(Isolate* isolate,
1756 Handle<JSObject> container) {
1757 HandleScope scope(isolate);
1758 Handle<JSBuiltinsObject> builtins = isolate->js_builtins_object();
1759 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
1760 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
1761 Handle<Object> function_object =
1762 Object::GetProperty(isolate, container, Builtins::GetName(id))
1763 .ToHandleChecked();
1764 DCHECK(function_object->IsJSFunction());
1765 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
1766 builtins->set_javascript_builtin(id, *function);
1767 }
1768 return true;
1769 }
1770
1771
1772 void Bootstrapper::ExportPrivateSymbols(Isolate* isolate, 1755 void Bootstrapper::ExportPrivateSymbols(Isolate* isolate,
1773 Handle<JSObject> container) { 1756 Handle<JSObject> container) {
1774 HandleScope scope(isolate); 1757 HandleScope scope(isolate);
1775 #define EXPORT_PRIVATE_SYMBOL(NAME) \ 1758 #define EXPORT_PRIVATE_SYMBOL(NAME) \
1776 Handle<String> NAME##_name = \ 1759 Handle<String> NAME##_name = \
1777 isolate->factory()->NewStringFromAsciiChecked(#NAME); \ 1760 isolate->factory()->NewStringFromAsciiChecked(#NAME); \
1778 JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \ 1761 JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \
1779 NONE); 1762 NONE);
1780 1763
1781 PRIVATE_SYMBOL_LIST(EXPORT_PRIVATE_SYMBOL) 1764 PRIVATE_SYMBOL_LIST(EXPORT_PRIVATE_SYMBOL)
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
3181 } 3164 }
3182 3165
3183 3166
3184 // Called when the top-level V8 mutex is destroyed. 3167 // Called when the top-level V8 mutex is destroyed.
3185 void Bootstrapper::FreeThreadResources() { 3168 void Bootstrapper::FreeThreadResources() {
3186 DCHECK(!IsActive()); 3169 DCHECK(!IsActive());
3187 } 3170 }
3188 3171
3189 } // namespace internal 3172 } // namespace internal
3190 } // namespace v8 3173 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.h ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698