summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/Options.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:56:46 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:57:30 +0200
commitb297e0fa5c217c9467033b7c8b46891a52870120 (patch)
tree43fc14689295e9e64f2719d05aad94e3049f6cd7 /Source/JavaScriptCore/runtime/Options.cpp
parent69d517dbfa69903d8593cc1737f0474b21e3251e (diff)
downloadqtwebkit-b297e0fa5c217c9467033b7c8b46891a52870120.tar.gz
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78. Caused OOM issues on some CI machines :(
Diffstat (limited to 'Source/JavaScriptCore/runtime/Options.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/Options.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
index 386eb4fcf..ed0720b54 100644
--- a/Source/JavaScriptCore/runtime/Options.cpp
+++ b/Source/JavaScriptCore/runtime/Options.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "Options.h"
-#include "HeapStatistics.h"
#include <algorithm>
#include <limits>
#include <stdio.h>
@@ -42,6 +41,10 @@
#include <sys/sysctl.h>
#endif
+// Set to 1 to control the heuristics using environment variables.
+#define ENABLE_RUN_TIME_HEURISTICS 0
+
+
namespace JSC {
static bool parse(const char* string, bool& value)
@@ -72,10 +75,10 @@ static bool parse(const char* string, double& value)
return sscanf(string, "%lf", &value) == 1;
}
+#if ENABLE(RUN_TIME_HEURISTICS)
template<typename T>
void overrideOptionWithHeuristic(T& variable, const char* name)
{
-#if !OS(WINCE)
const char* stringValue = getenv(name);
if (!stringValue)
return;
@@ -84,8 +87,9 @@ void overrideOptionWithHeuristic(T& variable, const char* name)
return;
fprintf(stderr, "WARNING: failed to parse %s=%s\n", name, stringValue);
-#endif
}
+#endif
+
static unsigned computeNumberOfGCMarkers(int maxNumberOfGCMarkers)
{
@@ -126,19 +130,17 @@ void Options::initialize()
#if USE(CF) || OS(UNIX)
objectsAreImmortal() = !!getenv("JSImmortalZombieEnabled");
useZombieMode() = !!getenv("JSImmortalZombieEnabled") || !!getenv("JSZombieEnabled");
-
- gcMaxHeapSize() = getenv("GCMaxHeapSize") ? HeapStatistics::parseMemoryAmount(getenv("GCMaxHeapSize")) : 0;
- recordGCPauseTimes() = !!getenv("JSRecordGCPauseTimes");
- logHeapStatisticsAtExit() = gcMaxHeapSize() || recordGCPauseTimes();
#endif
// Allow environment vars to override options if applicable.
// The evn var should be the name of the option prefixed with
// "JSC_".
+#if ENABLE(RUN_TIME_HEURISTICS)
#define FOR_EACH_OPTION(type_, name_, defaultValue_) \
overrideOptionWithHeuristic(name_(), "JSC_" #name_);
JSC_OPTIONS(FOR_EACH_OPTION)
#undef FOR_EACH_OPTION
+#endif // RUN_TIME_HEURISTICS
#if 0
; // Deconfuse editors that do auto indentation
@@ -151,7 +153,7 @@ void Options::initialize()
#if !ENABLE(YARR_JIT)
useRegExpJIT() = false;
#endif
-
+
// Do range checks where needed and make corrections to the options:
ASSERT(thresholdForOptimizeAfterLongWarmUp() >= thresholdForOptimizeAfterWarmUp());
ASSERT(thresholdForOptimizeAfterWarmUp() >= thresholdForOptimizeSoon());