| 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 #ifndef V8_SNAPSHOT_CODE_SERIALIZER_H_ | 5 #ifndef V8_SNAPSHOT_CODE_SERIALIZER_H_ |
| 6 #define V8_SNAPSHOT_CODE_SERIALIZER_H_ | 6 #define V8_SNAPSHOT_CODE_SERIALIZER_H_ |
| 7 | 7 |
| 8 #include "src/parsing/preparse-data.h" | 8 #include "src/parsing/preparse-data.h" |
| 9 #include "src/snapshot/serializer.h" | 9 #include "src/snapshot/serializer.h" |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 WhereToPoint where_to_point) override { | 67 WhereToPoint where_to_point) override { |
| 68 Code::Kind kind = code_object->kind(); | 68 Code::Kind kind = code_object->kind(); |
| 69 if (kind == Code::WASM_FUNCTION || kind == Code::WASM_TO_JS_FUNCTION || | 69 if (kind == Code::WASM_FUNCTION || kind == Code::WASM_TO_JS_FUNCTION || |
| 70 kind == Code::JS_TO_WASM_FUNCTION) { | 70 kind == Code::JS_TO_WASM_FUNCTION) { |
| 71 SerializeGeneric(code_object, how_to_code, where_to_point); | 71 SerializeGeneric(code_object, how_to_code, where_to_point); |
| 72 } else { | 72 } else { |
| 73 UNREACHABLE(); | 73 UNREACHABLE(); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool ElideObject(Object* obj) override { return obj->IsWeakCell(); }; | 77 bool ElideObject(Object* obj) override { |
| 78 return obj->IsWeakCell() || obj->IsForeign(); |
| 79 }; |
| 78 | 80 |
| 79 private: | 81 private: |
| 80 WasmCompiledModuleSerializer(Isolate* isolate, uint32_t source_hash) | 82 WasmCompiledModuleSerializer(Isolate* isolate, uint32_t source_hash) |
| 81 : CodeSerializer(isolate, source_hash) {} | 83 : CodeSerializer(isolate, source_hash) {} |
| 82 DISALLOW_COPY_AND_ASSIGN(WasmCompiledModuleSerializer); | 84 DISALLOW_COPY_AND_ASSIGN(WasmCompiledModuleSerializer); |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 // Wrapper around ScriptData to provide code-serializer-specific functionality. | 87 // Wrapper around ScriptData to provide code-serializer-specific functionality. |
| 86 class SerializedCodeData : public SerializedData { | 88 class SerializedCodeData : public SerializedData { |
| 87 public: | 89 public: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 150 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
| 149 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 151 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
| 150 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 152 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
| 151 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 153 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 } // namespace internal | 156 } // namespace internal |
| 155 } // namespace v8 | 157 } // namespace v8 |
| 156 | 158 |
| 157 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ | 159 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ |
| OLD | NEW |