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

Side by Side Diff: src/heap.cc

Issue 6525: Calculate string hash during flattening. (Closed)
Patch Set: Created 12 years, 2 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/objects.h » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2244 Object* symbol = NULL; 2244 Object* symbol = NULL;
2245 Object* new_table = 2245 Object* new_table =
2246 SymbolTable::cast(symbol_table_)->LookupString(string, &symbol); 2246 SymbolTable::cast(symbol_table_)->LookupString(string, &symbol);
2247 if (new_table->IsFailure()) return new_table; 2247 if (new_table->IsFailure()) return new_table;
2248 symbol_table_ = new_table; 2248 symbol_table_ = new_table;
2249 ASSERT(symbol != NULL); 2249 ASSERT(symbol != NULL);
2250 return symbol; 2250 return symbol;
2251 } 2251 }
2252 2252
2253 2253
2254 bool Heap::LookupSymbolIfExists(String* string, String** symbol) {
2255 if (string->IsSymbol()) {
2256 *symbol = string;
2257 return true;
2258 }
2259 SymbolTable* table = SymbolTable::cast(symbol_table_);
2260 return table->LookupSymbolIfExists(string, symbol);
2261 }
2262
2263
2254 #ifdef DEBUG 2264 #ifdef DEBUG
2255 void Heap::ZapFromSpace() { 2265 void Heap::ZapFromSpace() {
2256 ASSERT(HAS_HEAP_OBJECT_TAG(kFromSpaceZapValue)); 2266 ASSERT(HAS_HEAP_OBJECT_TAG(kFromSpaceZapValue));
2257 for (Address a = new_space_->FromSpaceLow(); 2267 for (Address a = new_space_->FromSpaceLow();
2258 a < new_space_->FromSpaceHigh(); 2268 a < new_space_->FromSpaceHigh();
2259 a += kPointerSize) { 2269 a += kPointerSize) {
2260 Memory::Address_at(a) = kFromSpaceZapValue; 2270 Memory::Address_at(a) = kFromSpaceZapValue;
2261 } 2271 }
2262 } 2272 }
2263 #endif // DEBUG 2273 #endif // DEBUG
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 return "Scavenge"; 3045 return "Scavenge";
3036 case MARK_COMPACTOR: 3046 case MARK_COMPACTOR:
3037 return MarkCompactCollector::HasCompacted() ? "Mark-compact" 3047 return MarkCompactCollector::HasCompacted() ? "Mark-compact"
3038 : "Mark-sweep"; 3048 : "Mark-sweep";
3039 } 3049 }
3040 return "Unknown GC"; 3050 return "Unknown GC";
3041 } 3051 }
3042 3052
3043 3053
3044 } } // namespace v8::internal 3054 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698