| 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/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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 DCHECK(!empty_function_map->is_dictionary_map()); | 556 DCHECK(!empty_function_map->is_dictionary_map()); |
| 557 Map::SetPrototype(empty_function_map, object_function_prototype); | 557 Map::SetPrototype(empty_function_map, object_function_prototype); |
| 558 empty_function_map->set_is_prototype_map(true); | 558 empty_function_map->set_is_prototype_map(true); |
| 559 | 559 |
| 560 empty_function->set_map(*empty_function_map); | 560 empty_function->set_map(*empty_function_map); |
| 561 | 561 |
| 562 // --- E m p t y --- | 562 // --- E m p t y --- |
| 563 Handle<String> source = factory->NewStringFromStaticChars("() {}"); | 563 Handle<String> source = factory->NewStringFromStaticChars("() {}"); |
| 564 Handle<Script> script = factory->NewScript(source); | 564 Handle<Script> script = factory->NewScript(source); |
| 565 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 565 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
| 566 empty_function->shared()->set_script(*script); | 566 SharedFunctionInfo::SetScript(handle(empty_function->shared()), script); |
| 567 empty_function->shared()->set_start_position(0); | 567 empty_function->shared()->set_start_position(0); |
| 568 empty_function->shared()->set_end_position(source->length()); | 568 empty_function->shared()->set_end_position(source->length()); |
| 569 empty_function->shared()->DontAdaptArguments(); | 569 empty_function->shared()->DontAdaptArguments(); |
| 570 | 570 |
| 571 // Set prototypes for the function maps. | 571 // Set prototypes for the function maps. |
| 572 Handle<Map> sloppy_function_map(native_context()->sloppy_function_map(), | 572 Handle<Map> sloppy_function_map(native_context()->sloppy_function_map(), |
| 573 isolate); | 573 isolate); |
| 574 Handle<Map> sloppy_function_without_prototype_map( | 574 Handle<Map> sloppy_function_without_prototype_map( |
| 575 native_context()->sloppy_function_without_prototype_map(), isolate); | 575 native_context()->sloppy_function_without_prototype_map(), isolate); |
| 576 Map::SetPrototype(sloppy_function_map, empty_function); | 576 Map::SetPrototype(sloppy_function_map, empty_function); |
| (...skipping 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3191 } | 3191 } |
| 3192 | 3192 |
| 3193 | 3193 |
| 3194 // Called when the top-level V8 mutex is destroyed. | 3194 // Called when the top-level V8 mutex is destroyed. |
| 3195 void Bootstrapper::FreeThreadResources() { | 3195 void Bootstrapper::FreeThreadResources() { |
| 3196 DCHECK(!IsActive()); | 3196 DCHECK(!IsActive()); |
| 3197 } | 3197 } |
| 3198 | 3198 |
| 3199 } // namespace internal | 3199 } // namespace internal |
| 3200 } // namespace v8 | 3200 } // namespace v8 |
| OLD | NEW |