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

Side by Side Diff: src/bootstrapper.cc

Issue 1424703005: Remove JSBuiltinsObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/contexts.h » ('j') | src/objects.h » ('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/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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 return function; 414 return function;
415 } 415 }
416 416
417 417
418 Handle<JSFunction> InstallFunction(Handle<JSObject> target, const char* name, 418 Handle<JSFunction> InstallFunction(Handle<JSObject> target, const char* name,
419 InstanceType type, int instance_size, 419 InstanceType type, int instance_size,
420 MaybeHandle<JSObject> maybe_prototype, 420 MaybeHandle<JSObject> maybe_prototype,
421 Builtins::Name call, 421 Builtins::Name call,
422 bool strict_function_map = false) { 422 bool strict_function_map = false) {
423 Factory* const factory = target->GetIsolate()->factory(); 423 Factory* const factory = target->GetIsolate()->factory();
424 PropertyAttributes attributes; 424 PropertyAttributes attributes = DONT_ENUM;
425 if (target->IsJSBuiltinsObject()) {
426 attributes =
427 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
428 } else {
429 attributes = DONT_ENUM;
430 }
431 return InstallFunction(target, factory->InternalizeUtf8String(name), type, 425 return InstallFunction(target, factory->InternalizeUtf8String(name), type,
432 instance_size, maybe_prototype, call, attributes, 426 instance_size, maybe_prototype, call, attributes,
433 strict_function_map); 427 strict_function_map);
434 } 428 }
435 429
436 } // namespace 430 } // namespace
437 431
438 432
439 void Genesis::SetFunctionInstanceDescriptor(Handle<Map> map, 433 void Genesis::SetFunctionInstanceDescriptor(Handle<Map> map,
440 FunctionMode function_mode) { 434 FunctionMode function_mode) {
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 DCHECK(native_context()->get(Context::GLOBAL_PROXY_INDEX)->IsUndefined() || 1041 DCHECK(native_context()->get(Context::GLOBAL_PROXY_INDEX)->IsUndefined() ||
1048 native_context()->global_proxy() == *global_proxy); 1042 native_context()->global_proxy() == *global_proxy);
1049 native_context()->set_global_proxy(*global_proxy); 1043 native_context()->set_global_proxy(*global_proxy);
1050 } 1044 }
1051 1045
1052 1046
1053 void Genesis::HookUpGlobalObject(Handle<GlobalObject> global_object, 1047 void Genesis::HookUpGlobalObject(Handle<GlobalObject> global_object,
1054 Handle<FixedArray> outdated_contexts) { 1048 Handle<FixedArray> outdated_contexts) {
1055 Handle<GlobalObject> global_object_from_snapshot( 1049 Handle<GlobalObject> global_object_from_snapshot(
1056 GlobalObject::cast(native_context()->extension())); 1050 GlobalObject::cast(native_context()->extension()));
1057 Handle<JSBuiltinsObject> builtins_global(native_context()->builtins());
1058 native_context()->set_extension(*global_object); 1051 native_context()->set_extension(*global_object);
1059 native_context()->set_security_token(*global_object); 1052 native_context()->set_security_token(*global_object);
1060 1053
1061 // Replace outdated global objects in deserialized contexts. 1054 // Replace outdated global objects in deserialized contexts.
1062 for (int i = 0; i < outdated_contexts->length(); ++i) { 1055 for (int i = 0; i < outdated_contexts->length(); ++i) {
1063 Context* context = Context::cast(outdated_contexts->get(i)); 1056 Context* context = Context::cast(outdated_contexts->get(i));
1064 // Assert that there is only one native context. 1057 // Assert that there is only one native context.
1065 DCHECK(!context->IsNativeContext() || context == *native_context()); 1058 DCHECK(!context->IsNativeContext() || context == *native_context());
1066 DCHECK_EQ(context->global_object(), *global_object_from_snapshot); 1059 DCHECK_EQ(context->global_object(), *global_object_from_snapshot);
1067 context->set_global_object(*global_object); 1060 context->set_global_object(*global_object);
1068 } 1061 }
1069 1062
1070 static const PropertyAttributes attributes =
1071 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
1072 JSObject::SetOwnPropertyIgnoreAttributes(builtins_global,
1073 factory()->global_string(),
1074 global_object, attributes).Assert();
1075 // Set up the reference from the global object to the builtins object.
1076 JSGlobalObject::cast(*global_object)->set_builtins(*builtins_global);
1077 TransferNamedProperties(global_object_from_snapshot, global_object); 1063 TransferNamedProperties(global_object_from_snapshot, global_object);
1078 TransferIndexedProperties(global_object_from_snapshot, global_object); 1064 TransferIndexedProperties(global_object_from_snapshot, global_object);
1079 } 1065 }
1080 1066
1081 1067
1082 // This is only called if we are not using snapshots. The equivalent 1068 // This is only called if we are not using snapshots. The equivalent
1083 // work in the snapshot case is done in HookUpGlobalObject. 1069 // work in the snapshot case is done in HookUpGlobalObject.
1084 void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, 1070 void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
1085 Handle<JSFunction> empty_function, 1071 Handle<JSFunction> empty_function,
1086 ContextType context_type) { 1072 ContextType context_type) {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 Handle<String> source_code = 1576 Handle<String> source_code =
1591 isolate->bootstrapper()->SourceLookup<Natives>(index); 1577 isolate->bootstrapper()->SourceLookup<Natives>(index);
1592 1578
1593 // We pass in extras_utils so that builtin code can set it up for later use 1579 // We pass in extras_utils so that builtin code can set it up for later use
1594 // by actual extras code, compiled with CompileExtraBuiltin. 1580 // by actual extras code, compiled with CompileExtraBuiltin.
1595 Handle<Object> global = isolate->global_object(); 1581 Handle<Object> global = isolate->global_object();
1596 Handle<Object> utils = isolate->natives_utils_object(); 1582 Handle<Object> utils = isolate->natives_utils_object();
1597 Handle<Object> extras_utils = isolate->extras_utils_object(); 1583 Handle<Object> extras_utils = isolate->extras_utils_object();
1598 Handle<Object> args[] = {global, utils, extras_utils}; 1584 Handle<Object> args[] = {global, utils, extras_utils};
1599 1585
1600 return Bootstrapper::CompileNative( 1586 return Bootstrapper::CompileNative(isolate, name, source_code,
1601 isolate, name, Handle<JSObject>(isolate->native_context()->builtins()), 1587 arraysize(args), args);
1602 source_code, arraysize(args), args);
1603 } 1588 }
1604 1589
1605 1590
1606 bool Bootstrapper::CompileExperimentalBuiltin(Isolate* isolate, int index) { 1591 bool Bootstrapper::CompileExperimentalBuiltin(Isolate* isolate, int index) {
1607 HandleScope scope(isolate); 1592 HandleScope scope(isolate);
1608 Vector<const char> name = ExperimentalNatives::GetScriptName(index); 1593 Vector<const char> name = ExperimentalNatives::GetScriptName(index);
1609 Handle<String> source_code = 1594 Handle<String> source_code =
1610 isolate->bootstrapper()->SourceLookup<ExperimentalNatives>(index); 1595 isolate->bootstrapper()->SourceLookup<ExperimentalNatives>(index);
1611 Handle<Object> global = isolate->global_object(); 1596 Handle<Object> global = isolate->global_object();
1612 Handle<Object> utils = isolate->natives_utils_object(); 1597 Handle<Object> utils = isolate->natives_utils_object();
1613 Handle<Object> args[] = {global, utils}; 1598 Handle<Object> args[] = {global, utils};
1614 return Bootstrapper::CompileNative( 1599 return Bootstrapper::CompileNative(isolate, name, source_code,
1615 isolate, name, Handle<JSObject>(isolate->native_context()->builtins()), 1600 arraysize(args), args);
1616 source_code, arraysize(args), args);
1617 } 1601 }
1618 1602
1619 1603
1620 bool Bootstrapper::CompileExtraBuiltin(Isolate* isolate, int index) { 1604 bool Bootstrapper::CompileExtraBuiltin(Isolate* isolate, int index) {
1621 HandleScope scope(isolate); 1605 HandleScope scope(isolate);
1622 Vector<const char> name = ExtraNatives::GetScriptName(index); 1606 Vector<const char> name = ExtraNatives::GetScriptName(index);
1623 Handle<String> source_code = 1607 Handle<String> source_code =
1624 isolate->bootstrapper()->SourceLookup<ExtraNatives>(index); 1608 isolate->bootstrapper()->SourceLookup<ExtraNatives>(index);
1625 Handle<Object> global = isolate->global_object(); 1609 Handle<Object> global = isolate->global_object();
1626 Handle<Object> binding = isolate->extras_binding_object(); 1610 Handle<Object> binding = isolate->extras_binding_object();
1627 Handle<Object> extras_utils = isolate->extras_utils_object(); 1611 Handle<Object> extras_utils = isolate->extras_utils_object();
1628 Handle<Object> args[] = {global, binding, extras_utils}; 1612 Handle<Object> args[] = {global, binding, extras_utils};
1629 return Bootstrapper::CompileNative( 1613 return Bootstrapper::CompileNative(isolate, name, source_code,
1630 isolate, name, Handle<JSObject>(isolate->native_context()->builtins()), 1614 arraysize(args), args);
1631 source_code, arraysize(args), args);
1632 } 1615 }
1633 1616
1634 1617
1635 bool Bootstrapper::CompileExperimentalExtraBuiltin(Isolate* isolate, 1618 bool Bootstrapper::CompileExperimentalExtraBuiltin(Isolate* isolate,
1636 int index) { 1619 int index) {
1637 HandleScope scope(isolate); 1620 HandleScope scope(isolate);
1638 Vector<const char> name = ExperimentalExtraNatives::GetScriptName(index); 1621 Vector<const char> name = ExperimentalExtraNatives::GetScriptName(index);
1639 Handle<String> source_code = 1622 Handle<String> source_code =
1640 isolate->bootstrapper()->SourceLookup<ExperimentalExtraNatives>(index); 1623 isolate->bootstrapper()->SourceLookup<ExperimentalExtraNatives>(index);
1641 Handle<Object> global = isolate->global_object(); 1624 Handle<Object> global = isolate->global_object();
1642 Handle<Object> binding = isolate->extras_binding_object(); 1625 Handle<Object> binding = isolate->extras_binding_object();
1643 Handle<Object> extras_utils = isolate->extras_utils_object(); 1626 Handle<Object> extras_utils = isolate->extras_utils_object();
1644 Handle<Object> args[] = {global, binding, extras_utils}; 1627 Handle<Object> args[] = {global, binding, extras_utils};
1645 return Bootstrapper::CompileNative( 1628 return Bootstrapper::CompileNative(isolate, name, source_code,
1646 isolate, name, Handle<JSObject>(isolate->native_context()->builtins()), 1629 arraysize(args), args);
1647 source_code, arraysize(args), args);
1648 } 1630 }
1649 1631
1650 1632
1651 bool Bootstrapper::CompileCodeStubBuiltin(Isolate* isolate, int index) { 1633 bool Bootstrapper::CompileCodeStubBuiltin(Isolate* isolate, int index) {
1652 HandleScope scope(isolate); 1634 HandleScope scope(isolate);
1653 Vector<const char> name = CodeStubNatives::GetScriptName(index); 1635 Vector<const char> name = CodeStubNatives::GetScriptName(index);
1654 Handle<String> source_code = 1636 Handle<String> source_code =
1655 isolate->bootstrapper()->SourceLookup<CodeStubNatives>(index); 1637 isolate->bootstrapper()->SourceLookup<CodeStubNatives>(index);
1656 Handle<JSObject> global(isolate->global_object()); 1638 Handle<JSObject> global(isolate->global_object());
1657 Handle<JSObject> exports(isolate->heap()->code_stub_exports_object()); 1639 Handle<JSObject> exports(isolate->heap()->code_stub_exports_object());
1658 Handle<Object> args[] = {global, exports}; 1640 Handle<Object> args[] = {global, exports};
1659 bool result = 1641 bool result =
1660 CompileNative(isolate, name, global, source_code, arraysize(args), args); 1642 CompileNative(isolate, name, source_code, arraysize(args), args);
1661 return result; 1643 return result;
1662 } 1644 }
1663 1645
1664 1646
1665 bool Bootstrapper::CompileNative(Isolate* isolate, Vector<const char> name, 1647 bool Bootstrapper::CompileNative(Isolate* isolate, Vector<const char> name,
1666 Handle<JSObject> receiver,
1667 Handle<String> source, int argc, 1648 Handle<String> source, int argc,
1668 Handle<Object> argv[]) { 1649 Handle<Object> argv[]) {
1669 SuppressDebug compiling_natives(isolate->debug()); 1650 SuppressDebug compiling_natives(isolate->debug());
1670 // During genesis, the boilerplate for stack overflow won't work until the 1651 // During genesis, the boilerplate for stack overflow won't work until the
1671 // environment has been at least partially initialized. Add a stack check 1652 // environment has been at least partially initialized. Add a stack check
1672 // before entering JS code to catch overflow early. 1653 // before entering JS code to catch overflow early.
1673 StackLimitCheck check(isolate); 1654 StackLimitCheck check(isolate);
1674 if (check.JsHasOverflowed(1 * KB)) { 1655 if (check.JsHasOverflowed(1 * KB)) {
1675 isolate->StackOverflow(); 1656 isolate->StackOverflow();
1676 return false; 1657 return false;
1677 } 1658 }
1678 1659
1679 Handle<Context> context(isolate->context()); 1660 Handle<Context> context(isolate->context());
1680 1661
1681 Handle<String> script_name = 1662 Handle<String> script_name =
1682 isolate->factory()->NewStringFromUtf8(name).ToHandleChecked(); 1663 isolate->factory()->NewStringFromUtf8(name).ToHandleChecked();
1683 Handle<SharedFunctionInfo> function_info = Compiler::CompileScript( 1664 Handle<SharedFunctionInfo> function_info = Compiler::CompileScript(
1684 source, script_name, 0, 0, ScriptOriginOptions(), Handle<Object>(), 1665 source, script_name, 0, 0, ScriptOriginOptions(), Handle<Object>(),
1685 context, NULL, NULL, ScriptCompiler::kNoCompileOptions, NATIVES_CODE, 1666 context, NULL, NULL, ScriptCompiler::kNoCompileOptions, NATIVES_CODE,
1686 false); 1667 false);
1687 if (function_info.is_null()) return false; 1668 if (function_info.is_null()) return false;
1688 1669
1689 DCHECK(context->IsNativeContext()); 1670 DCHECK(context->IsNativeContext());
1690 1671
1691 Handle<Context> runtime_context(context->runtime_context()); 1672 Handle<Context> runtime_context(context->runtime_context());
1692 Handle<JSFunction> fun = 1673 Handle<JSFunction> fun =
1693 isolate->factory()->NewFunctionFromSharedFunctionInfo(function_info, 1674 isolate->factory()->NewFunctionFromSharedFunctionInfo(function_info,
1694 runtime_context); 1675 runtime_context);
1676 Handle<Object> receiver = isolate->factory()->undefined_value();
1695 1677
1696 // For non-extension scripts, run script to get the function wrapper. 1678 // For non-extension scripts, run script to get the function wrapper.
1697 Handle<Object> wrapper; 1679 Handle<Object> wrapper;
1698 if (!Execution::Call(isolate, fun, receiver, 0, NULL).ToHandle(&wrapper)) { 1680 if (!Execution::Call(isolate, fun, receiver, 0, NULL).ToHandle(&wrapper)) {
1699 return false; 1681 return false;
1700 } 1682 }
1701 // Then run the function wrapper. 1683 // Then run the function wrapper.
1702 return !Execution::Call(isolate, Handle<JSFunction>::cast(wrapper), receiver, 1684 return !Execution::Call(isolate, Handle<JSFunction>::cast(wrapper), receiver,
1703 argc, argv).is_null(); 1685 argc, argv).is_null();
1704 } 1686 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 Handle<JSObject> global = isolate()->global_object(); 1855 Handle<JSObject> global = isolate()->global_object();
1874 JSObject::AddProperty(global, natives_key, utils, DONT_ENUM); 1856 JSObject::AddProperty(global, natives_key, utils, DONT_ENUM);
1875 break; 1857 break;
1876 } 1858 }
1877 case THIN_CONTEXT: 1859 case THIN_CONTEXT:
1878 break; 1860 break;
1879 } 1861 }
1880 1862
1881 // The utils object can be removed for cases that reach this point. 1863 // The utils object can be removed for cases that reach this point.
1882 native_context()->set_natives_utils_object(heap()->undefined_value()); 1864 native_context()->set_natives_utils_object(heap()->undefined_value());
1865
1866 #ifdef DEBUG
1867 GlobalObject* dummy = native_context()->runtime_context()->global_object();
1868 DCHECK_EQ(0, dummy->elements()->length());
1869 DCHECK_EQ(0, GlobalDictionary::cast(dummy->properties())->NumberOfElements());
1870 #endif
1883 } 1871 }
1884 1872
1885 1873
1886 void Bootstrapper::ExportFromRuntime(Isolate* isolate, 1874 void Bootstrapper::ExportFromRuntime(Isolate* isolate,
1887 Handle<JSObject> container) { 1875 Handle<JSObject> container) {
1888 Factory* factory = isolate->factory(); 1876 Factory* factory = isolate->factory();
1889 HandleScope scope(isolate); 1877 HandleScope scope(isolate);
1890 Handle<Context> native_context = isolate->native_context(); 1878 Handle<Context> native_context = isolate->native_context();
1891 #define EXPORT_PRIVATE_SYMBOL(NAME) \ 1879 #define EXPORT_PRIVATE_SYMBOL(NAME) \
1892 Handle<String> NAME##_name = factory->NewStringFromAsciiChecked(#NAME); \ 1880 Handle<String> NAME##_name = factory->NewStringFromAsciiChecked(#NAME); \
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 initial_map->AppendDescriptor(&d); 2283 initial_map->AppendDescriptor(&d);
2296 } 2284 }
2297 2285
2298 return array_function; 2286 return array_function;
2299 } 2287 }
2300 2288
2301 2289
2302 bool Genesis::InstallNatives(ContextType context_type) { 2290 bool Genesis::InstallNatives(ContextType context_type) {
2303 HandleScope scope(isolate()); 2291 HandleScope scope(isolate());
2304 2292
2305 // Create a function for the builtins object. Allocate space for the
2306 // JavaScript builtins, a reference to the builtins object
2307 // (itself) and a reference to the native_context directly in the object.
2308 Handle<Code> code = Handle<Code>(
2309 isolate()->builtins()->builtin(Builtins::kIllegal));
2310 Handle<JSFunction> builtins_fun = factory()->NewFunction(
2311 factory()->empty_string(), code, JS_BUILTINS_OBJECT_TYPE,
2312 JSBuiltinsObject::kSize);
2313
2314 Handle<String> name =
2315 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("builtins"));
2316 builtins_fun->shared()->set_instance_class_name(*name);
2317 builtins_fun->initial_map()->set_dictionary_map(true);
2318 builtins_fun->initial_map()->set_prototype(heap()->null_value());
2319
2320 // Allocate the builtins object.
2321 Handle<JSBuiltinsObject> builtins =
2322 Handle<JSBuiltinsObject>::cast(factory()->NewGlobalObject(builtins_fun));
2323 builtins->set_builtins(*builtins);
2324 builtins->set_native_context(*native_context());
2325 builtins->set_global_proxy(native_context()->global_proxy());
2326
2327 // Set up the reference from the global object to the builtins object.
2328 JSGlobalObject::cast(native_context()->global_object())->
2329 set_builtins(*builtins);
2330
2331 // Create a bridge function that has context in the native context. 2293 // Create a bridge function that has context in the native context.
2332 Handle<JSFunction> bridge = factory()->NewFunction(factory()->empty_string()); 2294 Handle<JSFunction> bridge = factory()->NewFunction(factory()->empty_string());
2333 DCHECK(bridge->context() == *isolate()->native_context()); 2295 DCHECK(bridge->context() == *isolate()->native_context());
2334 2296
2335 // Allocate the builtins context. 2297 // Allocate the runtime context.
2336 Handle<Context> context = 2298 {
2337 factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge); 2299 Handle<Context> context =
2338 context->set_global_object(*builtins); // override builtins global object 2300 factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge);
2339 2301 native_context()->set_runtime_context(*context);
2340 native_context()->set_runtime_context(*context); 2302 Handle<Code> code = isolate()->builtins()->Illegal();
2303 Handle<JSFunction> global_fun =
2304 factory()->NewFunction(factory()->empty_string(), code,
2305 JS_GLOBAL_OBJECT_TYPE, JSGlobalObject::kSize);
2306 global_fun->initial_map()->set_dictionary_map(true);
2307 global_fun->initial_map()->set_prototype(heap()->null_value());
2308 Handle<JSGlobalObject> dummy_global =
2309 Handle<JSGlobalObject>::cast(factory()->NewGlobalObject(global_fun));
Toon Verwaest 2015/11/02 10:08:48 Ugh. I guess it breaks all over the place if there
Yang 2015/11/02 10:47:38 Yes... even though we do not access it, we expect
2310 dummy_global->set_native_context(*native_context());
2311 dummy_global->set_global_proxy(native_context()->global_proxy());
2312 context->set_global_object(*dummy_global);
2313 // Something went wrong if we actually need to write into the dummy global.
2314 dummy_global->set_properties(*GlobalDictionary::New(isolate(), 0));
2315 dummy_global->set_elements(heap()->empty_fixed_array());
2316 }
2341 2317
2342 // Set up the utils object as shared container between native scripts. 2318 // Set up the utils object as shared container between native scripts.
2343 Handle<JSObject> utils = factory()->NewJSObject(isolate()->object_function()); 2319 Handle<JSObject> utils = factory()->NewJSObject(isolate()->object_function());
2344 JSObject::NormalizeProperties(utils, CLEAR_INOBJECT_PROPERTIES, 16, 2320 JSObject::NormalizeProperties(utils, CLEAR_INOBJECT_PROPERTIES, 16,
2345 "utils container for native scripts"); 2321 "utils container for native scripts");
2346 native_context()->set_natives_utils_object(*utils); 2322 native_context()->set_natives_utils_object(*utils);
2347 2323
2348 // Set up the extras utils object as a shared container between native 2324 // Set up the extras utils object as a shared container between native
2349 // scripts and extras. (Extras consume things added there by native scripts.) 2325 // scripts and extras. (Extras consume things added there by native scripts.)
2350 Handle<JSObject> extras_utils = 2326 Handle<JSObject> extras_utils =
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 } 2571 }
2596 { 2572 {
2597 AccessorConstantDescriptor d(factory()->iterator_symbol(), 2573 AccessorConstantDescriptor d(factory()->iterator_symbol(),
2598 arguments_iterator, attribs); 2574 arguments_iterator, attribs);
2599 Handle<Map> map(native_context()->strict_arguments_map()); 2575 Handle<Map> map(native_context()->strict_arguments_map());
2600 Map::EnsureDescriptorSlack(map, 1); 2576 Map::EnsureDescriptorSlack(map, 1);
2601 map->AppendDescriptor(&d); 2577 map->AppendDescriptor(&d);
2602 } 2578 }
2603 } 2579 }
2604 2580
2605 #ifdef VERIFY_HEAP
2606 if (FLAG_verify_heap) {
2607 builtins->ObjectVerify();
2608 }
2609 #endif
2610
2611 return true; 2581 return true;
2612 } 2582 }
2613 2583
2614 2584
2615 bool Genesis::InstallExperimentalNatives() { 2585 bool Genesis::InstallExperimentalNatives() {
2616 static const char* harmony_array_includes_natives[] = { 2586 static const char* harmony_array_includes_natives[] = {
2617 "native harmony-array-includes.js", nullptr}; 2587 "native harmony-array-includes.js", nullptr};
2618 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr}; 2588 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr};
2619 static const char* harmony_modules_natives[] = {nullptr}; 2589 static const char* harmony_modules_natives[] = {nullptr};
2620 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js", 2590 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 reinterpret_cast<void*>(object_fun->initial_map()), 3204 reinterpret_cast<void*>(object_fun->initial_map()),
3235 object_fun->shared()->unique_id()); 3205 object_fun->shared()->unique_id());
3236 Map::TraceAllTransitions(object_fun->initial_map()); 3206 Map::TraceAllTransitions(object_fun->initial_map());
3237 } 3207 }
3238 #endif 3208 #endif
3239 Handle<GlobalObject> global_object = 3209 Handle<GlobalObject> global_object =
3240 CreateNewGlobals(global_proxy_template, global_proxy); 3210 CreateNewGlobals(global_proxy_template, global_proxy);
3241 3211
3242 HookUpGlobalProxy(global_object, global_proxy); 3212 HookUpGlobalProxy(global_object, global_proxy);
3243 HookUpGlobalObject(global_object, outdated_contexts); 3213 HookUpGlobalObject(global_object, outdated_contexts);
3244 native_context()->builtins()->set_global_proxy(
3245 native_context()->global_proxy());
3246 HookUpGlobalThisBinding(outdated_contexts); 3214 HookUpGlobalThisBinding(outdated_contexts);
3247 3215
3248 if (!ConfigureGlobalObjects(global_proxy_template)) return; 3216 if (!ConfigureGlobalObjects(global_proxy_template)) return;
3249 } else { 3217 } else {
3250 // We get here if there was no context snapshot. 3218 // We get here if there was no context snapshot.
3251 CreateRoots(); 3219 CreateRoots();
3252 Handle<JSFunction> empty_function = CreateEmptyFunction(isolate); 3220 Handle<JSFunction> empty_function = CreateEmptyFunction(isolate);
3253 CreateStrictModeFunctionMaps(empty_function); 3221 CreateStrictModeFunctionMaps(empty_function);
3254 CreateStrongModeFunctionMaps(empty_function); 3222 CreateStrongModeFunctionMaps(empty_function);
3255 CreateIteratorMaps(); 3223 CreateIteratorMaps();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
3327 } 3295 }
3328 3296
3329 3297
3330 // Called when the top-level V8 mutex is destroyed. 3298 // Called when the top-level V8 mutex is destroyed.
3331 void Bootstrapper::FreeThreadResources() { 3299 void Bootstrapper::FreeThreadResources() {
3332 DCHECK(!IsActive()); 3300 DCHECK(!IsActive());
3333 } 3301 }
3334 3302
3335 } // namespace internal 3303 } // namespace internal
3336 } // namespace v8 3304 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.h ('k') | src/contexts.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698