| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ObjectSerializer serializer(this, heap_object, &sink_, how_to_code, | 117 ObjectSerializer serializer(this, heap_object, &sink_, how_to_code, |
| 118 where_to_point); | 118 where_to_point); |
| 119 serializer.Serialize(); | 119 serializer.Serialize(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void CodeSerializer::SerializeBuiltin(int builtin_index, HowToCode how_to_code, | 122 void CodeSerializer::SerializeBuiltin(int builtin_index, HowToCode how_to_code, |
| 123 WhereToPoint where_to_point) { | 123 WhereToPoint where_to_point) { |
| 124 DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || | 124 DCHECK((how_to_code == kPlain && where_to_point == kStartOfObject) || |
| 125 (how_to_code == kPlain && where_to_point == kInnerPointer) || | 125 (how_to_code == kPlain && where_to_point == kInnerPointer) || |
| 126 (how_to_code == kFromCode && where_to_point == kInnerPointer)); | 126 (how_to_code == kFromCode && where_to_point == kInnerPointer)); |
| 127 DCHECK_LT(builtin_index, Builtins::builtin_count); | 127 DCHECK_LT(builtin_index, Builtins::BUILTIN_COUNT); |
| 128 DCHECK_LE(0, builtin_index); | 128 DCHECK_LE(0, builtin_index); |
| 129 | 129 |
| 130 if (FLAG_trace_serializer) { | 130 if (FLAG_trace_serializer) { |
| 131 PrintF(" Encoding builtin: %s\n", | 131 PrintF(" Encoding builtin: %s\n", |
| 132 isolate()->builtins()->name(builtin_index)); | 132 isolate()->builtins()->name(builtin_index)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 sink_.Put(kBuiltin + how_to_code + where_to_point, "Builtin"); | 135 sink_.Put(kBuiltin + how_to_code + where_to_point, "Builtin"); |
| 136 sink_.PutInt(builtin_index, "builtin_index"); | 136 sink_.PutInt(builtin_index, "builtin_index"); |
| 137 } | 137 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); | 405 *rejection_result = scd.SanityCheck(isolate, expected_source_hash); |
| 406 if (*rejection_result != CHECK_SUCCESS) { | 406 if (*rejection_result != CHECK_SUCCESS) { |
| 407 cached_data->Reject(); | 407 cached_data->Reject(); |
| 408 return SerializedCodeData(nullptr, 0); | 408 return SerializedCodeData(nullptr, 0); |
| 409 } | 409 } |
| 410 return scd; | 410 return scd; |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace internal | 413 } // namespace internal |
| 414 } // namespace v8 | 414 } // namespace v8 |
| OLD | NEW |