| 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 SerializeObject(*isolate()->factory()->undefined_value(), | |
| 103 how_to_code, where_to_point, skip); | |
| 104 } | |
| 105 // Past this point we should not see any (context-specific) maps anymore. | 101 // Past this point we should not see any (context-specific) maps anymore. |
| 106 CHECK(!obj->IsMap()); | 102 CHECK(!obj->IsMap()); |
| 107 // There should be no references to the global object embedded. | 103 // There should be no references to the global object embedded. |
| 108 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); | 104 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); |
| 109 // There should be no hash table embedded. They would require rehashing. | 105 // There should be no hash table embedded. They would require rehashing. |
| 110 CHECK(!obj->IsHashTable()); | 106 CHECK(!obj->IsHashTable()); |
| 111 // We expect no instantiated function objects or contexts. | 107 // We expect no instantiated function objects or contexts. |
| 112 CHECK(!obj->IsJSFunction() && !obj->IsContext()); | 108 CHECK(!obj->IsJSFunction() && !obj->IsContext()); |
| 113 | 109 |
| 114 SerializeGeneric(obj, how_to_code, where_to_point); | 110 SerializeGeneric(obj, how_to_code, where_to_point); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); | 405 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); |
| 410 if (*rejection_result != CHECK_SUCCESS) { | 406 if (*rejection_result != CHECK_SUCCESS) { |
| 411 cached_data->Reject(); | 407 cached_data->Reject(); |
| 412 return SerializedCodeData(nullptr, 0); | 408 return SerializedCodeData(nullptr, 0); |
| 413 } | 409 } |
| 414 return scd; | 410 return scd; |
| 415 } | 411 } |
| 416 | 412 |
| 417 } // namespace internal | 413 } // namespace internal |
| 418 } // namespace v8 | 414 } // namespace v8 |
| OLD | NEW |