Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/snapshot/code-serializer.cc

Issue 2305903002: [wasm] reuse the first compiled module (Closed)
Patch Set: GC before cloning Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 (ElideObject(obj)) {
102 return SerializeObject(*isolate()->factory()->undefined_value(),
103 how_to_code, where_to_point, skip);
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
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
OLDNEW
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698