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

Side by Side Diff: src/heap-inl.h

Issue 1079012: Fix pop push optimization to work with partial snapshots (correct... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 | Annotate | Revision Log
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 Object* Heap::PrepareForCompare(String* str) { 277 Object* Heap::PrepareForCompare(String* str) {
278 // Always flatten small strings and force flattening of long strings 278 // Always flatten small strings and force flattening of long strings
279 // after we have accumulated a certain amount we failed to flatten. 279 // after we have accumulated a certain amount we failed to flatten.
280 static const int kMaxAlwaysFlattenLength = 32; 280 static const int kMaxAlwaysFlattenLength = 32;
281 static const int kFlattenLongThreshold = 16*KB; 281 static const int kFlattenLongThreshold = 16*KB;
282 282
283 const int length = str->length(); 283 const int length = str->length();
284 Object* obj = str->TryFlatten(); 284 Object* obj = str->TryFlatten();
285 if (length <= kMaxAlwaysFlattenLength || 285 if (length <= kMaxAlwaysFlattenLength ||
286 unflattended_strings_length_ >= kFlattenLongThreshold) { 286 unflattened_strings_length_ >= kFlattenLongThreshold) {
287 return obj; 287 return obj;
288 } 288 }
289 if (obj->IsFailure()) { 289 if (obj->IsFailure()) {
290 unflattended_strings_length_ += length; 290 unflattened_strings_length_ += length;
291 } 291 }
292 return str; 292 return str;
293 } 293 }
294 294
295 295
296 int Heap::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) { 296 int Heap::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) {
297 ASSERT(HasBeenSetup()); 297 ASSERT(HasBeenSetup());
298 int amount = amount_of_external_allocated_memory_ + change_in_bytes; 298 int amount = amount_of_external_allocated_memory_ + change_in_bytes;
299 if (change_in_bytes >= 0) { 299 if (change_in_bytes >= 0) {
300 // Avoid overflow. 300 // Avoid overflow.
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 434
435 435
436 void ExternalStringTable::ShrinkNewStrings(int position) { 436 void ExternalStringTable::ShrinkNewStrings(int position) {
437 new_space_strings_.Rewind(position); 437 new_space_strings_.Rewind(position);
438 Verify(); 438 Verify();
439 } 439 }
440 440
441 } } // namespace v8::internal 441 } } // namespace v8::internal
442 442
443 #endif // V8_HEAP_INL_H_ 443 #endif // V8_HEAP_INL_H_
OLDNEW
« src/assembler.h ('K') | « src/heap.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698