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

Side by Side Diff: src/bootstrapper.cc

Issue 1404943002: Use import/export for more functions (instead of js builtins object). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/debug/mirrors.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/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 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 builtins_fun->initial_map()->set_dictionary_map(true); 2034 builtins_fun->initial_map()->set_dictionary_map(true);
2035 builtins_fun->initial_map()->set_prototype(heap()->null_value()); 2035 builtins_fun->initial_map()->set_prototype(heap()->null_value());
2036 2036
2037 // Allocate the builtins object. 2037 // Allocate the builtins object.
2038 Handle<JSBuiltinsObject> builtins = 2038 Handle<JSBuiltinsObject> builtins =
2039 Handle<JSBuiltinsObject>::cast(factory()->NewGlobalObject(builtins_fun)); 2039 Handle<JSBuiltinsObject>::cast(factory()->NewGlobalObject(builtins_fun));
2040 builtins->set_builtins(*builtins); 2040 builtins->set_builtins(*builtins);
2041 builtins->set_native_context(*native_context()); 2041 builtins->set_native_context(*native_context());
2042 builtins->set_global_proxy(native_context()->global_proxy()); 2042 builtins->set_global_proxy(native_context()->global_proxy());
2043 2043
2044
2045 // Set up the 'builtin' property, which refers to the js builtins object.
2046 static const PropertyAttributes attributes =
2047 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
2048 Handle<String> builtins_string =
2049 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("builtins"));
2050 JSObject::AddProperty(builtins, builtins_string, builtins, attributes);
2051
2052 // Set up the reference from the global object to the builtins object. 2044 // Set up the reference from the global object to the builtins object.
2053 JSGlobalObject::cast(native_context()->global_object())-> 2045 JSGlobalObject::cast(native_context()->global_object())->
2054 set_builtins(*builtins); 2046 set_builtins(*builtins);
2055 2047
2056 // Create a bridge function that has context in the native context. 2048 // Create a bridge function that has context in the native context.
2057 Handle<JSFunction> bridge = factory()->NewFunction(factory()->empty_string()); 2049 Handle<JSFunction> bridge = factory()->NewFunction(factory()->empty_string());
2058 DCHECK(bridge->context() == *isolate()->native_context()); 2050 DCHECK(bridge->context() == *isolate()->native_context());
2059 2051
2060 // Allocate the builtins context. 2052 // Allocate the builtins context.
2061 Handle<Context> context = 2053 Handle<Context> context =
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
3304 } 3296 }
3305 3297
3306 3298
3307 // Called when the top-level V8 mutex is destroyed. 3299 // Called when the top-level V8 mutex is destroyed.
3308 void Bootstrapper::FreeThreadResources() { 3300 void Bootstrapper::FreeThreadResources() {
3309 DCHECK(!IsActive()); 3301 DCHECK(!IsActive());
3310 } 3302 }
3311 3303
3312 } // namespace internal 3304 } // namespace internal
3313 } // namespace v8 3305 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/debug/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698