| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance", | 1571 INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance", |
| 1572 configure_instance_fun); | 1572 configure_instance_fun); |
| 1573 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun); | 1573 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun); |
| 1574 INSTALL_NATIVE(JSObject, "functionCache", function_cache); | 1574 INSTALL_NATIVE(JSObject, "functionCache", function_cache); |
| 1575 INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor", | 1575 INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor", |
| 1576 to_complete_property_descriptor); | 1576 to_complete_property_descriptor); |
| 1577 } | 1577 } |
| 1578 | 1578 |
| 1579 | 1579 |
| 1580 void Genesis::InstallExperimentalNativeFunctions() { | 1580 void Genesis::InstallExperimentalNativeFunctions() { |
| 1581 INSTALL_NATIVE(JSFunction, "RunMicrotasks", run_microtasks); |
| 1581 if (FLAG_harmony_proxies) { | 1582 if (FLAG_harmony_proxies) { |
| 1582 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); | 1583 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); |
| 1583 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); | 1584 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); |
| 1584 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); | 1585 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); |
| 1585 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); | 1586 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); |
| 1586 } | 1587 } |
| 1587 if (FLAG_harmony_observation) { | 1588 if (FLAG_harmony_observation) { |
| 1588 INSTALL_NATIVE(JSFunction, "NotifyChange", observers_notify_change); | 1589 INSTALL_NATIVE(JSFunction, "NotifyChange", observers_notify_change); |
| 1589 INSTALL_NATIVE(JSFunction, "EnqueueSpliceRecord", observers_enqueue_splice); | 1590 INSTALL_NATIVE(JSFunction, "EnqueueSpliceRecord", observers_enqueue_splice); |
| 1590 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", | 1591 INSTALL_NATIVE(JSFunction, "BeginPerformSplice", |
| 1591 observers_begin_perform_splice); | 1592 observers_begin_perform_splice); |
| 1592 INSTALL_NATIVE(JSFunction, "EndPerformSplice", | 1593 INSTALL_NATIVE(JSFunction, "EndPerformSplice", |
| 1593 observers_end_perform_splice); | 1594 observers_end_perform_splice); |
| 1594 INSTALL_NATIVE(JSFunction, "DeliverChangeRecords", | |
| 1595 observers_deliver_changes); | |
| 1596 } | 1595 } |
| 1597 } | 1596 } |
| 1598 | 1597 |
| 1599 #undef INSTALL_NATIVE | 1598 #undef INSTALL_NATIVE |
| 1600 | 1599 |
| 1601 | 1600 |
| 1602 Handle<JSFunction> Genesis::InstallInternalArray( | 1601 Handle<JSFunction> Genesis::InstallInternalArray( |
| 1603 Handle<JSBuiltinsObject> builtins, | 1602 Handle<JSBuiltinsObject> builtins, |
| 1604 const char* name, | 1603 const char* name, |
| 1605 ElementsKind elements_kind) { | 1604 ElementsKind elements_kind) { |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 } | 2015 } |
| 2017 | 2016 |
| 2018 #ifdef VERIFY_HEAP | 2017 #ifdef VERIFY_HEAP |
| 2019 builtins->Verify(); | 2018 builtins->Verify(); |
| 2020 #endif | 2019 #endif |
| 2021 | 2020 |
| 2022 return true; | 2021 return true; |
| 2023 } | 2022 } |
| 2024 | 2023 |
| 2025 | 2024 |
| 2025 #define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \ |
| 2026 if (FLAG_harmony_##flag && \ |
| 2027 strcmp(ExperimentalNatives::GetScriptName(i).start(), \ |
| 2028 "native " file) == 0) { \ |
| 2029 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
| 2030 } |
| 2031 |
| 2032 |
| 2026 bool Genesis::InstallExperimentalNatives() { | 2033 bool Genesis::InstallExperimentalNatives() { |
| 2027 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2034 for (int i = ExperimentalNatives::GetDebuggerCount(); |
| 2028 i < ExperimentalNatives::GetBuiltinsCount(); | 2035 i < ExperimentalNatives::GetBuiltinsCount(); |
| 2029 i++) { | 2036 i++) { |
| 2030 if (FLAG_harmony_symbols && | 2037 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") |
| 2031 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 2038 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
| 2032 "native symbol.js") == 0) { | 2039 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") |
| 2033 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 2040 INSTALL_EXPERIMENTAL_NATIVE(i, observation, "object-observe.js") |
| 2034 } | 2041 INSTALL_EXPERIMENTAL_NATIVE(i, promises, "promise.js") |
| 2035 if (FLAG_harmony_proxies && | 2042 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
| 2036 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 2043 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
| 2037 "native proxy.js") == 0) { | 2044 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |
| 2038 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 2045 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") |
| 2039 } | 2046 INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js") |
| 2040 if (FLAG_harmony_collections && | |
| 2041 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2042 "native collection.js") == 0) { | |
| 2043 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2044 } | |
| 2045 if (FLAG_harmony_observation && | |
| 2046 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2047 "native object-observe.js") == 0) { | |
| 2048 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2049 } | |
| 2050 if (FLAG_harmony_generators && | |
| 2051 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2052 "native generator.js") == 0) { | |
| 2053 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2054 } | |
| 2055 if (FLAG_harmony_iteration && | |
| 2056 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2057 "native array-iterator.js") == 0) { | |
| 2058 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2059 } | |
| 2060 if (FLAG_harmony_strings && | |
| 2061 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2062 "native harmony-string.js") == 0) { | |
| 2063 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2064 } | |
| 2065 if (FLAG_harmony_arrays && | |
| 2066 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2067 "native harmony-array.js") == 0) { | |
| 2068 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2069 } | |
| 2070 if (FLAG_harmony_maths && | |
| 2071 strcmp(ExperimentalNatives::GetScriptName(i).start(), | |
| 2072 "native harmony-math.js") == 0) { | |
| 2073 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | |
| 2074 } | |
| 2075 } | 2047 } |
| 2076 | 2048 |
| 2077 InstallExperimentalNativeFunctions(); | 2049 InstallExperimentalNativeFunctions(); |
| 2078 | 2050 |
| 2079 return true; | 2051 return true; |
| 2080 } | 2052 } |
| 2081 | 2053 |
| 2082 | 2054 |
| 2083 static Handle<JSObject> ResolveBuiltinIdHolder( | 2055 static Handle<JSObject> ResolveBuiltinIdHolder( |
| 2084 Handle<Context> native_context, | 2056 Handle<Context> native_context, |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2669 return from + sizeof(NestingCounterType); | 2641 return from + sizeof(NestingCounterType); |
| 2670 } | 2642 } |
| 2671 | 2643 |
| 2672 | 2644 |
| 2673 // Called when the top-level V8 mutex is destroyed. | 2645 // Called when the top-level V8 mutex is destroyed. |
| 2674 void Bootstrapper::FreeThreadResources() { | 2646 void Bootstrapper::FreeThreadResources() { |
| 2675 ASSERT(!IsActive()); | 2647 ASSERT(!IsActive()); |
| 2676 } | 2648 } |
| 2677 | 2649 |
| 2678 } } // namespace v8::internal | 2650 } } // namespace v8::internal |
| OLD | NEW |