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 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 break; | 1873 break; |
1874 } | 1874 } |
1875 | 1875 |
1876 // The utils object can be removed for cases that reach this point. | 1876 // The utils object can be removed for cases that reach this point. |
1877 native_context()->set_natives_utils_object(heap()->undefined_value()); | 1877 native_context()->set_natives_utils_object(heap()->undefined_value()); |
1878 } | 1878 } |
1879 | 1879 |
1880 | 1880 |
1881 void Bootstrapper::ExportFromRuntime(Isolate* isolate, | 1881 void Bootstrapper::ExportFromRuntime(Isolate* isolate, |
1882 Handle<JSObject> container) { | 1882 Handle<JSObject> container) { |
| 1883 Factory* factory = isolate->factory(); |
1883 HandleScope scope(isolate); | 1884 HandleScope scope(isolate); |
1884 #define EXPORT_PRIVATE_SYMBOL(NAME) \ | 1885 Handle<Context> native_context = isolate->native_context(); |
1885 Handle<String> NAME##_name = \ | 1886 #define EXPORT_PRIVATE_SYMBOL(NAME) \ |
1886 isolate->factory()->NewStringFromAsciiChecked(#NAME); \ | 1887 Handle<String> NAME##_name = factory->NewStringFromAsciiChecked(#NAME); \ |
1887 JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \ | 1888 JSObject::AddProperty(container, NAME##_name, factory->NAME(), NONE); |
1888 NONE); | |
1889 PRIVATE_SYMBOL_LIST(EXPORT_PRIVATE_SYMBOL) | 1889 PRIVATE_SYMBOL_LIST(EXPORT_PRIVATE_SYMBOL) |
1890 #undef EXPORT_PRIVATE_SYMBOL | 1890 #undef EXPORT_PRIVATE_SYMBOL |
1891 | 1891 |
1892 #define EXPORT_PUBLIC_SYMBOL(NAME, DESCRIPTION) \ | 1892 #define EXPORT_PUBLIC_SYMBOL(NAME, DESCRIPTION) \ |
1893 Handle<String> NAME##_name = \ | 1893 Handle<String> NAME##_name = factory->NewStringFromAsciiChecked(#NAME); \ |
1894 isolate->factory()->NewStringFromAsciiChecked(#NAME); \ | 1894 JSObject::AddProperty(container, NAME##_name, factory->NAME(), NONE); |
1895 JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \ | |
1896 NONE); | |
1897 PUBLIC_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL) | 1895 PUBLIC_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL) |
1898 WELL_KNOWN_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL) | 1896 WELL_KNOWN_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL) |
1899 #undef EXPORT_PUBLIC_SYMBOL | 1897 #undef EXPORT_PUBLIC_SYMBOL |
1900 | 1898 |
1901 { | 1899 { |
1902 Handle<JSFunction> apply = InstallFunction( | 1900 Handle<JSFunction> apply = InstallFunction( |
1903 container, "reflect_apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1901 container, "reflect_apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
1904 MaybeHandle<JSObject>(), Builtins::kReflectApply); | 1902 MaybeHandle<JSObject>(), Builtins::kReflectApply); |
1905 apply->shared()->set_internal_formal_parameter_count(3); | 1903 apply->shared()->set_internal_formal_parameter_count(3); |
1906 apply->shared()->set_length(3); | 1904 apply->shared()->set_length(3); |
1907 Handle<TypeFeedbackVector> feedback_vector = | 1905 Handle<TypeFeedbackVector> feedback_vector = |
1908 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate); | 1906 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate); |
1909 apply->shared()->set_feedback_vector(*feedback_vector); | 1907 apply->shared()->set_feedback_vector(*feedback_vector); |
1910 isolate->native_context()->set_reflect_apply(*apply); | 1908 native_context->set_reflect_apply(*apply); |
1911 } | 1909 } |
1912 | 1910 |
1913 { | 1911 { |
1914 Handle<JSFunction> construct = InstallFunction( | 1912 Handle<JSFunction> construct = InstallFunction( |
1915 container, "reflect_construct", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1913 container, "reflect_construct", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
1916 MaybeHandle<JSObject>(), Builtins::kReflectConstruct); | 1914 MaybeHandle<JSObject>(), Builtins::kReflectConstruct); |
1917 construct->shared()->set_internal_formal_parameter_count(3); | 1915 construct->shared()->set_internal_formal_parameter_count(3); |
1918 construct->shared()->set_length(2); | 1916 construct->shared()->set_length(2); |
1919 Handle<TypeFeedbackVector> feedback_vector = | 1917 Handle<TypeFeedbackVector> feedback_vector = |
1920 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate); | 1918 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate); |
1921 construct->shared()->set_feedback_vector(*feedback_vector); | 1919 construct->shared()->set_feedback_vector(*feedback_vector); |
1922 isolate->native_context()->set_reflect_construct(*construct); | 1920 native_context->set_reflect_construct(*construct); |
1923 } | 1921 } |
1924 | 1922 |
1925 Handle<JSObject> iterator_prototype; | 1923 Handle<JSObject> iterator_prototype; |
1926 | 1924 |
1927 { | 1925 { |
1928 PrototypeIterator iter( | 1926 PrototypeIterator iter(native_context->generator_object_prototype_map()); |
1929 isolate->native_context()->generator_object_prototype_map()); | |
1930 iter.Advance(); // Advance to the prototype of generator_object_prototype. | 1927 iter.Advance(); // Advance to the prototype of generator_object_prototype. |
1931 iterator_prototype = Handle<JSObject>(iter.GetCurrent<JSObject>()); | 1928 iterator_prototype = Handle<JSObject>(iter.GetCurrent<JSObject>()); |
1932 | 1929 |
1933 JSObject::AddProperty(container, isolate->factory()->InternalizeUtf8String( | 1930 JSObject::AddProperty(container, |
1934 "IteratorPrototype"), | 1931 factory->InternalizeUtf8String("IteratorPrototype"), |
1935 iterator_prototype, NONE); | 1932 iterator_prototype, NONE); |
1936 } | 1933 } |
1937 | 1934 |
1938 { | 1935 { |
1939 PrototypeIterator iter( | 1936 PrototypeIterator iter(native_context->sloppy_generator_function_map()); |
1940 isolate->native_context()->sloppy_generator_function_map()); | |
1941 Handle<JSObject> generator_function_prototype(iter.GetCurrent<JSObject>()); | 1937 Handle<JSObject> generator_function_prototype(iter.GetCurrent<JSObject>()); |
1942 | 1938 |
1943 JSObject::AddProperty(container, isolate->factory()->InternalizeUtf8String( | 1939 JSObject::AddProperty( |
1944 "GeneratorFunctionPrototype"), | 1940 container, factory->InternalizeUtf8String("GeneratorFunctionPrototype"), |
1945 generator_function_prototype, NONE); | 1941 generator_function_prototype, NONE); |
1946 | 1942 |
1947 static const bool kUseStrictFunctionMap = true; | 1943 static const bool kUseStrictFunctionMap = true; |
1948 Handle<JSFunction> generator_function_function = | 1944 Handle<JSFunction> generator_function_function = |
1949 InstallFunction(container, "GeneratorFunction", JS_FUNCTION_TYPE, | 1945 InstallFunction(container, "GeneratorFunction", JS_FUNCTION_TYPE, |
1950 JSFunction::kSize, generator_function_prototype, | 1946 JSFunction::kSize, generator_function_prototype, |
1951 Builtins::kIllegal, kUseStrictFunctionMap); | 1947 Builtins::kIllegal, kUseStrictFunctionMap); |
1952 generator_function_function->initial_map()->set_is_callable(); | 1948 generator_function_function->initial_map()->set_is_callable(); |
1953 } | 1949 } |
1954 | 1950 |
1955 { // -- S e t I t e r a t o r | 1951 { // -- S e t I t e r a t o r |
1956 Handle<JSObject> set_iterator_prototype = | 1952 Handle<JSObject> set_iterator_prototype = |
1957 isolate->factory()->NewJSObject(isolate->object_function(), TENURED); | 1953 isolate->factory()->NewJSObject(isolate->object_function(), TENURED); |
1958 SetObjectPrototype(set_iterator_prototype, iterator_prototype); | 1954 SetObjectPrototype(set_iterator_prototype, iterator_prototype); |
1959 Handle<JSFunction> set_iterator_function = InstallFunction( | 1955 Handle<JSFunction> set_iterator_function = InstallFunction( |
1960 container, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize, | 1956 container, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize, |
1961 set_iterator_prototype, Builtins::kIllegal); | 1957 set_iterator_prototype, Builtins::kIllegal); |
1962 isolate->native_context()->set_set_iterator_map( | 1958 native_context->set_set_iterator_map(set_iterator_function->initial_map()); |
1963 set_iterator_function->initial_map()); | |
1964 } | 1959 } |
1965 | 1960 |
1966 { // -- M a p I t e r a t o r | 1961 { // -- M a p I t e r a t o r |
1967 Handle<JSObject> map_iterator_prototype = | 1962 Handle<JSObject> map_iterator_prototype = |
1968 isolate->factory()->NewJSObject(isolate->object_function(), TENURED); | 1963 isolate->factory()->NewJSObject(isolate->object_function(), TENURED); |
1969 SetObjectPrototype(map_iterator_prototype, iterator_prototype); | 1964 SetObjectPrototype(map_iterator_prototype, iterator_prototype); |
1970 Handle<JSFunction> map_iterator_function = InstallFunction( | 1965 Handle<JSFunction> map_iterator_function = InstallFunction( |
1971 container, "MapIterator", JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize, | 1966 container, "MapIterator", JS_MAP_ITERATOR_TYPE, JSMapIterator::kSize, |
1972 map_iterator_prototype, Builtins::kIllegal); | 1967 map_iterator_prototype, Builtins::kIllegal); |
1973 isolate->native_context()->set_map_iterator_map( | 1968 native_context->set_map_iterator_map(map_iterator_function->initial_map()); |
1974 map_iterator_function->initial_map()); | 1969 } |
| 1970 |
| 1971 { // -- S c r i p t |
| 1972 // Builtin functions for Script. |
| 1973 Handle<JSFunction> script_fun = InstallFunction( |
| 1974 container, "Script", JS_VALUE_TYPE, JSValue::kSize, |
| 1975 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 1976 Handle<JSObject> prototype = |
| 1977 factory->NewJSObject(isolate->object_function(), TENURED); |
| 1978 Accessors::FunctionSetPrototype(script_fun, prototype).Assert(); |
| 1979 native_context->set_script_function(*script_fun); |
| 1980 |
| 1981 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); |
| 1982 Map::EnsureDescriptorSlack(script_map, 15); |
| 1983 |
| 1984 PropertyAttributes attribs = |
| 1985 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 1986 |
| 1987 Handle<AccessorInfo> script_column = |
| 1988 Accessors::ScriptColumnOffsetInfo(isolate, attribs); |
| 1989 { |
| 1990 AccessorConstantDescriptor d( |
| 1991 Handle<Name>(Name::cast(script_column->name())), script_column, |
| 1992 attribs); |
| 1993 script_map->AppendDescriptor(&d); |
| 1994 } |
| 1995 |
| 1996 Handle<AccessorInfo> script_id = Accessors::ScriptIdInfo(isolate, attribs); |
| 1997 { |
| 1998 AccessorConstantDescriptor d(Handle<Name>(Name::cast(script_id->name())), |
| 1999 script_id, attribs); |
| 2000 script_map->AppendDescriptor(&d); |
| 2001 } |
| 2002 |
| 2003 |
| 2004 Handle<AccessorInfo> script_name = |
| 2005 Accessors::ScriptNameInfo(isolate, attribs); |
| 2006 { |
| 2007 AccessorConstantDescriptor d( |
| 2008 Handle<Name>(Name::cast(script_name->name())), script_name, attribs); |
| 2009 script_map->AppendDescriptor(&d); |
| 2010 } |
| 2011 |
| 2012 Handle<AccessorInfo> script_line = |
| 2013 Accessors::ScriptLineOffsetInfo(isolate, attribs); |
| 2014 { |
| 2015 AccessorConstantDescriptor d( |
| 2016 Handle<Name>(Name::cast(script_line->name())), script_line, attribs); |
| 2017 script_map->AppendDescriptor(&d); |
| 2018 } |
| 2019 |
| 2020 Handle<AccessorInfo> script_source = |
| 2021 Accessors::ScriptSourceInfo(isolate, attribs); |
| 2022 { |
| 2023 AccessorConstantDescriptor d( |
| 2024 Handle<Name>(Name::cast(script_source->name())), script_source, |
| 2025 attribs); |
| 2026 script_map->AppendDescriptor(&d); |
| 2027 } |
| 2028 |
| 2029 Handle<AccessorInfo> script_type = |
| 2030 Accessors::ScriptTypeInfo(isolate, attribs); |
| 2031 { |
| 2032 AccessorConstantDescriptor d( |
| 2033 Handle<Name>(Name::cast(script_type->name())), script_type, attribs); |
| 2034 script_map->AppendDescriptor(&d); |
| 2035 } |
| 2036 |
| 2037 Handle<AccessorInfo> script_compilation_type = |
| 2038 Accessors::ScriptCompilationTypeInfo(isolate, attribs); |
| 2039 { |
| 2040 AccessorConstantDescriptor d( |
| 2041 Handle<Name>(Name::cast(script_compilation_type->name())), |
| 2042 script_compilation_type, attribs); |
| 2043 script_map->AppendDescriptor(&d); |
| 2044 } |
| 2045 |
| 2046 Handle<AccessorInfo> script_line_ends = |
| 2047 Accessors::ScriptLineEndsInfo(isolate, attribs); |
| 2048 { |
| 2049 AccessorConstantDescriptor d( |
| 2050 Handle<Name>(Name::cast(script_line_ends->name())), script_line_ends, |
| 2051 attribs); |
| 2052 script_map->AppendDescriptor(&d); |
| 2053 } |
| 2054 |
| 2055 Handle<AccessorInfo> script_context_data = |
| 2056 Accessors::ScriptContextDataInfo(isolate, attribs); |
| 2057 { |
| 2058 AccessorConstantDescriptor d( |
| 2059 Handle<Name>(Name::cast(script_context_data->name())), |
| 2060 script_context_data, attribs); |
| 2061 script_map->AppendDescriptor(&d); |
| 2062 } |
| 2063 |
| 2064 Handle<AccessorInfo> script_eval_from_script = |
| 2065 Accessors::ScriptEvalFromScriptInfo(isolate, attribs); |
| 2066 { |
| 2067 AccessorConstantDescriptor d( |
| 2068 Handle<Name>(Name::cast(script_eval_from_script->name())), |
| 2069 script_eval_from_script, attribs); |
| 2070 script_map->AppendDescriptor(&d); |
| 2071 } |
| 2072 |
| 2073 Handle<AccessorInfo> script_eval_from_script_position = |
| 2074 Accessors::ScriptEvalFromScriptPositionInfo(isolate, attribs); |
| 2075 { |
| 2076 AccessorConstantDescriptor d( |
| 2077 Handle<Name>(Name::cast(script_eval_from_script_position->name())), |
| 2078 script_eval_from_script_position, attribs); |
| 2079 script_map->AppendDescriptor(&d); |
| 2080 } |
| 2081 |
| 2082 Handle<AccessorInfo> script_eval_from_function_name = |
| 2083 Accessors::ScriptEvalFromFunctionNameInfo(isolate, attribs); |
| 2084 { |
| 2085 AccessorConstantDescriptor d( |
| 2086 Handle<Name>(Name::cast(script_eval_from_function_name->name())), |
| 2087 script_eval_from_function_name, attribs); |
| 2088 script_map->AppendDescriptor(&d); |
| 2089 } |
| 2090 |
| 2091 Handle<AccessorInfo> script_source_url = |
| 2092 Accessors::ScriptSourceUrlInfo(isolate, attribs); |
| 2093 { |
| 2094 AccessorConstantDescriptor d( |
| 2095 Handle<Name>(Name::cast(script_source_url->name())), |
| 2096 script_source_url, attribs); |
| 2097 script_map->AppendDescriptor(&d); |
| 2098 } |
| 2099 |
| 2100 Handle<AccessorInfo> script_source_mapping_url = |
| 2101 Accessors::ScriptSourceMappingUrlInfo(isolate, attribs); |
| 2102 { |
| 2103 AccessorConstantDescriptor d( |
| 2104 Handle<Name>(Name::cast(script_source_mapping_url->name())), |
| 2105 script_source_mapping_url, attribs); |
| 2106 script_map->AppendDescriptor(&d); |
| 2107 } |
| 2108 |
| 2109 Handle<AccessorInfo> script_is_embedder_debug_script = |
| 2110 Accessors::ScriptIsEmbedderDebugScriptInfo(isolate, attribs); |
| 2111 { |
| 2112 AccessorConstantDescriptor d( |
| 2113 Handle<Name>(Name::cast(script_is_embedder_debug_script->name())), |
| 2114 script_is_embedder_debug_script, attribs); |
| 2115 script_map->AppendDescriptor(&d); |
| 2116 } |
1975 } | 2117 } |
1976 } | 2118 } |
1977 | 2119 |
1978 | 2120 |
1979 void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate, | 2121 void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate, |
1980 Handle<JSObject> container) { | 2122 Handle<JSObject> container) { |
1981 HandleScope scope(isolate); | 2123 HandleScope scope(isolate); |
1982 | 2124 |
1983 #define INITIALIZE_FLAG(FLAG) \ | 2125 #define INITIALIZE_FLAG(FLAG) \ |
1984 { \ | 2126 { \ |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2202 int builtin_index = Natives::GetDebuggerCount(); | 2344 int builtin_index = Natives::GetDebuggerCount(); |
2203 // Only run prologue.js and runtime.js at this point. | 2345 // Only run prologue.js and runtime.js at this point. |
2204 DCHECK_EQ(builtin_index, Natives::GetIndex("prologue")); | 2346 DCHECK_EQ(builtin_index, Natives::GetIndex("prologue")); |
2205 if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; | 2347 if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; |
2206 DCHECK_EQ(builtin_index, Natives::GetIndex("runtime")); | 2348 DCHECK_EQ(builtin_index, Natives::GetIndex("runtime")); |
2207 if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; | 2349 if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; |
2208 | 2350 |
2209 // A thin context is ready at this point. | 2351 // A thin context is ready at this point. |
2210 if (context_type == THIN_CONTEXT) return true; | 2352 if (context_type == THIN_CONTEXT) return true; |
2211 | 2353 |
2212 { // -- S c r i p t | |
2213 // Builtin functions for Script. | |
2214 Handle<JSFunction> script_fun = InstallFunction( | |
2215 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, | |
2216 isolate()->initial_object_prototype(), Builtins::kIllegal); | |
2217 Handle<JSObject> prototype = | |
2218 factory()->NewJSObject(isolate()->object_function(), TENURED); | |
2219 Accessors::FunctionSetPrototype(script_fun, prototype).Assert(); | |
2220 native_context()->set_script_function(*script_fun); | |
2221 | |
2222 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); | |
2223 Map::EnsureDescriptorSlack(script_map, 15); | |
2224 | |
2225 PropertyAttributes attribs = | |
2226 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | |
2227 | |
2228 Handle<AccessorInfo> script_column = | |
2229 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); | |
2230 { | |
2231 AccessorConstantDescriptor d( | |
2232 Handle<Name>(Name::cast(script_column->name())), script_column, | |
2233 attribs); | |
2234 script_map->AppendDescriptor(&d); | |
2235 } | |
2236 | |
2237 Handle<AccessorInfo> script_id = | |
2238 Accessors::ScriptIdInfo(isolate(), attribs); | |
2239 { | |
2240 AccessorConstantDescriptor d(Handle<Name>(Name::cast(script_id->name())), | |
2241 script_id, attribs); | |
2242 script_map->AppendDescriptor(&d); | |
2243 } | |
2244 | |
2245 | |
2246 Handle<AccessorInfo> script_name = | |
2247 Accessors::ScriptNameInfo(isolate(), attribs); | |
2248 { | |
2249 AccessorConstantDescriptor d( | |
2250 Handle<Name>(Name::cast(script_name->name())), script_name, attribs); | |
2251 script_map->AppendDescriptor(&d); | |
2252 } | |
2253 | |
2254 Handle<AccessorInfo> script_line = | |
2255 Accessors::ScriptLineOffsetInfo(isolate(), attribs); | |
2256 { | |
2257 AccessorConstantDescriptor d( | |
2258 Handle<Name>(Name::cast(script_line->name())), script_line, attribs); | |
2259 script_map->AppendDescriptor(&d); | |
2260 } | |
2261 | |
2262 Handle<AccessorInfo> script_source = | |
2263 Accessors::ScriptSourceInfo(isolate(), attribs); | |
2264 { | |
2265 AccessorConstantDescriptor d( | |
2266 Handle<Name>(Name::cast(script_source->name())), script_source, | |
2267 attribs); | |
2268 script_map->AppendDescriptor(&d); | |
2269 } | |
2270 | |
2271 Handle<AccessorInfo> script_type = | |
2272 Accessors::ScriptTypeInfo(isolate(), attribs); | |
2273 { | |
2274 AccessorConstantDescriptor d( | |
2275 Handle<Name>(Name::cast(script_type->name())), script_type, attribs); | |
2276 script_map->AppendDescriptor(&d); | |
2277 } | |
2278 | |
2279 Handle<AccessorInfo> script_compilation_type = | |
2280 Accessors::ScriptCompilationTypeInfo(isolate(), attribs); | |
2281 { | |
2282 AccessorConstantDescriptor d( | |
2283 Handle<Name>(Name::cast(script_compilation_type->name())), | |
2284 script_compilation_type, attribs); | |
2285 script_map->AppendDescriptor(&d); | |
2286 } | |
2287 | |
2288 Handle<AccessorInfo> script_line_ends = | |
2289 Accessors::ScriptLineEndsInfo(isolate(), attribs); | |
2290 { | |
2291 AccessorConstantDescriptor d( | |
2292 Handle<Name>(Name::cast(script_line_ends->name())), script_line_ends, | |
2293 attribs); | |
2294 script_map->AppendDescriptor(&d); | |
2295 } | |
2296 | |
2297 Handle<AccessorInfo> script_context_data = | |
2298 Accessors::ScriptContextDataInfo(isolate(), attribs); | |
2299 { | |
2300 AccessorConstantDescriptor d( | |
2301 Handle<Name>(Name::cast(script_context_data->name())), | |
2302 script_context_data, attribs); | |
2303 script_map->AppendDescriptor(&d); | |
2304 } | |
2305 | |
2306 Handle<AccessorInfo> script_eval_from_script = | |
2307 Accessors::ScriptEvalFromScriptInfo(isolate(), attribs); | |
2308 { | |
2309 AccessorConstantDescriptor d( | |
2310 Handle<Name>(Name::cast(script_eval_from_script->name())), | |
2311 script_eval_from_script, attribs); | |
2312 script_map->AppendDescriptor(&d); | |
2313 } | |
2314 | |
2315 Handle<AccessorInfo> script_eval_from_script_position = | |
2316 Accessors::ScriptEvalFromScriptPositionInfo(isolate(), attribs); | |
2317 { | |
2318 AccessorConstantDescriptor d( | |
2319 Handle<Name>(Name::cast(script_eval_from_script_position->name())), | |
2320 script_eval_from_script_position, attribs); | |
2321 script_map->AppendDescriptor(&d); | |
2322 } | |
2323 | |
2324 Handle<AccessorInfo> script_eval_from_function_name = | |
2325 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); | |
2326 { | |
2327 AccessorConstantDescriptor d( | |
2328 Handle<Name>(Name::cast(script_eval_from_function_name->name())), | |
2329 script_eval_from_function_name, attribs); | |
2330 script_map->AppendDescriptor(&d); | |
2331 } | |
2332 | |
2333 Handle<AccessorInfo> script_source_url = | |
2334 Accessors::ScriptSourceUrlInfo(isolate(), attribs); | |
2335 { | |
2336 AccessorConstantDescriptor d( | |
2337 Handle<Name>(Name::cast(script_source_url->name())), | |
2338 script_source_url, attribs); | |
2339 script_map->AppendDescriptor(&d); | |
2340 } | |
2341 | |
2342 Handle<AccessorInfo> script_source_mapping_url = | |
2343 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs); | |
2344 { | |
2345 AccessorConstantDescriptor d( | |
2346 Handle<Name>(Name::cast(script_source_mapping_url->name())), | |
2347 script_source_mapping_url, attribs); | |
2348 script_map->AppendDescriptor(&d); | |
2349 } | |
2350 | |
2351 Handle<AccessorInfo> script_is_embedder_debug_script = | |
2352 Accessors::ScriptIsEmbedderDebugScriptInfo(isolate(), attribs); | |
2353 { | |
2354 AccessorConstantDescriptor d( | |
2355 Handle<Name>(Name::cast(script_is_embedder_debug_script->name())), | |
2356 script_is_embedder_debug_script, attribs); | |
2357 script_map->AppendDescriptor(&d); | |
2358 } | |
2359 } | |
2360 { | 2354 { |
2361 // Builtin function for OpaqueReference -- a JSValue-based object, | 2355 // Builtin function for OpaqueReference -- a JSValue-based object, |
2362 // that keeps its field isolated from JavaScript code. It may store | 2356 // that keeps its field isolated from JavaScript code. It may store |
2363 // objects, that JavaScript code may not access. | 2357 // objects, that JavaScript code may not access. |
2364 Handle<JSFunction> opaque_reference_fun = InstallFunction( | 2358 Handle<JSFunction> opaque_reference_fun = factory()->NewFunction( |
2365 builtins, "OpaqueReference", JS_VALUE_TYPE, JSValue::kSize, | 2359 factory()->empty_string(), isolate()->builtins()->Illegal(), |
2366 isolate()->initial_object_prototype(), Builtins::kIllegal); | 2360 isolate()->initial_object_prototype(), JS_VALUE_TYPE, JSValue::kSize); |
2367 Handle<JSObject> prototype = | 2361 Handle<JSObject> prototype = |
2368 factory()->NewJSObject(isolate()->object_function(), TENURED); | 2362 factory()->NewJSObject(isolate()->object_function(), TENURED); |
2369 Accessors::FunctionSetPrototype(opaque_reference_fun, prototype).Assert(); | 2363 Accessors::FunctionSetPrototype(opaque_reference_fun, prototype).Assert(); |
2370 native_context()->set_opaque_reference_function(*opaque_reference_fun); | 2364 native_context()->set_opaque_reference_function(*opaque_reference_fun); |
2371 } | 2365 } |
2372 | 2366 |
2373 // InternalArrays should not use Smi-Only array optimizations. There are too | 2367 // InternalArrays should not use Smi-Only array optimizations. There are too |
2374 // many places in the C++ runtime code (e.g. RegEx) that assume that | 2368 // many places in the C++ runtime code (e.g. RegEx) that assume that |
2375 // elements in InternalArrays can be set to non-Smi values without going | 2369 // elements in InternalArrays can be set to non-Smi values without going |
2376 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT | 2370 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3319 } | 3313 } |
3320 | 3314 |
3321 | 3315 |
3322 // Called when the top-level V8 mutex is destroyed. | 3316 // Called when the top-level V8 mutex is destroyed. |
3323 void Bootstrapper::FreeThreadResources() { | 3317 void Bootstrapper::FreeThreadResources() { |
3324 DCHECK(!IsActive()); | 3318 DCHECK(!IsActive()); |
3325 } | 3319 } |
3326 | 3320 |
3327 } // namespace internal | 3321 } // namespace internal |
3328 } // namespace v8 | 3322 } // namespace v8 |
OLD | NEW |