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 10580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10591 set_opt_count(0); | 10591 set_opt_count(0); |
10592 set_deopt_count(0); | 10592 set_deopt_count(0); |
10593 } | 10593 } |
10594 } | 10594 } |
10595 | 10595 |
10596 | 10596 |
10597 CodeAndLiterals SharedFunctionInfo::SearchOptimizedCodeMap( | 10597 CodeAndLiterals SharedFunctionInfo::SearchOptimizedCodeMap( |
10598 Context* native_context, BailoutId osr_ast_id) { | 10598 Context* native_context, BailoutId osr_ast_id) { |
10599 DisallowHeapAllocation no_gc; | 10599 DisallowHeapAllocation no_gc; |
10600 DCHECK(native_context->IsNativeContext()); | 10600 DCHECK(native_context->IsNativeContext()); |
10601 if (!FLAG_cache_optimized_code) return {nullptr, nullptr}; | |
10602 Object* value = optimized_code_map(); | 10601 Object* value = optimized_code_map(); |
10603 if (!value->IsSmi()) { | 10602 if (!value->IsSmi()) { |
10604 FixedArray* optimized_code_map = FixedArray::cast(value); | 10603 FixedArray* optimized_code_map = FixedArray::cast(value); |
10605 int length = optimized_code_map->length(); | 10604 int length = optimized_code_map->length(); |
10606 Smi* osr_ast_id_smi = Smi::FromInt(osr_ast_id.ToInt()); | 10605 Smi* osr_ast_id_smi = Smi::FromInt(osr_ast_id.ToInt()); |
10607 for (int i = kEntriesStart; i < length; i += kEntryLength) { | 10606 for (int i = kEntriesStart; i < length; i += kEntryLength) { |
10608 if (optimized_code_map->get(i + kContextOffset) == native_context && | 10607 if (optimized_code_map->get(i + kContextOffset) == native_context && |
10609 optimized_code_map->get(i + kOsrAstIdOffset) == osr_ast_id_smi) { | 10608 optimized_code_map->get(i + kOsrAstIdOffset) == osr_ast_id_smi) { |
10610 return {Code::cast(optimized_code_map->get(i + kCachedCodeOffset)), | 10609 return {Code::cast(optimized_code_map->get(i + kCachedCodeOffset)), |
10611 FixedArray::cast(optimized_code_map->get(i + kLiteralsOffset))}; | 10610 FixedArray::cast(optimized_code_map->get(i + kLiteralsOffset))}; |
(...skipping 5606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16218 Handle<Object> new_value) { | 16217 Handle<Object> new_value) { |
16219 if (cell->value() != *new_value) { | 16218 if (cell->value() != *new_value) { |
16220 cell->set_value(*new_value); | 16219 cell->set_value(*new_value); |
16221 Isolate* isolate = cell->GetIsolate(); | 16220 Isolate* isolate = cell->GetIsolate(); |
16222 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16221 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16223 isolate, DependentCode::kPropertyCellChangedGroup); | 16222 isolate, DependentCode::kPropertyCellChangedGroup); |
16224 } | 16223 } |
16225 } | 16224 } |
16226 } // namespace internal | 16225 } // namespace internal |
16227 } // namespace v8 | 16226 } // namespace v8 |
OLD | NEW |