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/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/extensions/externalize-string-extension.h" | 9 #include "src/extensions/externalize-string-extension.h" |
10 #include "src/extensions/free-buffer-extension.h" | 10 #include "src/extensions/free-buffer-extension.h" |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 // Builtin functions for Script. | 1755 // Builtin functions for Script. |
1756 Handle<JSFunction> script_fun = InstallFunction( | 1756 Handle<JSFunction> script_fun = InstallFunction( |
1757 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, | 1757 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, |
1758 isolate()->initial_object_prototype(), Builtins::kIllegal); | 1758 isolate()->initial_object_prototype(), Builtins::kIllegal); |
1759 Handle<JSObject> prototype = | 1759 Handle<JSObject> prototype = |
1760 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1760 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1761 Accessors::FunctionSetPrototype(script_fun, prototype); | 1761 Accessors::FunctionSetPrototype(script_fun, prototype); |
1762 native_context()->set_script_function(*script_fun); | 1762 native_context()->set_script_function(*script_fun); |
1763 | 1763 |
1764 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); | 1764 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); |
1765 Map::EnsureDescriptorSlack(script_map, 13); | 1765 Map::EnsureDescriptorSlack(script_map, 14); |
1766 | 1766 |
1767 PropertyAttributes attribs = | 1767 PropertyAttributes attribs = |
1768 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 1768 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
1769 | 1769 |
1770 Handle<AccessorInfo> script_column = | 1770 Handle<AccessorInfo> script_column = |
1771 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); | 1771 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); |
1772 { | 1772 { |
1773 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), | 1773 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), |
1774 script_column, attribs); | 1774 script_column, attribs); |
1775 script_map->AppendDescriptor(&d); | 1775 script_map->AppendDescriptor(&d); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 | 1862 |
1863 Handle<AccessorInfo> script_eval_from_function_name = | 1863 Handle<AccessorInfo> script_eval_from_function_name = |
1864 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); | 1864 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); |
1865 { | 1865 { |
1866 CallbacksDescriptor d( | 1866 CallbacksDescriptor d( |
1867 Handle<Name>(Name::cast(script_eval_from_function_name->name())), | 1867 Handle<Name>(Name::cast(script_eval_from_function_name->name())), |
1868 script_eval_from_function_name, attribs); | 1868 script_eval_from_function_name, attribs); |
1869 script_map->AppendDescriptor(&d); | 1869 script_map->AppendDescriptor(&d); |
1870 } | 1870 } |
1871 | 1871 |
| 1872 Handle<AccessorInfo> script_source_url = |
| 1873 Accessors::ScriptSourceUrlInfo(isolate(), attribs); |
| 1874 { |
| 1875 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source_url->name())), |
| 1876 script_source_url, attribs); |
| 1877 script_map->AppendDescriptor(&d); |
| 1878 } |
| 1879 |
| 1880 Handle<AccessorInfo> script_source_mapping_url = |
| 1881 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs); |
| 1882 { |
| 1883 CallbacksDescriptor d( |
| 1884 Handle<Name>(Name::cast(script_source_mapping_url->name())), |
| 1885 script_source_mapping_url, attribs); |
| 1886 script_map->AppendDescriptor(&d); |
| 1887 } |
| 1888 |
1872 // Allocate the empty script. | 1889 // Allocate the empty script. |
1873 Handle<Script> script = factory()->NewScript(factory()->empty_string()); | 1890 Handle<Script> script = factory()->NewScript(factory()->empty_string()); |
1874 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 1891 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
1875 heap()->public_set_empty_script(*script); | 1892 heap()->public_set_empty_script(*script); |
1876 } | 1893 } |
1877 { | 1894 { |
1878 // Builtin function for OpaqueReference -- a JSValue-based object, | 1895 // Builtin function for OpaqueReference -- a JSValue-based object, |
1879 // that keeps its field isolated from JavaScript code. It may store | 1896 // that keeps its field isolated from JavaScript code. It may store |
1880 // objects, that JavaScript code may not access. | 1897 // objects, that JavaScript code may not access. |
1881 Handle<JSFunction> opaque_reference_fun = InstallFunction( | 1898 Handle<JSFunction> opaque_reference_fun = InstallFunction( |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2729 return from + sizeof(NestingCounterType); | 2746 return from + sizeof(NestingCounterType); |
2730 } | 2747 } |
2731 | 2748 |
2732 | 2749 |
2733 // Called when the top-level V8 mutex is destroyed. | 2750 // Called when the top-level V8 mutex is destroyed. |
2734 void Bootstrapper::FreeThreadResources() { | 2751 void Bootstrapper::FreeThreadResources() { |
2735 ASSERT(!IsActive()); | 2752 ASSERT(!IsActive()); |
2736 } | 2753 } |
2737 | 2754 |
2738 } } // namespace v8::internal | 2755 } } // namespace v8::internal |
OLD | NEW |