OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 8329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8340 set_last_used_index(0); | 8340 set_last_used_index(0); |
8341 } | 8341 } |
8342 | 8342 |
8343 | 8343 |
8344 bool WeakFixedArray::Remove(Handle<HeapObject> value) { | 8344 bool WeakFixedArray::Remove(Handle<HeapObject> value) { |
8345 if (Length() == 0) return false; | 8345 if (Length() == 0) return false; |
8346 // Optimize for the most recently added element to be removed again. | 8346 // Optimize for the most recently added element to be removed again. |
8347 int first_index = last_used_index(); | 8347 int first_index = last_used_index(); |
8348 for (int i = first_index;;) { | 8348 for (int i = first_index;;) { |
8349 if (Get(i) == *value) { | 8349 if (Get(i) == *value) { |
8350 Clear(i); | 8350 clear(i); |
8351 // Users of WeakFixedArray should make sure that there are no duplicates, | 8351 // Users of WeakFixedArray should make sure that there are no duplicates, |
8352 // they can use Add(..., kAddIfNotFound) if necessary. | 8352 // they can use Add(..., kAddIfNotFound) if necessary. |
8353 return true; | 8353 return true; |
8354 } | 8354 } |
8355 i = (i + 1) % Length(); | 8355 i = (i + 1) % Length(); |
8356 if (i == first_index) return false; | 8356 if (i == first_index) return false; |
8357 } | 8357 } |
8358 UNREACHABLE(); | 8358 UNREACHABLE(); |
8359 } | 8359 } |
8360 | 8360 |
(...skipping 8840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17201 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, | 17201 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
17202 Handle<Object> new_value) { | 17202 Handle<Object> new_value) { |
17203 if (cell->value() != *new_value) { | 17203 if (cell->value() != *new_value) { |
17204 cell->set_value(*new_value); | 17204 cell->set_value(*new_value); |
17205 Isolate* isolate = cell->GetIsolate(); | 17205 Isolate* isolate = cell->GetIsolate(); |
17206 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17206 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17207 isolate, DependentCode::kPropertyCellChangedGroup); | 17207 isolate, DependentCode::kPropertyCellChangedGroup); |
17208 } | 17208 } |
17209 } | 17209 } |
17210 } } // namespace v8::internal | 17210 } } // namespace v8::internal |
OLD | NEW |