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 "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 11017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11028 } | 11028 } |
11029 set_code_no_write_barrier( | 11029 set_code_no_write_barrier( |
11030 isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); | 11030 isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); |
11031 // No write barrier required, since the builtin is part of the root set. | 11031 // No write barrier required, since the builtin is part of the root set. |
11032 } | 11032 } |
11033 | 11033 |
11034 | 11034 |
11035 void SharedFunctionInfo::AddSharedCodeToOptimizedCodeMap( | 11035 void SharedFunctionInfo::AddSharedCodeToOptimizedCodeMap( |
11036 Handle<SharedFunctionInfo> shared, Handle<Code> code) { | 11036 Handle<SharedFunctionInfo> shared, Handle<Code> code) { |
11037 Isolate* isolate = shared->GetIsolate(); | 11037 Isolate* isolate = shared->GetIsolate(); |
| 11038 if (isolate->serializer_enabled()) return; |
11038 DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION); | 11039 DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION); |
11039 Handle<Object> value(shared->optimized_code_map(), isolate); | 11040 Handle<Object> value(shared->optimized_code_map(), isolate); |
11040 if (value->IsSmi()) return; // Empty code maps are unsupported. | 11041 if (value->IsSmi()) return; // Empty code maps are unsupported. |
11041 Handle<FixedArray> code_map = Handle<FixedArray>::cast(value); | 11042 Handle<FixedArray> code_map = Handle<FixedArray>::cast(value); |
11042 code_map->set(kSharedCodeIndex, *code); | 11043 code_map->set(kSharedCodeIndex, *code); |
11043 } | 11044 } |
11044 | 11045 |
11045 | 11046 |
11046 void SharedFunctionInfo::AddToOptimizedCodeMap( | 11047 void SharedFunctionInfo::AddToOptimizedCodeMap( |
11047 Handle<SharedFunctionInfo> shared, Handle<Context> native_context, | 11048 Handle<SharedFunctionInfo> shared, Handle<Context> native_context, |
11048 Handle<HeapObject> code, Handle<LiteralsArray> literals, | 11049 Handle<HeapObject> code, Handle<LiteralsArray> literals, |
11049 BailoutId osr_ast_id) { | 11050 BailoutId osr_ast_id) { |
11050 Isolate* isolate = shared->GetIsolate(); | 11051 Isolate* isolate = shared->GetIsolate(); |
| 11052 if (isolate->serializer_enabled()) return; |
11051 DCHECK(*code == isolate->heap()->undefined_value() || | 11053 DCHECK(*code == isolate->heap()->undefined_value() || |
11052 !shared->SearchOptimizedCodeMap(*native_context, osr_ast_id).code); | 11054 !shared->SearchOptimizedCodeMap(*native_context, osr_ast_id).code); |
11053 DCHECK(*code == isolate->heap()->undefined_value() || | 11055 DCHECK(*code == isolate->heap()->undefined_value() || |
11054 Code::cast(*code)->kind() == Code::OPTIMIZED_FUNCTION); | 11056 Code::cast(*code)->kind() == Code::OPTIMIZED_FUNCTION); |
11055 DCHECK(native_context->IsNativeContext()); | 11057 DCHECK(native_context->IsNativeContext()); |
11056 STATIC_ASSERT(kEntryLength == 4); | 11058 STATIC_ASSERT(kEntryLength == 4); |
11057 Handle<FixedArray> new_code_map; | 11059 Handle<FixedArray> new_code_map; |
11058 Handle<Object> value(shared->optimized_code_map(), isolate); | 11060 Handle<Object> value(shared->optimized_code_map(), isolate); |
11059 int entry; | 11061 int entry; |
11060 if (value->IsSmi()) { | 11062 if (value->IsSmi()) { |
(...skipping 6819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17880 if (cell->value() != *new_value) { | 17882 if (cell->value() != *new_value) { |
17881 cell->set_value(*new_value); | 17883 cell->set_value(*new_value); |
17882 Isolate* isolate = cell->GetIsolate(); | 17884 Isolate* isolate = cell->GetIsolate(); |
17883 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17885 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17884 isolate, DependentCode::kPropertyCellChangedGroup); | 17886 isolate, DependentCode::kPropertyCellChangedGroup); |
17885 } | 17887 } |
17886 } | 17888 } |
17887 | 17889 |
17888 } // namespace internal | 17890 } // namespace internal |
17889 } // namespace v8 | 17891 } // namespace v8 |
OLD | NEW |