Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Unified Diff: src/bootstrapper.cc

Issue 774613003: Fix NativesCollection<.>::GetScriptName in natives-external.cc (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Drop the 0-byte business, and instead fix caller to not make assumption about the return value of G… Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/natives-external.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 02af9d2fbc1f62cc86717504991ad3c5c08a3811..5f23cba557fd58a2a4217c6f62e134a4d34f6f1e 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2156,14 +2156,6 @@ bool Genesis::InstallNatives() {
}
-#define INSTALL_EXPERIMENTAL_NATIVE(i, flag, file) \
- if (FLAG_##flag && \
- strcmp(ExperimentalNatives::GetScriptName(i).start(), "native " file) == \
- 0) { \
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
- }
-
-
bool Genesis::InstallExperimentalNatives() {
static const char* harmony_arrays_natives[] = {
"native harmony-array.js", "native harmony-typedarray.js", NULL};
@@ -2186,14 +2178,15 @@ bool Genesis::InstallExperimentalNatives() {
for (int i = ExperimentalNatives::GetDebuggerCount();
i < ExperimentalNatives::GetBuiltinsCount(); i++) {
-#define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
- if (FLAG_##id) { \
- for (size_t j = 0; id##_natives[j] != NULL; j++) { \
- if (strcmp(ExperimentalNatives::GetScriptName(i).start(), \
- id##_natives[j]) == 0) { \
- if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
- } \
- } \
+#define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
+ if (FLAG_##id) { \
+ for (size_t j = 0; id##_natives[j] != NULL; j++) { \
+ Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
+ if (strncmp(script_name.start(), id##_natives[j], \
+ script_name.length()) == 0) { \
+ if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
+ } \
+ } \
}
// Iterate over flags that are not enabled by default.
HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES);
« no previous file with comments | « no previous file | src/natives-external.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698