| 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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 DONT_ENUM | DONT_DELETE | READ_ONLY); | 975 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 976 Handle<AccessorInfo> string_length( | 976 Handle<AccessorInfo> string_length( |
| 977 Accessors::StringLengthInfo(isolate, attribs)); | 977 Accessors::StringLengthInfo(isolate, attribs)); |
| 978 | 978 |
| 979 { // Add length. | 979 { // Add length. |
| 980 CallbacksDescriptor d(factory->length_string(), string_length, attribs); | 980 CallbacksDescriptor d(factory->length_string(), string_length, attribs); |
| 981 string_map->AppendDescriptor(&d); | 981 string_map->AppendDescriptor(&d); |
| 982 } | 982 } |
| 983 } | 983 } |
| 984 | 984 |
| 985 { |
| 986 // --- S y m b o l --- |
| 987 Handle<JSFunction> symbol_fun = InstallFunction( |
| 988 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, |
| 989 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 990 native_context()->set_symbol_function(*symbol_fun); |
| 991 } |
| 992 |
| 985 { // --- D a t e --- | 993 { // --- D a t e --- |
| 986 // Builtin functions for Date.prototype. | 994 // Builtin functions for Date.prototype. |
| 987 Handle<JSFunction> date_fun = | 995 Handle<JSFunction> date_fun = |
| 988 InstallFunction(global, "Date", JS_DATE_TYPE, JSDate::kSize, | 996 InstallFunction(global, "Date", JS_DATE_TYPE, JSDate::kSize, |
| 989 isolate->initial_object_prototype(), | 997 isolate->initial_object_prototype(), |
| 990 Builtins::kIllegal); | 998 Builtins::kIllegal); |
| 991 | 999 |
| 992 native_context()->set_date_function(*date_fun); | 1000 native_context()->set_date_function(*date_fun); |
| 993 } | 1001 } |
| 994 | 1002 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 native_context()->set_data_view_fun(*data_view_fun); | 1135 native_context()->set_data_view_fun(*data_view_fun); |
| 1128 } | 1136 } |
| 1129 | 1137 |
| 1130 // -- W e a k M a p | 1138 // -- W e a k M a p |
| 1131 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, | 1139 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
| 1132 isolate->initial_object_prototype(), Builtins::kIllegal); | 1140 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 1133 // -- W e a k S e t | 1141 // -- W e a k S e t |
| 1134 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, | 1142 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, |
| 1135 isolate->initial_object_prototype(), Builtins::kIllegal); | 1143 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 1136 | 1144 |
| 1137 { | |
| 1138 // --- S y m b o l --- | |
| 1139 Handle<JSFunction> symbol_fun = InstallFunction( | |
| 1140 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, | |
| 1141 isolate->initial_object_prototype(), Builtins::kIllegal); | |
| 1142 native_context()->set_symbol_function(*symbol_fun); | |
| 1143 } | |
| 1144 | |
| 1145 { // --- sloppy arguments map | 1145 { // --- sloppy arguments map |
| 1146 // Make sure we can recognize argument objects at runtime. | 1146 // Make sure we can recognize argument objects at runtime. |
| 1147 // This is done by introducing an anonymous function with | 1147 // This is done by introducing an anonymous function with |
| 1148 // class_name equals 'Arguments'. | 1148 // class_name equals 'Arguments'. |
| 1149 Handle<String> arguments_string = factory->InternalizeOneByteString( | 1149 Handle<String> arguments_string = factory->InternalizeOneByteString( |
| 1150 STATIC_ASCII_VECTOR("Arguments")); | 1150 STATIC_ASCII_VECTOR("Arguments")); |
| 1151 Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal)); | 1151 Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal)); |
| 1152 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( | 1152 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( |
| 1153 arguments_string, code); | 1153 arguments_string, code); |
| 1154 function->shared()->set_instance_class_name(*arguments_string); | 1154 function->shared()->set_instance_class_name(*arguments_string); |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", | 1614 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", |
| 1615 observers_begin_perform_splice); | 1615 observers_begin_perform_splice); |
| 1616 INSTALL_NATIVE(JSFunction, "EndPerformSplice", | 1616 INSTALL_NATIVE(JSFunction, "EndPerformSplice", |
| 1617 observers_end_perform_splice); | 1617 observers_end_perform_splice); |
| 1618 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", | 1618 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", |
| 1619 native_object_observe); | 1619 native_object_observe); |
| 1620 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", | 1620 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", |
| 1621 native_object_get_notifier); | 1621 native_object_get_notifier); |
| 1622 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", | 1622 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", |
| 1623 native_object_notifier_perform_change); | 1623 native_object_notifier_perform_change); |
| 1624 |
| 1624 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol); | 1625 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol); |
| 1625 | 1626 |
| 1626 INSTALL_NATIVE_MATH(abs) | 1627 INSTALL_NATIVE_MATH(abs) |
| 1627 INSTALL_NATIVE_MATH(acos) | 1628 INSTALL_NATIVE_MATH(acos) |
| 1628 INSTALL_NATIVE_MATH(asin) | 1629 INSTALL_NATIVE_MATH(asin) |
| 1629 INSTALL_NATIVE_MATH(atan) | 1630 INSTALL_NATIVE_MATH(atan) |
| 1630 INSTALL_NATIVE_MATH(atan2) | 1631 INSTALL_NATIVE_MATH(atan2) |
| 1631 INSTALL_NATIVE_MATH(ceil) | 1632 INSTALL_NATIVE_MATH(ceil) |
| 1632 INSTALL_NATIVE_MATH(cos) | 1633 INSTALL_NATIVE_MATH(cos) |
| 1633 INSTALL_NATIVE_MATH(exp) | 1634 INSTALL_NATIVE_MATH(exp) |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 return from + sizeof(NestingCounterType); | 2730 return from + sizeof(NestingCounterType); |
| 2730 } | 2731 } |
| 2731 | 2732 |
| 2732 | 2733 |
| 2733 // Called when the top-level V8 mutex is destroyed. | 2734 // Called when the top-level V8 mutex is destroyed. |
| 2734 void Bootstrapper::FreeThreadResources() { | 2735 void Bootstrapper::FreeThreadResources() { |
| 2735 DCHECK(!IsActive()); | 2736 DCHECK(!IsActive()); |
| 2736 } | 2737 } |
| 2737 | 2738 |
| 2738 } } // namespace v8::internal | 2739 } } // namespace v8::internal |
| OLD | NEW |