OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/snapshot/startup-serializer.h" | 5 #include "src/snapshot/startup-serializer.h" |
6 | 6 |
7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 #include "src/v8threads.h" | 8 #include "src/v8threads.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 16 matching lines...) Loading... |
27 WhereToPoint where_to_point, int skip) { | 27 WhereToPoint where_to_point, int skip) { |
28 DCHECK(!obj->IsJSFunction()); | 28 DCHECK(!obj->IsJSFunction()); |
29 | 29 |
30 if (function_code_handling_ == CLEAR_FUNCTION_CODE) { | 30 if (function_code_handling_ == CLEAR_FUNCTION_CODE) { |
31 if (obj->IsCode()) { | 31 if (obj->IsCode()) { |
32 Code* code = Code::cast(obj); | 32 Code* code = Code::cast(obj); |
33 // If the function code is compiled (either as native code or bytecode), | 33 // If the function code is compiled (either as native code or bytecode), |
34 // replace it with lazy-compile builtin. Only exception is when we are | 34 // replace it with lazy-compile builtin. Only exception is when we are |
35 // serializing the canonical interpreter-entry-trampoline builtin. | 35 // serializing the canonical interpreter-entry-trampoline builtin. |
36 if (code->kind() == Code::FUNCTION || | 36 if (code->kind() == Code::FUNCTION || |
37 (!serializing_builtins_ && code->is_interpreter_entry_trampoline())) { | 37 (!serializing_builtins_ && |
| 38 code->is_interpreter_trampoline_builtin())) { |
38 obj = isolate()->builtins()->builtin(Builtins::kCompileLazy); | 39 obj = isolate()->builtins()->builtin(Builtins::kCompileLazy); |
39 } | 40 } |
40 } else if (obj->IsBytecodeArray()) { | 41 } else if (obj->IsBytecodeArray()) { |
41 obj = isolate()->heap()->undefined_value(); | 42 obj = isolate()->heap()->undefined_value(); |
42 } | 43 } |
43 } else if (obj->IsCode()) { | 44 } else if (obj->IsCode()) { |
44 DCHECK_EQ(KEEP_FUNCTION_CODE, function_code_handling_); | 45 DCHECK_EQ(KEEP_FUNCTION_CODE, function_code_handling_); |
45 Code* code = Code::cast(obj); | 46 Code* code = Code::cast(obj); |
46 if (code->kind() == Code::FUNCTION) { | 47 if (code->kind() == Code::FUNCTION) { |
47 code->ClearInlineCaches(); | 48 code->ClearInlineCaches(); |
(...skipping 110 matching lines...) Loading... |
158 if (root_index == Heap::kStackLimitRootIndex || | 159 if (root_index == Heap::kStackLimitRootIndex || |
159 root_index == Heap::kRealStackLimitRootIndex) { | 160 root_index == Heap::kRealStackLimitRootIndex) { |
160 return true; | 161 return true; |
161 } | 162 } |
162 return Heap::RootIsImmortalImmovable(root_index) != | 163 return Heap::RootIsImmortalImmovable(root_index) != |
163 serializing_immortal_immovables_roots_; | 164 serializing_immortal_immovables_roots_; |
164 } | 165 } |
165 | 166 |
166 } // namespace internal | 167 } // namespace internal |
167 } // namespace v8 | 168 } // namespace v8 |
OLD | NEW |