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 9521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9532 int old_length; | 9532 int old_length; |
9533 if (value->IsSmi()) { | 9533 if (value->IsSmi()) { |
9534 // No optimized code map. | 9534 // No optimized code map. |
9535 DCHECK_EQ(0, Smi::cast(*value)->value()); | 9535 DCHECK_EQ(0, Smi::cast(*value)->value()); |
9536 new_code_map = isolate->factory()->NewFixedArray(kInitialLength); | 9536 new_code_map = isolate->factory()->NewFixedArray(kInitialLength); |
9537 old_length = kEntriesStart; | 9537 old_length = kEntriesStart; |
9538 } else { | 9538 } else { |
9539 // Copy old map and append one new entry. | 9539 // Copy old map and append one new entry. |
9540 Handle<FixedArray> old_code_map = Handle<FixedArray>::cast(value); | 9540 Handle<FixedArray> old_code_map = Handle<FixedArray>::cast(value); |
9541 DCHECK(!shared->SearchOptimizedCodeMap(*native_context, osr_ast_id).code); | 9541 DCHECK(!shared->SearchOptimizedCodeMap(*native_context, osr_ast_id).code); |
| 9542 new_code_map = |
| 9543 isolate->factory()->CopyFixedArrayAndGrow(old_code_map, kEntryLength); |
9542 old_length = old_code_map->length(); | 9544 old_length = old_code_map->length(); |
9543 new_code_map = FixedArray::CopySize( | |
9544 old_code_map, old_length + kEntryLength); | |
9545 // Zap the old map for the sake of the heap verifier. | 9545 // Zap the old map for the sake of the heap verifier. |
9546 if (Heap::ShouldZapGarbage()) { | 9546 if (Heap::ShouldZapGarbage()) { |
9547 Object** data = old_code_map->data_start(); | 9547 Object** data = old_code_map->data_start(); |
9548 MemsetPointer(data, isolate->heap()->the_hole_value(), old_length); | 9548 MemsetPointer(data, isolate->heap()->the_hole_value(), old_length); |
9549 } | 9549 } |
9550 } | 9550 } |
9551 new_code_map->set(old_length + kContextOffset, *native_context); | 9551 new_code_map->set(old_length + kContextOffset, *native_context); |
9552 new_code_map->set(old_length + kCachedCodeOffset, *code); | 9552 new_code_map->set(old_length + kCachedCodeOffset, *code); |
9553 new_code_map->set(old_length + kLiteralsOffset, *literals); | 9553 new_code_map->set(old_length + kLiteralsOffset, *literals); |
9554 new_code_map->set(old_length + kOsrAstIdOffset, | 9554 new_code_map->set(old_length + kOsrAstIdOffset, |
(...skipping 6323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15878 if (cell->value() != *new_value) { | 15878 if (cell->value() != *new_value) { |
15879 cell->set_value(*new_value); | 15879 cell->set_value(*new_value); |
15880 Isolate* isolate = cell->GetIsolate(); | 15880 Isolate* isolate = cell->GetIsolate(); |
15881 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15881 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
15882 isolate, DependentCode::kPropertyCellChangedGroup); | 15882 isolate, DependentCode::kPropertyCellChangedGroup); |
15883 } | 15883 } |
15884 } | 15884 } |
15885 | 15885 |
15886 } // namespace internal | 15886 } // namespace internal |
15887 } // namespace v8 | 15887 } // namespace v8 |
OLD | NEW |