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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 symbol_fun->shared()->set_length(1); | 1205 symbol_fun->shared()->set_length(1); |
1206 native_context()->set_symbol_function(*symbol_fun); | 1206 native_context()->set_symbol_function(*symbol_fun); |
1207 } | 1207 } |
1208 | 1208 |
1209 { // --- D a t e --- | 1209 { // --- D a t e --- |
1210 // Builtin functions for Date.prototype. | 1210 // Builtin functions for Date.prototype. |
1211 InstallFunction(global, "Date", JS_DATE_TYPE, JSDate::kSize, | 1211 InstallFunction(global, "Date", JS_DATE_TYPE, JSDate::kSize, |
1212 isolate->initial_object_prototype(), Builtins::kIllegal); | 1212 isolate->initial_object_prototype(), Builtins::kIllegal); |
1213 } | 1213 } |
1214 | 1214 |
1215 | |
1216 { // -- R e g E x p | 1215 { // -- R e g E x p |
1217 // Builtin functions for RegExp.prototype. | 1216 // Builtin functions for RegExp.prototype. |
1218 Handle<JSFunction> regexp_fun = | 1217 Handle<JSFunction> regexp_fun = |
1219 InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize, | 1218 InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize, |
1220 isolate->initial_object_prototype(), | 1219 isolate->initial_object_prototype(), |
1221 Builtins::kIllegal); | 1220 Builtins::kIllegal); |
1222 native_context()->set_regexp_function(*regexp_fun); | 1221 native_context()->set_regexp_function(*regexp_fun); |
1223 | 1222 |
1224 DCHECK(regexp_fun->has_initial_map()); | 1223 DCHECK(regexp_fun->has_initial_map()); |
1225 Handle<Map> initial_map(regexp_fun->initial_map()); | 1224 Handle<Map> initial_map(regexp_fun->initial_map()); |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 | 2030 |
2032 #undef INITIALIZE_FLAG | 2031 #undef INITIALIZE_FLAG |
2033 } | 2032 } |
2034 | 2033 |
2035 | 2034 |
2036 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ | 2035 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ |
2037 void Genesis::InitializeGlobal_##id() {} | 2036 void Genesis::InitializeGlobal_##id() {} |
2038 | 2037 |
2039 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) | 2038 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) |
2040 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes) | 2039 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes) |
2041 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies) | |
2042 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) | 2040 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) |
2043 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_function) | 2041 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_function) |
2044 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_let) | 2042 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_let) |
2045 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) | 2043 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) |
2046 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_default_parameters) | 2044 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_default_parameters) |
2047 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring) | 2045 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring) |
2048 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe) | 2046 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe) |
2049 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps) | 2047 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps) |
2050 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps) | 2048 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps) |
2051 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_completion) | 2049 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_completion) |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 Handle<JSFunction> type##_function = InstallFunction( \ | 2178 Handle<JSFunction> type##_function = InstallFunction( \ |
2181 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ | 2179 simd_object, #Type, JS_VALUE_TYPE, JSValue::kSize, \ |
2182 isolate->initial_object_prototype(), Builtins::kIllegal); \ | 2180 isolate->initial_object_prototype(), Builtins::kIllegal); \ |
2183 native_context()->set_##type##_function(*type##_function); \ | 2181 native_context()->set_##type##_function(*type##_function); \ |
2184 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); | 2182 type##_function->shared()->set_instance_class_name(*factory->Type##_string()); |
2185 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) | 2183 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) |
2186 #undef SIMD128_INSTALL_FUNCTION | 2184 #undef SIMD128_INSTALL_FUNCTION |
2187 } | 2185 } |
2188 | 2186 |
2189 | 2187 |
| 2188 void Genesis::InitializeGlobal_harmony_proxies() { |
| 2189 if (!FLAG_harmony_proxies) return; |
| 2190 Handle<JSGlobalObject> global( |
| 2191 JSGlobalObject::cast(native_context()->global_object())); |
| 2192 Isolate* isolate = global->GetIsolate(); |
| 2193 InstallFunction(global, "Proxy", JS_PROXY_TYPE, JSProxy::kSize, |
| 2194 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 2195 } |
| 2196 |
| 2197 |
2190 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, | 2198 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, |
2191 const char* name, | 2199 const char* name, |
2192 ElementsKind elements_kind) { | 2200 ElementsKind elements_kind) { |
2193 // --- I n t e r n a l A r r a y --- | 2201 // --- I n t e r n a l A r r a y --- |
2194 // An array constructor on the builtins object that works like | 2202 // An array constructor on the builtins object that works like |
2195 // the public Array constructor, except that its prototype | 2203 // the public Array constructor, except that its prototype |
2196 // doesn't inherit from Object.prototype. | 2204 // doesn't inherit from Object.prototype. |
2197 // To be used only for internal work by builtins. Instances | 2205 // To be used only for internal work by builtins. Instances |
2198 // must not be leaked to user code. | 2206 // must not be leaked to user code. |
2199 Handle<JSObject> prototype = | 2207 Handle<JSObject> prototype = |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3234 } | 3242 } |
3235 | 3243 |
3236 | 3244 |
3237 // Called when the top-level V8 mutex is destroyed. | 3245 // Called when the top-level V8 mutex is destroyed. |
3238 void Bootstrapper::FreeThreadResources() { | 3246 void Bootstrapper::FreeThreadResources() { |
3239 DCHECK(!IsActive()); | 3247 DCHECK(!IsActive()); |
3240 } | 3248 } |
3241 | 3249 |
3242 } // namespace internal | 3250 } // namespace internal |
3243 } // namespace v8 | 3251 } // namespace v8 |
OLD | NEW |