Reviewers: Jakob,
Message:
PTAL.
Description:
Experimental Profiler: tweak type info threshold.
Also included: simplify String.slice.
BUG=
TEST=
Please review this at http://codereview.chromium.org/9694033/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/flag-definitions.h
M src/string.js
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
713ce0f50184679732b4306acb5b371296e55424..b88c9dea014eb1002266f83c8054aa0d730b4339
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -216,7 +216,7 @@ DEFINE_bool(weighted_back_edges, false,
"weight back edges by jump distance for interrupt triggering")
DEFINE_int(interrupt_budget, 5900,
"execution budget before interrupt is triggered")
-DEFINE_int(type_info_threshold, 40,
+DEFINE_int(type_info_threshold, 15,
"percentage of ICs that must have type info to allow
optimization")
DEFINE_int(self_opt_count, 130, "call count before self-optimization")
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index
02f5c98cd3aee7eefe5965953c6420feb1237442..3caaff43df91563faac196fd2d1a83bdb6fd200d
100644
--- a/src/string.js
+++ b/src/string.js
@@ -554,14 +554,14 @@ function StringSlice(start, end) {
}
} else {
if (start_i > s_len) {
- start_i = s_len;
+ return '';
}
}
if (end_i < 0) {
end_i += s_len;
if (end_i < 0) {
- end_i = 0;
+ return '';
}
} else {
if (end_i > s_len) {
@@ -569,12 +569,11 @@ function StringSlice(start, end) {
}
}
- var num_c = end_i - start_i;
- if (num_c < 0) {
- num_c = 0;
+ if (end_i <= start_i) {
+ return '';
}
- return SubString(s, start_i, start_i + num_c);
+ return SubString(s, start_i, end_i);
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev