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

Side by Side Diff: src/heap.cc

Issue 991002: Add heuristic for flattening strings before comparing them. (Closed)
Patch Set: Created 10 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Will be 4 * reserved_semispace_size_ to ensure that young 107 // Will be 4 * reserved_semispace_size_ to ensure that young
108 // generation can be aligned to its size. 108 // generation can be aligned to its size.
109 int Heap::survived_since_last_expansion_ = 0; 109 int Heap::survived_since_last_expansion_ = 0;
110 int Heap::external_allocation_limit_ = 0; 110 int Heap::external_allocation_limit_ = 0;
111 111
112 Heap::HeapState Heap::gc_state_ = NOT_IN_GC; 112 Heap::HeapState Heap::gc_state_ = NOT_IN_GC;
113 113
114 int Heap::mc_count_ = 0; 114 int Heap::mc_count_ = 0;
115 int Heap::gc_count_ = 0; 115 int Heap::gc_count_ = 0;
116 116
117 int Heap::unflattended_strings_length_ = 0;
118
117 int Heap::always_allocate_scope_depth_ = 0; 119 int Heap::always_allocate_scope_depth_ = 0;
118 int Heap::linear_allocation_scope_depth_ = 0; 120 int Heap::linear_allocation_scope_depth_ = 0;
119 int Heap::contexts_disposed_ = 0; 121 int Heap::contexts_disposed_ = 0;
120 122
121 #ifdef DEBUG 123 #ifdef DEBUG
122 bool Heap::allocation_allowed_ = true; 124 bool Heap::allocation_allowed_ = true;
123 125
124 int Heap::allocation_timeout_ = 0; 126 int Heap::allocation_timeout_ = 0;
125 bool Heap::disallow_allocation_failure_ = false; 127 bool Heap::disallow_allocation_failure_ = false;
126 #endif // DEBUG 128 #endif // DEBUG
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 #elif defined(ENABLE_LOGGING_AND_PROFILING) 297 #elif defined(ENABLE_LOGGING_AND_PROFILING)
296 if (FLAG_log_gc) new_space_.ReportStatistics(); 298 if (FLAG_log_gc) new_space_.ReportStatistics();
297 #endif 299 #endif
298 } 300 }
299 #endif // defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) 301 #endif // defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
300 302
301 303
302 void Heap::GarbageCollectionPrologue() { 304 void Heap::GarbageCollectionPrologue() {
303 TranscendentalCache::Clear(); 305 TranscendentalCache::Clear();
304 gc_count_++; 306 gc_count_++;
307 unflattended_strings_length_ = 0;
305 #ifdef DEBUG 308 #ifdef DEBUG
306 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); 309 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
307 allow_allocation(false); 310 allow_allocation(false);
308 311
309 if (FLAG_verify_heap) { 312 if (FLAG_verify_heap) {
310 Verify(); 313 Verify();
311 } 314 }
312 315
313 if (FLAG_gc_verbose) Print(); 316 if (FLAG_gc_verbose) Print();
314 317
(...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after
4251 void ExternalStringTable::TearDown() { 4254 void ExternalStringTable::TearDown() {
4252 new_space_strings_.Free(); 4255 new_space_strings_.Free();
4253 old_space_strings_.Free(); 4256 old_space_strings_.Free();
4254 } 4257 }
4255 4258
4256 4259
4257 List<Object*> ExternalStringTable::new_space_strings_; 4260 List<Object*> ExternalStringTable::new_space_strings_;
4258 List<Object*> ExternalStringTable::old_space_strings_; 4261 List<Object*> ExternalStringTable::old_space_strings_;
4259 4262
4260 } } // namespace v8::internal 4263 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698