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

Unified Diff: src/snapshot/startup-serializer.cc

Issue 2046423002: [snapshot] introduce SnapshotCreator API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/snapshot/startup-serializer.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/startup-serializer.cc
diff --git a/src/snapshot/startup-serializer.cc b/src/snapshot/startup-serializer.cc
index c71c16b1fdbae8b4eb60fc93fc48f145a596e763..9a38ceb2be32f881639f2787249431ccc6689054 100644
--- a/src/snapshot/startup-serializer.cc
+++ b/src/snapshot/startup-serializer.cc
@@ -12,9 +12,10 @@ namespace internal {
StartupSerializer::StartupSerializer(
Isolate* isolate, SnapshotByteSink* sink,
- FunctionCodeHandling function_code_handling)
+ v8::SnapshotCreator::FunctionCodeHandling function_code_handling)
: Serializer(isolate, sink),
- function_code_handling_(function_code_handling),
+ clear_function_code_(function_code_handling ==
+ v8::SnapshotCreator::FunctionCodeHandling::kClear),
serializing_builtins_(false) {
InitializeCodeAddressMap();
}
@@ -27,7 +28,7 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
DCHECK(!obj->IsJSFunction());
- if (function_code_handling_ == CLEAR_FUNCTION_CODE) {
+ if (clear_function_code_) {
if (obj->IsCode()) {
Code* code = Code::cast(obj);
// If the function code is compiled (either as native code or bytecode),
@@ -42,7 +43,6 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
obj = isolate()->heap()->undefined_value();
}
} else if (obj->IsCode()) {
- DCHECK_EQ(KEEP_FUNCTION_CODE, function_code_handling_);
Code* code = Code::cast(obj);
if (code->kind() == Code::FUNCTION) {
code->ClearInlineCaches();
« no previous file with comments | « src/snapshot/startup-serializer.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698