| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 bool PartialSerializer::ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 113 bool PartialSerializer::ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
| 114 // Scripts should be referred only through shared function infos. We can't | 114 // Scripts should be referred only through shared function infos. We can't |
| 115 // allow them to be part of the partial snapshot because they contain a | 115 // allow them to be part of the partial snapshot because they contain a |
| 116 // unique ID, and deserializing several partial snapshots containing script | 116 // unique ID, and deserializing several partial snapshots containing script |
| 117 // would cause dupes. | 117 // would cause dupes. |
| 118 DCHECK(!o->IsScript()); | 118 DCHECK(!o->IsScript()); |
| 119 return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() || | 119 return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() || |
| 120 o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() || | 120 o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() || |
| 121 o->IsTemplateInfo() || |
| 121 o->map() == | 122 o->map() == |
| 122 startup_serializer_->isolate()->heap()->fixed_cow_array_map(); | 123 startup_serializer_->isolate()->heap()->fixed_cow_array_map(); |
| 123 } | 124 } |
| 124 | 125 |
| 125 void PartialSerializer::SerializeInternalFields() { | 126 void PartialSerializer::SerializeInternalFields() { |
| 126 int count = internal_field_holders_.length(); | 127 int count = internal_field_holders_.length(); |
| 127 if (count == 0) return; | 128 if (count == 0) return; |
| 128 DisallowHeapAllocation no_gc; | 129 DisallowHeapAllocation no_gc; |
| 129 DisallowJavascriptExecution no_js(isolate()); | 130 DisallowJavascriptExecution no_js(isolate()); |
| 130 DisallowCompilation no_compile(isolate()); | 131 DisallowCompilation no_compile(isolate()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 146 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, | 147 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, |
| 147 "internal fields data"); | 148 "internal fields data"); |
| 148 delete[] data.data; | 149 delete[] data.data; |
| 149 } | 150 } |
| 150 } | 151 } |
| 151 sink_.Put(kSynchronize, "Finished with internal fields data"); | 152 sink_.Put(kSynchronize, "Finished with internal fields data"); |
| 152 } | 153 } |
| 153 | 154 |
| 154 } // namespace internal | 155 } // namespace internal |
| 155 } // namespace v8 | 156 } // namespace v8 |
| OLD | NEW |