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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 default: | 97 default: |
98 return SerializeCodeObject(code_object, how_to_code, where_to_point); | 98 return SerializeCodeObject(code_object, how_to_code, where_to_point); |
99 } | 99 } |
100 UNREACHABLE(); | 100 UNREACHABLE(); |
101 } | 101 } |
102 | 102 |
103 if (ElideObject(obj)) { | 103 if (ElideObject(obj)) { |
104 return SerializeObject(isolate()->heap()->undefined_value(), how_to_code, | 104 return SerializeObject(isolate()->heap()->undefined_value(), how_to_code, |
105 where_to_point, skip); | 105 where_to_point, skip); |
106 } | 106 } |
| 107 |
| 108 if (obj->IsScript()) { |
| 109 // Wrapper object is a context-dependent JSValue. Reset it here. |
| 110 Script::cast(obj)->set_wrapper(isolate()->heap()->undefined_value()); |
| 111 } |
| 112 |
107 // Past this point we should not see any (context-specific) maps anymore. | 113 // Past this point we should not see any (context-specific) maps anymore. |
108 CHECK(!obj->IsMap()); | 114 CHECK(!obj->IsMap()); |
109 // There should be no references to the global object embedded. | 115 // There should be no references to the global object embedded. |
110 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); | 116 CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); |
111 // There should be no hash table embedded. They would require rehashing. | 117 // There should be no hash table embedded. They would require rehashing. |
112 CHECK(!obj->IsHashTable()); | 118 CHECK(!obj->IsHashTable()); |
113 // We expect no instantiated function objects or contexts. | 119 // We expect no instantiated function objects or contexts. |
114 CHECK(!obj->IsJSFunction() && !obj->IsContext()); | 120 CHECK(!obj->IsJSFunction() && !obj->IsContext()); |
115 | 121 |
116 SerializeGeneric(obj, how_to_code, where_to_point); | 122 SerializeGeneric(obj, how_to_code, where_to_point); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); | 435 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); |
430 if (*rejection_result != CHECK_SUCCESS) { | 436 if (*rejection_result != CHECK_SUCCESS) { |
431 cached_data->Reject(); | 437 cached_data->Reject(); |
432 return SerializedCodeData(nullptr, 0); | 438 return SerializedCodeData(nullptr, 0); |
433 } | 439 } |
434 return scd; | 440 return scd; |
435 } | 441 } |
436 | 442 |
437 } // namespace internal | 443 } // namespace internal |
438 } // namespace v8 | 444 } // namespace v8 |
OLD | NEW |