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 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 } | 2149 } |
2150 | 2150 |
2151 #ifdef VERIFY_HEAP | 2151 #ifdef VERIFY_HEAP |
2152 builtins->ObjectVerify(); | 2152 builtins->ObjectVerify(); |
2153 #endif | 2153 #endif |
2154 | 2154 |
2155 return true; | 2155 return true; |
2156 } | 2156 } |
2157 | 2157 |
2158 | 2158 |
2159 #define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \ | |
2160 if (FLAG_##flag && \ | |
2161 strcmp(ExperimentalNatives::GetScriptName(i).start(), "native " file) == \ | |
2162 0) { \ | |
2163 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ | |
2164 } | |
2165 | |
2166 | |
2167 bool Genesis::InstallExperimentalNatives() { | 2159 bool Genesis::InstallExperimentalNatives() { |
2168 static const char* harmony_arrays_natives[] = { | 2160 static const char* harmony_arrays_natives[] = { |
2169 "native harmony-array.js", "native harmony-typedarray.js", NULL}; | 2161 "native harmony-array.js", "native harmony-typedarray.js", NULL}; |
2170 static const char* harmony_proxies_natives[] = {"native proxy.js", NULL}; | 2162 static const char* harmony_proxies_natives[] = {"native proxy.js", NULL}; |
2171 static const char* harmony_strings_natives[] = {"native harmony-string.js", | 2163 static const char* harmony_strings_natives[] = {"native harmony-string.js", |
2172 NULL}; | 2164 NULL}; |
2173 static const char* harmony_classes_natives[] = {"native harmony-classes.js", | 2165 static const char* harmony_classes_natives[] = {"native harmony-classes.js", |
2174 NULL}; | 2166 NULL}; |
2175 static const char* harmony_modules_natives[] = {NULL}; | 2167 static const char* harmony_modules_natives[] = {NULL}; |
2176 static const char* harmony_scoping_natives[] = {NULL}; | 2168 static const char* harmony_scoping_natives[] = {NULL}; |
2177 static const char* harmony_object_literals_natives[] = {NULL}; | 2169 static const char* harmony_object_literals_natives[] = {NULL}; |
2178 static const char* harmony_regexps_natives[] = {NULL}; | 2170 static const char* harmony_regexps_natives[] = {NULL}; |
2179 static const char* harmony_arrow_functions_natives[] = {NULL}; | 2171 static const char* harmony_arrow_functions_natives[] = {NULL}; |
2180 static const char* harmony_numeric_literals_natives[] = {NULL}; | 2172 static const char* harmony_numeric_literals_natives[] = {NULL}; |
2181 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js", | 2173 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js", |
2182 NULL}; | 2174 NULL}; |
2183 static const char* harmony_templates_natives[] = { | 2175 static const char* harmony_templates_natives[] = { |
2184 "native harmony-templates.js", NULL}; | 2176 "native harmony-templates.js", NULL}; |
2185 static const char* harmony_sloppy_natives[] = {NULL}; | 2177 static const char* harmony_sloppy_natives[] = {NULL}; |
2186 | 2178 |
2187 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2179 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2188 i < ExperimentalNatives::GetBuiltinsCount(); i++) { | 2180 i < ExperimentalNatives::GetBuiltinsCount(); i++) { |
2189 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ | 2181 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ |
2190 if (FLAG_##id) { \ | 2182 if (FLAG_##id) { \ |
2191 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ | 2183 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ |
2192 if (strcmp(ExperimentalNatives::GetScriptName(i).start(), \ | 2184 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ |
2193 id##_natives[j]) == 0) { \ | 2185 if (strncmp(script_name.start(), id##_natives[j], \ |
2194 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ | 2186 script_name.length()) == 0) { \ |
2195 } \ | 2187 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
2196 } \ | 2188 } \ |
| 2189 } \ |
2197 } | 2190 } |
2198 // Iterate over flags that are not enabled by default. | 2191 // Iterate over flags that are not enabled by default. |
2199 HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES); | 2192 HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES); |
2200 HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES); | 2193 HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES); |
2201 #undef INSTALL_EXPERIMENTAL_NATIVES | 2194 #undef INSTALL_EXPERIMENTAL_NATIVES |
2202 } | 2195 } |
2203 | 2196 |
2204 #define USE_NATIVES_FOR_FEATURE(id, descr) USE(id##_natives); | 2197 #define USE_NATIVES_FOR_FEATURE(id, descr) USE(id##_natives); |
2205 HARMONY_SHIPPING(USE_NATIVES_FOR_FEATURE) | 2198 HARMONY_SHIPPING(USE_NATIVES_FOR_FEATURE) |
2206 #undef USE_NATIVES_FOR_FEATURE | 2199 #undef USE_NATIVES_FOR_FEATURE |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2834 return from + sizeof(NestingCounterType); | 2827 return from + sizeof(NestingCounterType); |
2835 } | 2828 } |
2836 | 2829 |
2837 | 2830 |
2838 // Called when the top-level V8 mutex is destroyed. | 2831 // Called when the top-level V8 mutex is destroyed. |
2839 void Bootstrapper::FreeThreadResources() { | 2832 void Bootstrapper::FreeThreadResources() { |
2840 DCHECK(!IsActive()); | 2833 DCHECK(!IsActive()); |
2841 } | 2834 } |
2842 | 2835 |
2843 } } // namespace v8::internal | 2836 } } // namespace v8::internal |
OLD | NEW |