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/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 DCHECK(!empty_function_map->is_dictionary_map()); | 590 DCHECK(!empty_function_map->is_dictionary_map()); |
591 Map::SetPrototype(empty_function_map, object_function_prototype); | 591 Map::SetPrototype(empty_function_map, object_function_prototype); |
592 empty_function_map->set_is_prototype_map(true); | 592 empty_function_map->set_is_prototype_map(true); |
593 | 593 |
594 empty_function->set_map(*empty_function_map); | 594 empty_function->set_map(*empty_function_map); |
595 | 595 |
596 // --- E m p t y --- | 596 // --- E m p t y --- |
597 Handle<String> source = factory->NewStringFromStaticChars("() {}"); | 597 Handle<String> source = factory->NewStringFromStaticChars("() {}"); |
598 Handle<Script> script = factory->NewScript(source); | 598 Handle<Script> script = factory->NewScript(source); |
599 script->set_type(Script::TYPE_NATIVE); | 599 script->set_type(Script::TYPE_NATIVE); |
| 600 Handle<FixedArray> infos = factory->NewFixedArray(2); |
| 601 script->set_shared_function_infos(*infos); |
600 empty_function->shared()->set_start_position(0); | 602 empty_function->shared()->set_start_position(0); |
601 empty_function->shared()->set_end_position(source->length()); | 603 empty_function->shared()->set_end_position(source->length()); |
| 604 empty_function->shared()->set_function_literal_id(1); |
602 empty_function->shared()->DontAdaptArguments(); | 605 empty_function->shared()->DontAdaptArguments(); |
603 SharedFunctionInfo::SetScript(handle(empty_function->shared()), script); | 606 SharedFunctionInfo::SetScript(handle(empty_function->shared()), script); |
604 | 607 |
605 // Set prototypes for the function maps. | 608 // Set prototypes for the function maps. |
606 Handle<Map> sloppy_function_map(native_context()->sloppy_function_map(), | 609 Handle<Map> sloppy_function_map(native_context()->sloppy_function_map(), |
607 isolate); | 610 isolate); |
608 Handle<Map> sloppy_function_without_prototype_map( | 611 Handle<Map> sloppy_function_without_prototype_map( |
609 native_context()->sloppy_function_without_prototype_map(), isolate); | 612 native_context()->sloppy_function_without_prototype_map(), isolate); |
610 Map::SetPrototype(sloppy_function_map, empty_function); | 613 Map::SetPrototype(sloppy_function_map, empty_function); |
611 Map::SetPrototype(sloppy_function_without_prototype_map, empty_function); | 614 Map::SetPrototype(sloppy_function_without_prototype_map, empty_function); |
(...skipping 4013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4625 } | 4628 } |
4626 | 4629 |
4627 | 4630 |
4628 // Called when the top-level V8 mutex is destroyed. | 4631 // Called when the top-level V8 mutex is destroyed. |
4629 void Bootstrapper::FreeThreadResources() { | 4632 void Bootstrapper::FreeThreadResources() { |
4630 DCHECK(!IsActive()); | 4633 DCHECK(!IsActive()); |
4631 } | 4634 } |
4632 | 4635 |
4633 } // namespace internal | 4636 } // namespace internal |
4634 } // namespace v8 | 4637 } // namespace v8 |
OLD | NEW |