| 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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 } | 1201 } |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 { | 1204 { |
| 1205 // --- S y m b o l --- | 1205 // --- S y m b o l --- |
| 1206 Handle<JSFunction> symbol_fun = InstallFunction( | 1206 Handle<JSFunction> symbol_fun = InstallFunction( |
| 1207 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, | 1207 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, |
| 1208 isolate->initial_object_prototype(), Builtins::kSymbolConstructor); | 1208 isolate->initial_object_prototype(), Builtins::kSymbolConstructor); |
| 1209 symbol_fun->shared()->set_construct_stub( | 1209 symbol_fun->shared()->set_construct_stub( |
| 1210 *isolate->builtins()->SymbolConstructor_ConstructStub()); | 1210 *isolate->builtins()->SymbolConstructor_ConstructStub()); |
| 1211 symbol_fun->shared()->set_internal_formal_parameter_count(1); | |
| 1212 symbol_fun->shared()->set_length(1); | 1211 symbol_fun->shared()->set_length(1); |
| 1212 symbol_fun->shared()->DontAdaptArguments(); |
| 1213 native_context()->set_symbol_function(*symbol_fun); | 1213 native_context()->set_symbol_function(*symbol_fun); |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 { // --- D a t e --- | 1216 { // --- D a t e --- |
| 1217 // Builtin functions for Date.prototype. | 1217 // Builtin functions for Date.prototype. |
| 1218 Handle<JSFunction> date_fun = InstallFunction( | 1218 Handle<JSFunction> date_fun = InstallFunction( |
| 1219 global, "Date", JS_DATE_TYPE, JSDate::kSize, | 1219 global, "Date", JS_DATE_TYPE, JSDate::kSize, |
| 1220 isolate->initial_object_prototype(), Builtins::kIllegal); | 1220 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 1221 InstallWithIntrinsicDefaultProto(isolate, date_fun, | 1221 InstallWithIntrinsicDefaultProto(isolate, date_fun, |
| 1222 Context::DATE_FUNCTION_INDEX); | 1222 Context::DATE_FUNCTION_INDEX); |
| (...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2457 Handle<JSFunction> string_function(native_context()->string_function()); | 2457 Handle<JSFunction> string_function(native_context()->string_function()); |
| 2458 DCHECK(JSObject::cast( | 2458 DCHECK(JSObject::cast( |
| 2459 string_function->initial_map()->prototype())->HasFastProperties()); | 2459 string_function->initial_map()->prototype())->HasFastProperties()); |
| 2460 native_context()->set_string_function_prototype_map( | 2460 native_context()->set_string_function_prototype_map( |
| 2461 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 2461 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
| 2462 | 2462 |
| 2463 // Install Global.eval. | 2463 // Install Global.eval. |
| 2464 { | 2464 { |
| 2465 Handle<JSFunction> eval = SimpleInstallFunction( | 2465 Handle<JSFunction> eval = SimpleInstallFunction( |
| 2466 handle(native_context()->global_object()), factory()->eval_string(), | 2466 handle(native_context()->global_object()), factory()->eval_string(), |
| 2467 Builtins::kGlobalEval, 1, true); | 2467 Builtins::kGlobalEval, 1, false); |
| 2468 native_context()->set_global_eval_fun(*eval); | 2468 native_context()->set_global_eval_fun(*eval); |
| 2469 } | 2469 } |
| 2470 | 2470 |
| 2471 // Install Date.prototype[@@toPrimitive]. | 2471 // Install Date.prototype[@@toPrimitive]. |
| 2472 { | 2472 { |
| 2473 Handle<String> key = factory()->Date_string(); | 2473 Handle<String> key = factory()->Date_string(); |
| 2474 Handle<JSFunction> date = Handle<JSFunction>::cast( | 2474 Handle<JSFunction> date = Handle<JSFunction>::cast( |
| 2475 Object::GetProperty(handle(native_context()->global_object()), key) | 2475 Object::GetProperty(handle(native_context()->global_object()), key) |
| 2476 .ToHandleChecked()); | 2476 .ToHandleChecked()); |
| 2477 Handle<JSObject> proto = | 2477 Handle<JSObject> proto = |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3357 } | 3357 } |
| 3358 | 3358 |
| 3359 | 3359 |
| 3360 // Called when the top-level V8 mutex is destroyed. | 3360 // Called when the top-level V8 mutex is destroyed. |
| 3361 void Bootstrapper::FreeThreadResources() { | 3361 void Bootstrapper::FreeThreadResources() { |
| 3362 DCHECK(!IsActive()); | 3362 DCHECK(!IsActive()); |
| 3363 } | 3363 } |
| 3364 | 3364 |
| 3365 } // namespace internal | 3365 } // namespace internal |
| 3366 } // namespace v8 | 3366 } // namespace v8 |
| OLD | NEW |