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 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 } | 2016 } |
2017 | 2017 |
2018 #ifdef VERIFY_HEAP | 2018 #ifdef VERIFY_HEAP |
2019 builtins->Verify(); | 2019 builtins->Verify(); |
2020 #endif | 2020 #endif |
2021 | 2021 |
2022 return true; | 2022 return true; |
2023 } | 2023 } |
2024 | 2024 |
2025 | 2025 |
| 2026 #define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \ |
| 2027 if (FLAG_harmony_##flag && \ |
| 2028 strcmp(ExperimentalNatives::GetScriptName(i).start(), \ |
| 2029 "native " file) == 0) { \ |
| 2030 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
| 2031 } |
| 2032 |
| 2033 |
2026 bool Genesis::InstallExperimentalNatives() { | 2034 bool Genesis::InstallExperimentalNatives() { |
2027 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2035 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2028 i < ExperimentalNatives::GetBuiltinsCount(); | 2036 i < ExperimentalNatives::GetBuiltinsCount(); |
2029 i++) { | 2037 i++) { |
2030 if (FLAG_harmony_symbols && | 2038 INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") |
2031 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 2039 INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
2032 "native symbol.js") == 0) { | 2040 INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") |
2033 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 2041 INSTALL_EXPERIMENTAL_NATIVE(i, observation, "object-observe.js") |
2034 } | 2042 INSTALL_EXPERIMENTAL_NATIVE(i, promises, "promise.js") |
2035 if (FLAG_harmony_proxies && | 2043 INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
2036 strcmp(ExperimentalNatives::GetScriptName(i).start(), | 2044 INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
2037 "native proxy.js") == 0) { | 2045 INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |
2038 if (!CompileExperimentalBuiltin(isolate(), i)) return false; | 2046 INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") |
2039 } | 2047 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 } | 2048 } |
2076 | 2049 |
2077 InstallExperimentalNativeFunctions(); | 2050 InstallExperimentalNativeFunctions(); |
2078 | 2051 |
2079 return true; | 2052 return true; |
2080 } | 2053 } |
2081 | 2054 |
2082 | 2055 |
2083 static Handle<JSObject> ResolveBuiltinIdHolder( | 2056 static Handle<JSObject> ResolveBuiltinIdHolder( |
2084 Handle<Context> native_context, | 2057 Handle<Context> native_context, |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 return from + sizeof(NestingCounterType); | 2642 return from + sizeof(NestingCounterType); |
2670 } | 2643 } |
2671 | 2644 |
2672 | 2645 |
2673 // Called when the top-level V8 mutex is destroyed. | 2646 // Called when the top-level V8 mutex is destroyed. |
2674 void Bootstrapper::FreeThreadResources() { | 2647 void Bootstrapper::FreeThreadResources() { |
2675 ASSERT(!IsActive()); | 2648 ASSERT(!IsActive()); |
2676 } | 2649 } |
2677 | 2650 |
2678 } } // namespace v8::internal | 2651 } } // namespace v8::internal |
OLD | NEW |