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/partial-serializer.h" | 5 #include "src/snapshot/partial-serializer.h" |
6 #include "src/snapshot/startup-serializer.h" | 6 #include "src/snapshot/startup-serializer.h" |
7 | 7 |
8 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // either in the root table or in the partial snapshot cache. | 86 // either in the root table or in the partial snapshot cache. |
87 DCHECK(!obj->IsInternalizedString()); | 87 DCHECK(!obj->IsInternalizedString()); |
88 // Function and object templates are not context specific. | 88 // Function and object templates are not context specific. |
89 DCHECK(!obj->IsTemplateInfo()); | 89 DCHECK(!obj->IsTemplateInfo()); |
90 | 90 |
91 FlushSkip(skip); | 91 FlushSkip(skip); |
92 | 92 |
93 // Clear literal boilerplates. | 93 // Clear literal boilerplates. |
94 if (obj->IsJSFunction()) { | 94 if (obj->IsJSFunction()) { |
95 JSFunction* function = JSFunction::cast(obj); | 95 JSFunction* function = JSFunction::cast(obj); |
96 LiteralsArray* literals = function->literals(); | |
97 for (int i = 0; i < literals->literals_count(); i++) { | |
98 literals->set_literal_undefined(i); | |
99 } | |
100 function->ClearTypeFeedbackInfo(); | 96 function->ClearTypeFeedbackInfo(); |
101 } | 97 } |
102 | 98 |
103 if (obj->IsJSObject()) { | 99 if (obj->IsJSObject()) { |
104 JSObject* jsobj = JSObject::cast(obj); | 100 JSObject* jsobj = JSObject::cast(obj); |
105 if (jsobj->GetInternalFieldCount() > 0) { | 101 if (jsobj->GetInternalFieldCount() > 0) { |
106 DCHECK_NOT_NULL(serialize_internal_fields_.callback); | 102 DCHECK_NOT_NULL(serialize_internal_fields_.callback); |
107 internal_field_holders_.Add(jsobj); | 103 internal_field_holders_.Add(jsobj); |
108 } | 104 } |
109 } | 105 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, | 147 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, |
152 "internal fields data"); | 148 "internal fields data"); |
153 delete[] data.data; | 149 delete[] data.data; |
154 } | 150 } |
155 } | 151 } |
156 sink_.Put(kSynchronize, "Finished with internal fields data"); | 152 sink_.Put(kSynchronize, "Finished with internal fields data"); |
157 } | 153 } |
158 | 154 |
159 } // namespace internal | 155 } // namespace internal |
160 } // namespace v8 | 156 } // namespace v8 |
OLD | NEW |