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

Unified Diff: src/isolate.h

Issue 6991007: Don't flatten every time we call CharCodeAt Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle flat cons string. Flatten entire string. Created 9 years, 7 months 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 | « src/handles.cc ('k') | src/isolate.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 088c2478e6d3229033fd3e34984f9e77c8d055de..48fa22c9318f0ff411174cc1e477e7415bcdae9a 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -994,6 +994,14 @@ class Isolate {
void ResetEagerOptimizingData();
+ bool ShouldFlattenString() {
+ if (--flatten_counter_ > 0) {
+ return false;
+ }
+ flatten_counter_ = kStringFlattenInterval;
+ return true;
+ }
+
private:
Isolate();
@@ -1157,6 +1165,9 @@ class Isolate {
ZoneObjectList frame_element_constant_list_;
ZoneObjectList result_constant_list_;
+ static const int kStringFlattenInterval = 257;
+ int flatten_counter_;
+
#if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \
defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__)
bool simulator_initialized_;
« no previous file with comments | « src/handles.cc ('k') | src/isolate.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698