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/code-serializer.h" | 5 #include "src/snapshot/code-serializer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/log.h" | 10 #include "src/log.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 case Code::FUNCTION: | 91 case Code::FUNCTION: |
92 DCHECK(code_object->has_reloc_info_for_serialization()); | 92 DCHECK(code_object->has_reloc_info_for_serialization()); |
93 SerializeGeneric(code_object, how_to_code, where_to_point); | 93 SerializeGeneric(code_object, how_to_code, where_to_point); |
94 return; | 94 return; |
95 default: | 95 default: |
96 return SerializeCodeObject(code_object, how_to_code, where_to_point); | 96 return SerializeCodeObject(code_object, how_to_code, where_to_point); |
97 } | 97 } |
98 UNREACHABLE(); | 98 UNREACHABLE(); |
99 } | 99 } |
100 | 100 |
101 if (SkipOver(obj)) { | |
102 return SerializeGeneric(*isolate()->factory()->undefined_value(), | |
bradnelson
2016/09/02 16:56:59
So the links contain undefined when serialized?
Mircea Trofin
2016/09/02 20:55:30
Yes. The module obtained by deserializing this is
| |
103 how_to_code, where_to_point); | |
104 } | |
101 // Past this point we should not see any (context-specific) maps anymore. | 105 // Past this point we should not see any (context-specific) maps anymore. |
102 CHECK(!obj->IsMap()); | 106 CHECK(!obj->IsMap()); |
103 // There should be no references to the global object embedded. | 107 // There should be no references to the global object embedded. |
104 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); | 108 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); |
105 // There should be no hash table embedded. They would require rehashing. | 109 // There should be no hash table embedded. They would require rehashing. |
106 CHECK(!obj->IsHashTable()); | 110 CHECK(!obj->IsHashTable()); |
107 // We expect no instantiated function objects or contexts. | 111 // We expect no instantiated function objects or contexts. |
108 CHECK(!obj->IsJSFunction() && !obj->IsContext()); | 112 CHECK(!obj->IsJSFunction() && !obj->IsContext()); |
109 | 113 |
110 SerializeGeneric(obj, how_to_code, where_to_point); | 114 SerializeGeneric(obj, how_to_code, where_to_point); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
405 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); | 409 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); |
406 if (*rejection_result != CHECK_SUCCESS) { | 410 if (*rejection_result != CHECK_SUCCESS) { |
407 cached_data->Reject(); | 411 cached_data->Reject(); |
408 return SerializedCodeData(nullptr, 0); | 412 return SerializedCodeData(nullptr, 0); |
409 } | 413 } |
410 return scd; | 414 return scd; |
411 } | 415 } |
412 | 416 |
413 } // namespace internal | 417 } // namespace internal |
414 } // namespace v8 | 418 } // namespace v8 |
OLD | NEW |