| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return; | 66 if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return; |
| 67 | 67 |
| 68 FlushSkip(skip); | 68 FlushSkip(skip); |
| 69 | 69 |
| 70 if (isolate_->external_reference_redirector() && obj->IsAccessorInfo()) { | 70 if (isolate_->external_reference_redirector() && obj->IsAccessorInfo()) { |
| 71 // Wipe external reference redirects in the accessor info. | 71 // Wipe external reference redirects in the accessor info. |
| 72 AccessorInfo* info = AccessorInfo::cast(obj); | 72 AccessorInfo* info = AccessorInfo::cast(obj); |
| 73 Address original_address = Foreign::cast(info->getter())->foreign_address(); | 73 Address original_address = Foreign::cast(info->getter())->foreign_address(); |
| 74 Foreign::cast(info->js_getter())->set_foreign_address(original_address); | 74 Foreign::cast(info->js_getter())->set_foreign_address(original_address); |
| 75 accessor_infos_.Add(info); | 75 accessor_infos_.Add(info); |
| 76 } else if (obj->IsScript() && Script::cast(obj)->IsUserJavaScript()) { |
| 77 // Reset type for user scripts embedded in the start-up snapshot to hide |
| 78 // them from the debugger. |
| 79 Script::cast(obj)->set_type(Script::TYPE_EXTENSION); |
| 76 } | 80 } |
| 77 | 81 |
| 78 // Object has not yet been serialized. Serialize it here. | 82 // Object has not yet been serialized. Serialize it here. |
| 79 ObjectSerializer object_serializer(this, obj, &sink_, how_to_code, | 83 ObjectSerializer object_serializer(this, obj, &sink_, how_to_code, |
| 80 where_to_point); | 84 where_to_point); |
| 81 object_serializer.Serialize(); | 85 object_serializer.Serialize(); |
| 82 | 86 |
| 83 if (serializing_immortal_immovables_roots_ && | 87 if (serializing_immortal_immovables_roots_ && |
| 84 root_index != RootIndexMap::kInvalidRootIndex) { | 88 root_index != RootIndexMap::kInvalidRootIndex) { |
| 85 // Make sure that the immortal immovable root has been included in the first | 89 // Make sure that the immortal immovable root has been included in the first |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 if (root_index == Heap::kStackLimitRootIndex || | 183 if (root_index == Heap::kStackLimitRootIndex || |
| 180 root_index == Heap::kRealStackLimitRootIndex) { | 184 root_index == Heap::kRealStackLimitRootIndex) { |
| 181 return true; | 185 return true; |
| 182 } | 186 } |
| 183 return Heap::RootIsImmortalImmovable(root_index) != | 187 return Heap::RootIsImmortalImmovable(root_index) != |
| 184 serializing_immortal_immovables_roots_; | 188 serializing_immortal_immovables_roots_; |
| 185 } | 189 } |
| 186 | 190 |
| 187 } // namespace internal | 191 } // namespace internal |
| 188 } // namespace v8 | 192 } // namespace v8 |
| OLD | NEW |