| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 delete_these_arrays_on_tear_down_->Add(memory); | 115 delete_these_arrays_on_tear_down_->Add(memory); |
| 116 } | 116 } |
| 117 return memory; | 117 return memory; |
| 118 } | 118 } |
| 119 | 119 |
| 120 | 120 |
| 121 void Bootstrapper::TearDown() { | 121 void Bootstrapper::TearDown() { |
| 122 if (delete_these_non_arrays_on_tear_down_ != NULL) { | 122 if (delete_these_non_arrays_on_tear_down_ != NULL) { |
| 123 int len = delete_these_non_arrays_on_tear_down_->length(); | 123 int len = delete_these_non_arrays_on_tear_down_->length(); |
| 124 DCHECK(len < 27); // Don't use this mechanism for unbounded allocations. | 124 DCHECK(len < 25); // Don't use this mechanism for unbounded allocations. |
| 125 for (int i = 0; i < len; i++) { | 125 for (int i = 0; i < len; i++) { |
| 126 delete delete_these_non_arrays_on_tear_down_->at(i); | 126 delete delete_these_non_arrays_on_tear_down_->at(i); |
| 127 delete_these_non_arrays_on_tear_down_->at(i) = NULL; | 127 delete_these_non_arrays_on_tear_down_->at(i) = NULL; |
| 128 } | 128 } |
| 129 delete delete_these_non_arrays_on_tear_down_; | 129 delete delete_these_non_arrays_on_tear_down_; |
| 130 delete_these_non_arrays_on_tear_down_ = NULL; | 130 delete_these_non_arrays_on_tear_down_ = NULL; |
| 131 } | 131 } |
| 132 | 132 |
| 133 if (delete_these_arrays_on_tear_down_ != NULL) { | 133 if (delete_these_arrays_on_tear_down_ != NULL) { |
| 134 int len = delete_these_arrays_on_tear_down_->length(); | 134 int len = delete_these_arrays_on_tear_down_->length(); |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 INSTALL_NATIVE(JSFunction, "EndPerformSplice", | 1593 INSTALL_NATIVE(JSFunction, "EndPerformSplice", |
| 1594 observers_end_perform_splice); | 1594 observers_end_perform_splice); |
| 1595 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", | 1595 INSTALL_NATIVE(JSFunction, "NativeObjectObserve", |
| 1596 native_object_observe); | 1596 native_object_observe); |
| 1597 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", | 1597 INSTALL_NATIVE(JSFunction, "NativeObjectGetNotifier", |
| 1598 native_object_get_notifier); | 1598 native_object_get_notifier); |
| 1599 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", | 1599 INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", |
| 1600 native_object_notifier_perform_change); | 1600 native_object_notifier_perform_change); |
| 1601 | 1601 |
| 1602 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol); | 1602 INSTALL_NATIVE(Symbol, "symbolIterator", iterator_symbol); |
| 1603 INSTALL_NATIVE(Symbol, "symbolUnscopables", unscopables_symbol); | |
| 1604 | 1603 |
| 1605 INSTALL_NATIVE_MATH(abs) | 1604 INSTALL_NATIVE_MATH(abs) |
| 1606 INSTALL_NATIVE_MATH(acos) | 1605 INSTALL_NATIVE_MATH(acos) |
| 1607 INSTALL_NATIVE_MATH(asin) | 1606 INSTALL_NATIVE_MATH(asin) |
| 1608 INSTALL_NATIVE_MATH(atan) | 1607 INSTALL_NATIVE_MATH(atan) |
| 1609 INSTALL_NATIVE_MATH(atan2) | 1608 INSTALL_NATIVE_MATH(atan2) |
| 1610 INSTALL_NATIVE_MATH(ceil) | 1609 INSTALL_NATIVE_MATH(ceil) |
| 1611 INSTALL_NATIVE_MATH(cos) | 1610 INSTALL_NATIVE_MATH(cos) |
| 1612 INSTALL_NATIVE_MATH(exp) | 1611 INSTALL_NATIVE_MATH(exp) |
| 1613 INSTALL_NATIVE_MATH(floor) | 1612 INSTALL_NATIVE_MATH(floor) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1624 } | 1623 } |
| 1625 | 1624 |
| 1626 | 1625 |
| 1627 void Genesis::InstallExperimentalNativeFunctions() { | 1626 void Genesis::InstallExperimentalNativeFunctions() { |
| 1628 if (FLAG_harmony_proxies) { | 1627 if (FLAG_harmony_proxies) { |
| 1629 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); | 1628 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); |
| 1630 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); | 1629 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); |
| 1631 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); | 1630 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); |
| 1632 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); | 1631 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); |
| 1633 } | 1632 } |
| 1633 |
| 1634 if (FLAG_harmony_unscopables) { |
| 1635 INSTALL_NATIVE(Symbol, "symbolUnscopables", unscopables_symbol); |
| 1636 } |
| 1634 } | 1637 } |
| 1635 | 1638 |
| 1636 #undef INSTALL_NATIVE | 1639 #undef INSTALL_NATIVE |
| 1637 | 1640 |
| 1638 | 1641 |
| 1639 Handle<JSFunction> Genesis::InstallInternalArray( | 1642 Handle<JSFunction> Genesis::InstallInternalArray( |
| 1640 Handle<JSBuiltinsObject> builtins, | 1643 Handle<JSBuiltinsObject> builtins, |
| 1641 const char* name, | 1644 const char* name, |
| 1642 ElementsKind elements_kind) { | 1645 ElementsKind elements_kind) { |
| 1643 // --- I n t e r n a l A r r a y --- | 1646 // --- I n t e r n a l A r r a y --- |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2058 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ | 2061 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
| 2059 } | 2062 } |
| 2060 | 2063 |
| 2061 | 2064 |
| 2062 bool Genesis::InstallExperimentalNatives() { | 2065 bool Genesis::InstallExperimentalNatives() { |
| 2063 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2066 for (int i = ExperimentalNatives::GetDebuggerCount(); |
| 2064 i < ExperimentalNatives::GetBuiltinsCount(); | 2067 i < ExperimentalNatives::GetBuiltinsCount(); |
| 2065 i++) { | 2068 i++) { |
| 2066 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") | 2069 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
| 2067 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") | 2070 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
| 2071 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
| 2072 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "string-iterator.js") |
| 2068 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") | 2073 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |
| 2069 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") | 2074 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") |
| 2075 INSTALL_EXPERIMENTAL_NATIVE(i, unscopables, "unscopables.js") |
| 2070 } | 2076 } |
| 2071 | 2077 |
| 2072 InstallExperimentalNativeFunctions(); | 2078 InstallExperimentalNativeFunctions(); |
| 2073 return true; | 2079 return true; |
| 2074 } | 2080 } |
| 2075 | 2081 |
| 2076 | 2082 |
| 2077 static void InstallBuiltinFunctionId(Handle<JSObject> holder, | 2083 static void InstallBuiltinFunctionId(Handle<JSObject> holder, |
| 2078 const char* function_name, | 2084 const char* function_name, |
| 2079 BuiltinFunctionId id) { | 2085 BuiltinFunctionId id) { |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2697 return from + sizeof(NestingCounterType); | 2703 return from + sizeof(NestingCounterType); |
| 2698 } | 2704 } |
| 2699 | 2705 |
| 2700 | 2706 |
| 2701 // Called when the top-level V8 mutex is destroyed. | 2707 // Called when the top-level V8 mutex is destroyed. |
| 2702 void Bootstrapper::FreeThreadResources() { | 2708 void Bootstrapper::FreeThreadResources() { |
| 2703 DCHECK(!IsActive()); | 2709 DCHECK(!IsActive()); |
| 2704 } | 2710 } |
| 2705 | 2711 |
| 2706 } } // namespace v8::internal | 2712 } } // namespace v8::internal |
| OLD | NEW |