OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3383 Object* result; | 3383 Object* result; |
3384 OneByteStringKey key(Vector<const uint8_t>(buffer, 1), HashSeed()); | 3384 OneByteStringKey key(Vector<const uint8_t>(buffer, 1), HashSeed()); |
3385 MaybeObject* maybe_result = InternalizeStringWithKey(&key); | 3385 MaybeObject* maybe_result = InternalizeStringWithKey(&key); |
3386 | 3386 |
3387 if (!maybe_result->ToObject(&result)) return maybe_result; | 3387 if (!maybe_result->ToObject(&result)) return maybe_result; |
3388 single_character_string_cache()->set(code, result); | 3388 single_character_string_cache()->set(code, result); |
3389 return result; | 3389 return result; |
3390 } | 3390 } |
3391 | 3391 |
3392 SeqTwoByteString* result; | 3392 SeqTwoByteString* result; |
3393 { MaybeObject* maybe_result = AllocateRawTwoByteString(1); | 3393 { MaybeObject* maybe_result = AllocateRawTwoByteString(1, NOT_TENURED); |
3394 if (!maybe_result->To<SeqTwoByteString>(&result)) return maybe_result; | 3394 if (!maybe_result->To<SeqTwoByteString>(&result)) return maybe_result; |
3395 } | 3395 } |
3396 result->SeqTwoByteStringSet(0, code); | 3396 result->SeqTwoByteStringSet(0, code); |
3397 return result; | 3397 return result; |
3398 } | 3398 } |
3399 | 3399 |
3400 | 3400 |
3401 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) { | 3401 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) { |
3402 if (length < 0 || length > ByteArray::kMaxLength) { | 3402 if (length < 0 || length > ByteArray::kMaxLength) { |
3403 v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true); | 3403 v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true); |
(...skipping 3313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6717 static_cast<int>(object_sizes_last_time_[index])); | 6717 static_cast<int>(object_sizes_last_time_[index])); |
6718 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6718 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6719 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6719 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6720 | 6720 |
6721 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6721 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6722 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6722 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6723 ClearObjectStats(); | 6723 ClearObjectStats(); |
6724 } | 6724 } |
6725 | 6725 |
6726 } } // namespace v8::internal | 6726 } } // namespace v8::internal |
OLD | NEW |