OLD | NEW |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Creates some basic objects. Used for creating a context from scratch. | 133 // Creates some basic objects. Used for creating a context from scratch. |
134 void CreateRoots(); | 134 void CreateRoots(); |
135 // Creates the empty function. Used for creating a context from scratch. | 135 // Creates the empty function. Used for creating a context from scratch. |
136 Handle<JSFunction> CreateEmptyFunction(Isolate* isolate); | 136 Handle<JSFunction> CreateEmptyFunction(Isolate* isolate); |
137 // Creates the ThrowTypeError function. ECMA 5th Ed. 13.2.3 | 137 // Creates the ThrowTypeError function. ECMA 5th Ed. 13.2.3 |
138 Handle<JSFunction> GetStrictPoisonFunction(); | 138 Handle<JSFunction> GetStrictPoisonFunction(); |
139 // Poison for sloppy generator function arguments/callee. | 139 // Poison for sloppy generator function arguments/callee. |
140 Handle<JSFunction> GetGeneratorPoisonFunction(); | 140 Handle<JSFunction> GetGeneratorPoisonFunction(); |
141 | 141 |
142 void CreateStrictModeFunctionMaps(Handle<JSFunction> empty); | 142 void CreateStrictModeFunctionMaps(Handle<JSFunction> empty); |
| 143 void CreateStrongModeFunctionMaps(Handle<JSFunction> empty); |
143 | 144 |
144 // Make the "arguments" and "caller" properties throw a TypeError on access. | 145 // Make the "arguments" and "caller" properties throw a TypeError on access. |
145 void PoisonArgumentsAndCaller(Handle<Map> map); | 146 void PoisonArgumentsAndCaller(Handle<Map> map); |
146 | 147 |
147 // Creates the global objects using the global proxy and the template passed | 148 // Creates the global objects using the global proxy and the template passed |
148 // in through the API. We call this regardless of whether we are building a | 149 // in through the API. We call this regardless of whether we are building a |
149 // context from scratch or using a deserialized one from the partial snapshot | 150 // context from scratch or using a deserialized one from the partial snapshot |
150 // but in the latter case we don't use the objects it produces directly, as | 151 // but in the latter case we don't use the objects it produces directly, as |
151 // we have to used the deserialized ones that are linked together with the | 152 // we have to used the deserialized ones that are linked together with the |
152 // rest of the context snapshot. | 153 // rest of the context snapshot. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // Without prototype. | 250 // Without prototype. |
250 FUNCTION_WITHOUT_PROTOTYPE, | 251 FUNCTION_WITHOUT_PROTOTYPE, |
251 BOUND_FUNCTION | 252 BOUND_FUNCTION |
252 }; | 253 }; |
253 | 254 |
254 static bool IsFunctionModeWithPrototype(FunctionMode function_mode) { | 255 static bool IsFunctionModeWithPrototype(FunctionMode function_mode) { |
255 return (function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || | 256 return (function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || |
256 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE); | 257 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE); |
257 } | 258 } |
258 | 259 |
259 Handle<Map> CreateFunctionMap(FunctionMode function_mode); | 260 Handle<Map> CreateSloppyFunctionMap(FunctionMode function_mode); |
260 | 261 |
261 void SetFunctionInstanceDescriptor(Handle<Map> map, | 262 void SetFunctionInstanceDescriptor(Handle<Map> map, |
262 FunctionMode function_mode); | 263 FunctionMode function_mode); |
263 void MakeFunctionInstancePrototypeWritable(); | 264 void MakeFunctionInstancePrototypeWritable(); |
264 | 265 |
265 Handle<Map> CreateStrictFunctionMap( | 266 Handle<Map> CreateStrictFunctionMap(FunctionMode function_mode, |
266 FunctionMode function_mode, | 267 Handle<JSFunction> empty_function); |
267 Handle<JSFunction> empty_function); | 268 Handle<Map> CreateStrongFunctionMap(Handle<JSFunction> empty_function, |
| 269 bool is_constructor); |
| 270 |
268 | 271 |
269 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, | 272 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, |
270 FunctionMode function_mode); | 273 FunctionMode function_mode); |
| 274 void SetStrongFunctionInstanceDescriptor(Handle<Map> map); |
271 | 275 |
272 static bool CompileBuiltin(Isolate* isolate, int index); | 276 static bool CompileBuiltin(Isolate* isolate, int index); |
273 static bool CompileExperimentalBuiltin(Isolate* isolate, int index); | 277 static bool CompileExperimentalBuiltin(Isolate* isolate, int index); |
274 static bool CompileNative(Isolate* isolate, | 278 static bool CompileNative(Isolate* isolate, |
275 Vector<const char> name, | 279 Vector<const char> name, |
276 Handle<String> source); | 280 Handle<String> source); |
277 static bool CompileScriptCached(Isolate* isolate, | 281 static bool CompileScriptCached(Isolate* isolate, |
278 Vector<const char> name, | 282 Vector<const char> name, |
279 Handle<String> source, | 283 Handle<String> source, |
280 SourceCodeCache* cache, | 284 SourceCodeCache* cache, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 419 } |
416 Handle<AccessorInfo> prototype = | 420 Handle<AccessorInfo> prototype = |
417 Accessors::FunctionPrototypeInfo(isolate(), attribs); | 421 Accessors::FunctionPrototypeInfo(isolate(), attribs); |
418 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 422 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
419 prototype, attribs); | 423 prototype, attribs); |
420 map->AppendDescriptor(&d); | 424 map->AppendDescriptor(&d); |
421 } | 425 } |
422 } | 426 } |
423 | 427 |
424 | 428 |
425 Handle<Map> Genesis::CreateFunctionMap(FunctionMode function_mode) { | 429 Handle<Map> Genesis::CreateSloppyFunctionMap(FunctionMode function_mode) { |
426 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); | 430 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); |
427 SetFunctionInstanceDescriptor(map, function_mode); | 431 SetFunctionInstanceDescriptor(map, function_mode); |
428 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode)); | 432 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode)); |
429 return map; | 433 return map; |
430 } | 434 } |
431 | 435 |
432 | 436 |
433 Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) { | 437 Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) { |
434 // Allocate the map for function instances. Maps are allocated first and their | 438 // Allocate the map for function instances. Maps are allocated first and their |
435 // prototypes patched later, once empty function is created. | 439 // prototypes patched later, once empty function is created. |
436 | 440 |
437 // Functions with this map will not have a 'prototype' property, and | 441 // Functions with this map will not have a 'prototype' property, and |
438 // can not be used as constructors. | 442 // can not be used as constructors. |
439 Handle<Map> function_without_prototype_map = | 443 Handle<Map> function_without_prototype_map = |
440 CreateFunctionMap(FUNCTION_WITHOUT_PROTOTYPE); | 444 CreateSloppyFunctionMap(FUNCTION_WITHOUT_PROTOTYPE); |
441 native_context()->set_sloppy_function_without_prototype_map( | 445 native_context()->set_sloppy_function_without_prototype_map( |
442 *function_without_prototype_map); | 446 *function_without_prototype_map); |
443 | 447 |
444 // Allocate the function map. This map is temporary, used only for processing | 448 // Allocate the function map. This map is temporary, used only for processing |
445 // of builtins. | 449 // of builtins. |
446 // Later the map is replaced with writable prototype map, allocated below. | 450 // Later the map is replaced with writable prototype map, allocated below. |
447 Handle<Map> function_map = | 451 Handle<Map> function_map = |
448 CreateFunctionMap(FUNCTION_WITH_READONLY_PROTOTYPE); | 452 CreateSloppyFunctionMap(FUNCTION_WITH_READONLY_PROTOTYPE); |
449 native_context()->set_sloppy_function_map(*function_map); | 453 native_context()->set_sloppy_function_map(*function_map); |
450 native_context()->set_sloppy_function_with_readonly_prototype_map( | 454 native_context()->set_sloppy_function_with_readonly_prototype_map( |
451 *function_map); | 455 *function_map); |
452 | 456 |
453 // The final map for functions. Writeable prototype. | 457 // The final map for functions. Writeable prototype. |
454 // This map is installed in MakeFunctionInstancePrototypeWritable. | 458 // This map is installed in MakeFunctionInstancePrototypeWritable. |
455 sloppy_function_map_writable_prototype_ = | 459 sloppy_function_map_writable_prototype_ = |
456 CreateFunctionMap(FUNCTION_WITH_WRITEABLE_PROTOTYPE); | 460 CreateSloppyFunctionMap(FUNCTION_WITH_WRITEABLE_PROTOTYPE); |
457 | 461 |
458 Factory* factory = isolate->factory(); | 462 Factory* factory = isolate->factory(); |
459 | 463 |
460 Handle<String> object_name = factory->Object_string(); | 464 Handle<String> object_name = factory->Object_string(); |
461 | 465 |
462 Handle<JSObject> object_function_prototype; | 466 Handle<JSObject> object_function_prototype; |
463 | 467 |
464 { // --- O b j e c t --- | 468 { // --- O b j e c t --- |
465 Handle<JSFunction> object_fun = factory->NewFunction(object_name); | 469 Handle<JSFunction> object_fun = factory->NewFunction(object_name); |
466 int unused = JSObject::kInitialGlobalObjectUnusedPropertiesCount; | 470 int unused = JSObject::kInitialGlobalObjectUnusedPropertiesCount; |
(...skipping 27 matching lines...) Expand all Loading... |
494 // Allocate the empty function as the prototype for function ECMAScript | 498 // Allocate the empty function as the prototype for function ECMAScript |
495 // 262 15.3.4. | 499 // 262 15.3.4. |
496 Handle<String> empty_string = | 500 Handle<String> empty_string = |
497 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("Empty")); | 501 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("Empty")); |
498 Handle<Code> code(isolate->builtins()->builtin(Builtins::kEmptyFunction)); | 502 Handle<Code> code(isolate->builtins()->builtin(Builtins::kEmptyFunction)); |
499 Handle<JSFunction> empty_function = factory->NewFunctionWithoutPrototype( | 503 Handle<JSFunction> empty_function = factory->NewFunctionWithoutPrototype( |
500 empty_string, code); | 504 empty_string, code); |
501 | 505 |
502 // Allocate the function map first and then patch the prototype later | 506 // Allocate the function map first and then patch the prototype later |
503 Handle<Map> empty_function_map = | 507 Handle<Map> empty_function_map = |
504 CreateFunctionMap(FUNCTION_WITHOUT_PROTOTYPE); | 508 CreateSloppyFunctionMap(FUNCTION_WITHOUT_PROTOTYPE); |
505 DCHECK(!empty_function_map->is_dictionary_map()); | 509 DCHECK(!empty_function_map->is_dictionary_map()); |
506 empty_function_map->SetPrototype(object_function_prototype); | 510 empty_function_map->SetPrototype(object_function_prototype); |
507 empty_function_map->set_is_prototype_map(true); | 511 empty_function_map->set_is_prototype_map(true); |
508 empty_function->set_map(*empty_function_map); | 512 empty_function->set_map(*empty_function_map); |
509 | 513 |
510 // --- E m p t y --- | 514 // --- E m p t y --- |
511 Handle<String> source = factory->NewStringFromStaticChars("() {}"); | 515 Handle<String> source = factory->NewStringFromStaticChars("() {}"); |
512 Handle<Script> script = factory->NewScript(source); | 516 Handle<Script> script = factory->NewScript(source); |
513 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 517 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
514 empty_function->shared()->set_script(*script); | 518 empty_function->shared()->set_script(*script); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 : ro_attribs; | 580 : ro_attribs; |
577 Handle<AccessorInfo> prototype = | 581 Handle<AccessorInfo> prototype = |
578 Accessors::FunctionPrototypeInfo(isolate(), attribs); | 582 Accessors::FunctionPrototypeInfo(isolate(), attribs); |
579 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 583 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
580 prototype, attribs); | 584 prototype, attribs); |
581 map->AppendDescriptor(&d); | 585 map->AppendDescriptor(&d); |
582 } | 586 } |
583 } | 587 } |
584 | 588 |
585 | 589 |
| 590 void Genesis::SetStrongFunctionInstanceDescriptor(Handle<Map> map) { |
| 591 Map::EnsureDescriptorSlack(map, 2); |
| 592 |
| 593 PropertyAttributes ro_attribs = |
| 594 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 595 |
| 596 Handle<AccessorInfo> length = |
| 597 Accessors::FunctionLengthInfo(isolate(), ro_attribs); |
| 598 { // Add length. |
| 599 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), |
| 600 length, ro_attribs); |
| 601 map->AppendDescriptor(&d); |
| 602 } |
| 603 Handle<AccessorInfo> name = |
| 604 Accessors::FunctionNameInfo(isolate(), ro_attribs); |
| 605 { // Add name. |
| 606 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, |
| 607 ro_attribs); |
| 608 map->AppendDescriptor(&d); |
| 609 } |
| 610 } |
| 611 |
| 612 |
586 // ECMAScript 5th Edition, 13.2.3 | 613 // ECMAScript 5th Edition, 13.2.3 |
587 Handle<JSFunction> Genesis::GetStrictPoisonFunction() { | 614 Handle<JSFunction> Genesis::GetStrictPoisonFunction() { |
588 if (strict_poison_function.is_null()) { | 615 if (strict_poison_function.is_null()) { |
589 Handle<String> name = factory()->InternalizeOneByteString( | 616 Handle<String> name = factory()->InternalizeOneByteString( |
590 STATIC_CHAR_VECTOR("ThrowTypeError")); | 617 STATIC_CHAR_VECTOR("ThrowTypeError")); |
591 Handle<Code> code(isolate()->builtins()->builtin( | 618 Handle<Code> code(isolate()->builtins()->builtin( |
592 Builtins::kStrictModePoisonPill)); | 619 Builtins::kStrictModePoisonPill)); |
593 strict_poison_function = factory()->NewFunctionWithoutPrototype(name, code); | 620 strict_poison_function = factory()->NewFunctionWithoutPrototype(name, code); |
594 strict_poison_function->set_map(native_context()->sloppy_function_map()); | 621 strict_poison_function->set_map(native_context()->sloppy_function_map()); |
595 strict_poison_function->shared()->DontAdaptArguments(); | 622 strict_poison_function->shared()->DontAdaptArguments(); |
(...skipping 25 matching lines...) Expand all Loading... |
621 FunctionMode function_mode, | 648 FunctionMode function_mode, |
622 Handle<JSFunction> empty_function) { | 649 Handle<JSFunction> empty_function) { |
623 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); | 650 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); |
624 SetStrictFunctionInstanceDescriptor(map, function_mode); | 651 SetStrictFunctionInstanceDescriptor(map, function_mode); |
625 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode)); | 652 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode)); |
626 map->SetPrototype(empty_function); | 653 map->SetPrototype(empty_function); |
627 return map; | 654 return map; |
628 } | 655 } |
629 | 656 |
630 | 657 |
| 658 Handle<Map> Genesis::CreateStrongFunctionMap( |
| 659 Handle<JSFunction> empty_function, bool is_constructor) { |
| 660 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); |
| 661 SetStrongFunctionInstanceDescriptor(map); |
| 662 map->set_function_with_prototype(is_constructor); |
| 663 map->SetPrototype(empty_function); |
| 664 map->set_is_extensible(is_constructor); |
| 665 // TODO(rossberg): mark strong |
| 666 return map; |
| 667 } |
| 668 |
| 669 |
631 void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) { | 670 void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) { |
632 // Allocate map for the prototype-less strict mode instances. | 671 // Allocate map for the prototype-less strict mode instances. |
633 Handle<Map> strict_function_without_prototype_map = | 672 Handle<Map> strict_function_without_prototype_map = |
634 CreateStrictFunctionMap(FUNCTION_WITHOUT_PROTOTYPE, empty); | 673 CreateStrictFunctionMap(FUNCTION_WITHOUT_PROTOTYPE, empty); |
635 native_context()->set_strict_function_without_prototype_map( | 674 native_context()->set_strict_function_without_prototype_map( |
636 *strict_function_without_prototype_map); | 675 *strict_function_without_prototype_map); |
637 | 676 |
638 // Allocate map for the strict mode functions. This map is temporary, used | 677 // Allocate map for the strict mode functions. This map is temporary, used |
639 // only for processing of builtins. | 678 // only for processing of builtins. |
640 // Later the map is replaced with writable prototype map, allocated below. | 679 // Later the map is replaced with writable prototype map, allocated below. |
(...skipping 11 matching lines...) Expand all Loading... |
652 native_context()->set_bound_function_map(*bound_function_map); | 691 native_context()->set_bound_function_map(*bound_function_map); |
653 | 692 |
654 // Complete the callbacks. | 693 // Complete the callbacks. |
655 PoisonArgumentsAndCaller(strict_function_without_prototype_map); | 694 PoisonArgumentsAndCaller(strict_function_without_prototype_map); |
656 PoisonArgumentsAndCaller(strict_function_map); | 695 PoisonArgumentsAndCaller(strict_function_map); |
657 PoisonArgumentsAndCaller(strict_function_map_writable_prototype_); | 696 PoisonArgumentsAndCaller(strict_function_map_writable_prototype_); |
658 PoisonArgumentsAndCaller(bound_function_map); | 697 PoisonArgumentsAndCaller(bound_function_map); |
659 } | 698 } |
660 | 699 |
661 | 700 |
| 701 void Genesis::CreateStrongModeFunctionMaps(Handle<JSFunction> empty) { |
| 702 // Allocate map for strong mode instances, which never have prototypes. |
| 703 Handle<Map> strong_function_map = CreateStrongFunctionMap(empty, false); |
| 704 native_context()->set_strong_function_map(*strong_function_map); |
| 705 // Constructors do, though. |
| 706 Handle<Map> strong_constructor_map = CreateStrongFunctionMap(empty, true); |
| 707 native_context()->set_strong_constructor_map(*strong_constructor_map); |
| 708 } |
| 709 |
| 710 |
662 static void SetAccessors(Handle<Map> map, | 711 static void SetAccessors(Handle<Map> map, |
663 Handle<String> name, | 712 Handle<String> name, |
664 Handle<JSFunction> func) { | 713 Handle<JSFunction> func) { |
665 DescriptorArray* descs = map->instance_descriptors(); | 714 DescriptorArray* descs = map->instance_descriptors(); |
666 int number = descs->SearchWithCache(*name, *map); | 715 int number = descs->SearchWithCache(*name, *map); |
667 AccessorPair* accessors = AccessorPair::cast(descs->GetValue(number)); | 716 AccessorPair* accessors = AccessorPair::cast(descs->GetValue(number)); |
668 accessors->set_getter(*func); | 717 accessors->set_getter(*func); |
669 accessors->set_setter(*func); | 718 accessors->set_setter(*func); |
670 } | 719 } |
671 | 720 |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 rw_attribs, poison_pair); | 2065 rw_attribs, poison_pair); |
2017 | 2066 |
2018 Handle<Map> strict_function_map(native_context()->strict_function_map()); | 2067 Handle<Map> strict_function_map(native_context()->strict_function_map()); |
2019 Handle<Map> strict_generator_function_map = | 2068 Handle<Map> strict_generator_function_map = |
2020 Map::Copy(strict_function_map, "StrictGeneratorFunction"); | 2069 Map::Copy(strict_function_map, "StrictGeneratorFunction"); |
2021 // "arguments" and "caller" already poisoned. | 2070 // "arguments" and "caller" already poisoned. |
2022 strict_generator_function_map->SetPrototype(generator_function_prototype); | 2071 strict_generator_function_map->SetPrototype(generator_function_prototype); |
2023 native_context()->set_strict_generator_function_map( | 2072 native_context()->set_strict_generator_function_map( |
2024 *strict_generator_function_map); | 2073 *strict_generator_function_map); |
2025 | 2074 |
| 2075 Handle<Map> strong_function_map(native_context()->strong_function_map()); |
| 2076 Handle<Map> strong_generator_function_map = |
| 2077 Map::Copy(strong_function_map, "StrongGeneratorFunction"); |
| 2078 strong_generator_function_map->SetPrototype(generator_function_prototype); |
| 2079 native_context()->set_strong_generator_function_map( |
| 2080 *strong_generator_function_map); |
| 2081 |
2026 Handle<JSFunction> object_function(native_context()->object_function()); | 2082 Handle<JSFunction> object_function(native_context()->object_function()); |
2027 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0); | 2083 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0); |
2028 generator_object_prototype_map->SetPrototype(generator_object_prototype); | 2084 generator_object_prototype_map->SetPrototype(generator_object_prototype); |
2029 native_context()->set_generator_object_prototype_map( | 2085 native_context()->set_generator_object_prototype_map( |
2030 *generator_object_prototype_map); | 2086 *generator_object_prototype_map); |
2031 } | 2087 } |
2032 | 2088 |
2033 if (FLAG_disable_native_files) { | 2089 if (FLAG_disable_native_files) { |
2034 PrintF("Warning: Running without installed natives!\n"); | 2090 PrintF("Warning: Running without installed natives!\n"); |
2035 return true; | 2091 return true; |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2804 HookUpGlobalObject(global_object, outdated_contexts); | 2860 HookUpGlobalObject(global_object, outdated_contexts); |
2805 native_context()->builtins()->set_global_proxy( | 2861 native_context()->builtins()->set_global_proxy( |
2806 native_context()->global_proxy()); | 2862 native_context()->global_proxy()); |
2807 | 2863 |
2808 if (!ConfigureGlobalObjects(global_proxy_template)) return; | 2864 if (!ConfigureGlobalObjects(global_proxy_template)) return; |
2809 } else { | 2865 } else { |
2810 // We get here if there was no context snapshot. | 2866 // We get here if there was no context snapshot. |
2811 CreateRoots(); | 2867 CreateRoots(); |
2812 Handle<JSFunction> empty_function = CreateEmptyFunction(isolate); | 2868 Handle<JSFunction> empty_function = CreateEmptyFunction(isolate); |
2813 CreateStrictModeFunctionMaps(empty_function); | 2869 CreateStrictModeFunctionMaps(empty_function); |
| 2870 CreateStrongModeFunctionMaps(empty_function); |
2814 Handle<GlobalObject> global_object = | 2871 Handle<GlobalObject> global_object = |
2815 CreateNewGlobals(global_proxy_template, global_proxy); | 2872 CreateNewGlobals(global_proxy_template, global_proxy); |
2816 HookUpGlobalProxy(global_object, global_proxy); | 2873 HookUpGlobalProxy(global_object, global_proxy); |
2817 InitializeGlobal(global_object, empty_function); | 2874 InitializeGlobal(global_object, empty_function); |
2818 InstallJSFunctionResultCaches(); | 2875 InstallJSFunctionResultCaches(); |
2819 InitializeNormalizedMapCaches(); | 2876 InitializeNormalizedMapCaches(); |
2820 if (!InstallNatives()) return; | 2877 if (!InstallNatives()) return; |
2821 | 2878 |
2822 MakeFunctionInstancePrototypeWritable(); | 2879 MakeFunctionInstancePrototypeWritable(); |
2823 | 2880 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2859 return from + sizeof(NestingCounterType); | 2916 return from + sizeof(NestingCounterType); |
2860 } | 2917 } |
2861 | 2918 |
2862 | 2919 |
2863 // Called when the top-level V8 mutex is destroyed. | 2920 // Called when the top-level V8 mutex is destroyed. |
2864 void Bootstrapper::FreeThreadResources() { | 2921 void Bootstrapper::FreeThreadResources() { |
2865 DCHECK(!IsActive()); | 2922 DCHECK(!IsActive()); |
2866 } | 2923 } |
2867 | 2924 |
2868 } } // namespace v8::internal | 2925 } } // namespace v8::internal |
OLD | NEW |