| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 DCHECK(code_object->has_reloc_info_for_serialization()); | 93 DCHECK(code_object->has_reloc_info_for_serialization()); |
| 94 SerializeGeneric(code_object, how_to_code, where_to_point); | 94 SerializeGeneric(code_object, how_to_code, where_to_point); |
| 95 return; | 95 return; |
| 96 default: | 96 default: |
| 97 return SerializeCodeObject(code_object, how_to_code, where_to_point); | 97 return SerializeCodeObject(code_object, how_to_code, where_to_point); |
| 98 } | 98 } |
| 99 UNREACHABLE(); | 99 UNREACHABLE(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 if (ElideObject(obj)) { | 102 if (ElideObject(obj)) { |
| 103 return SerializeObject(*isolate()->factory()->undefined_value(), | 103 return SerializeObject(isolate()->heap()->undefined_value(), how_to_code, |
| 104 how_to_code, where_to_point, skip); | 104 where_to_point, skip); |
| 105 } | 105 } |
| 106 // Past this point we should not see any (context-specific) maps anymore. | 106 // Past this point we should not see any (context-specific) maps anymore. |
| 107 CHECK(!obj->IsMap()); | 107 CHECK(!obj->IsMap()); |
| 108 // There should be no references to the global object embedded. | 108 // There should be no references to the global object embedded. |
| 109 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); | 109 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); |
| 110 // There should be no hash table embedded. They would require rehashing. | 110 // There should be no hash table embedded. They would require rehashing. |
| 111 CHECK(!obj->IsHashTable()); | 111 CHECK(!obj->IsHashTable()); |
| 112 // We expect no instantiated function objects or contexts. | 112 // We expect no instantiated function objects or contexts. |
| 113 CHECK(!obj->IsJSFunction() && !obj->IsContext()); | 113 CHECK(!obj->IsJSFunction() && !obj->IsContext()); |
| 114 | 114 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); | 428 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); |
| 429 if (*rejection_result != CHECK_SUCCESS) { | 429 if (*rejection_result != CHECK_SUCCESS) { |
| 430 cached_data->Reject(); | 430 cached_data->Reject(); |
| 431 return SerializedCodeData(nullptr, 0); | 431 return SerializedCodeData(nullptr, 0); |
| 432 } | 432 } |
| 433 return scd; | 433 return scd; |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace internal | 436 } // namespace internal |
| 437 } // namespace v8 | 437 } // namespace v8 |
| OLD | NEW |