Overwrite the handler using Set.

InsertAt apparently inserts by moving the other elements... that does not work.

Review URL: https://chromiumcodereview.appspot.com/14566007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2013-05-03 08:48:53 +00:00
parent 915f9ea500
commit 984122a7ea
3 changed files with 11 additions and 1 deletions

View File

@ -1022,7 +1022,7 @@ bool IC::UpdatePolymorphicIC(State state,
number_of_valid_maps++;
if (handler_to_overwrite >= 0) {
handlers.InsertAt(handler_to_overwrite, code);
handlers.Set(handler_to_overwrite, code);
} else {
receiver_maps.Add(new_receiver_map);
handlers.Add(code);

View File

@ -103,6 +103,13 @@ Vector<T> List<T, P>::AddBlock(T value, int count, P alloc) {
}
template<typename T, class P>
void List<T, P>::Set(int index, const T& elm) {
ASSERT(index >= 0 && index <= length_);
data_[index] = elm;
}
template<typename T, class P>
void List<T, P>::InsertAt(int index, const T& elm, P alloc) {
ASSERT(index >= 0 && index <= length_);

View File

@ -115,6 +115,9 @@ class List {
void InsertAt(int index, const T& element,
AllocationPolicy allocator = AllocationPolicy());
// Overwrites the element at the specific index.
void Set(int index, const T& element);
// Added 'count' elements with the value 'value' and returns a
// vector that allows access to the elements. The vector is valid
// until the next change is made to this list.