OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 7887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7898 { MaybeObject* maybe_obj = key.AsObject(GetHeap()); | 7898 { MaybeObject* maybe_obj = key.AsObject(GetHeap()); |
7899 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 7899 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
7900 } | 7900 } |
7901 cache->set(EntryToIndex(entry), obj); | 7901 cache->set(EntryToIndex(entry), obj); |
7902 cache->set(EntryToIndex(entry) + 1, code); | 7902 cache->set(EntryToIndex(entry) + 1, code); |
7903 cache->ElementAdded(); | 7903 cache->ElementAdded(); |
7904 return cache; | 7904 return cache; |
7905 } | 7905 } |
7906 | 7906 |
7907 | 7907 |
| 7908 void FixedArray::Shrink(int new_length) { |
| 7909 ASSERT(0 <= new_length && new_length <= length()); |
| 7910 if (new_length < length()) { |
| 7911 RightTrimFixedArray<FROM_MUTATOR>(GetHeap(), this, length() - new_length); |
| 7912 } |
| 7913 } |
| 7914 |
| 7915 |
7908 MaybeObject* FixedArray::AddKeysFromJSArray(JSArray* array) { | 7916 MaybeObject* FixedArray::AddKeysFromJSArray(JSArray* array) { |
7909 ElementsAccessor* accessor = array->GetElementsAccessor(); | 7917 ElementsAccessor* accessor = array->GetElementsAccessor(); |
7910 MaybeObject* maybe_result = | 7918 MaybeObject* maybe_result = |
7911 accessor->AddElementsToFixedArray(array, array, this); | 7919 accessor->AddElementsToFixedArray(array, array, this); |
7912 FixedArray* result; | 7920 FixedArray* result; |
7913 if (!maybe_result->To<FixedArray>(&result)) return maybe_result; | 7921 if (!maybe_result->To<FixedArray>(&result)) return maybe_result; |
7914 #ifdef ENABLE_SLOW_ASSERTS | 7922 #ifdef ENABLE_SLOW_ASSERTS |
7915 if (FLAG_enable_slow_asserts) { | 7923 if (FLAG_enable_slow_asserts) { |
7916 for (int i = 0; i < result->length(); i++) { | 7924 for (int i = 0; i < result->length(); i++) { |
7917 Object* current = result->get(i); | 7925 Object* current = result->get(i); |
(...skipping 8676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16594 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16602 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16595 static const char* error_messages_[] = { | 16603 static const char* error_messages_[] = { |
16596 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16604 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16597 }; | 16605 }; |
16598 #undef ERROR_MESSAGES_TEXTS | 16606 #undef ERROR_MESSAGES_TEXTS |
16599 return error_messages_[reason]; | 16607 return error_messages_[reason]; |
16600 } | 16608 } |
16601 | 16609 |
16602 | 16610 |
16603 } } // namespace v8::internal | 16611 } } // namespace v8::internal |
OLD | NEW |