Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 234a2118bdd7002189906df3e21f6446869f594e..dcf4f4390a53fc02e0210a04511c5b45eb4c8521 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2023,55 +2023,28 @@ bool Genesis::InstallNatives() { |
} |
+#define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \ |
+ if (FLAG_harmony_##flag && \ |
+ strcmp(ExperimentalNatives::GetScriptName(i).start(), \ |
+ "native " file) == 0) { \ |
+ if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
+ } |
+ |
+ |
bool Genesis::InstallExperimentalNatives() { |
for (int i = ExperimentalNatives::GetDebuggerCount(); |
i < ExperimentalNatives::GetBuiltinsCount(); |
i++) { |
- if (FLAG_harmony_symbols && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native symbol.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_proxies && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native proxy.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_collections && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native collection.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_observation && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native object-observe.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_generators && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native generator.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_iteration && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native array-iterator.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_strings && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native harmony-string.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_arrays && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native harmony-array.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
- if (FLAG_harmony_maths && |
- strcmp(ExperimentalNatives::GetScriptName(i).start(), |
- "native harmony-math.js") == 0) { |
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; |
- } |
+ INSTALL_EXPERIMENTAL_NATIVE(i, symbols, "symbol.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, proxies, "proxy.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, collections, "collection.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, observation, "object-observe.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, promises, "promise.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, generators, "generator.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, iteration, "array-iterator.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, strings, "harmony-string.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, arrays, "harmony-array.js") |
+ INSTALL_EXPERIMENTAL_NATIVE(i, maths, "harmony-math.js") |
} |
InstallExperimentalNativeFunctions(); |