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

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

Issue 2418483002: [wasm] test deserialization when header is invalid (Closed)
Patch Set: test method to alter header Created 4 years, 2 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 | « no previous file | src/snapshot/code-serializer.cc » ('j') | src/snapshot/code-serializer.cc » ('J')
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 #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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 // Return ScriptData object and relinquish ownership over it to the caller. 107 // Return ScriptData object and relinquish ownership over it to the caller.
108 ScriptData* GetScriptData(); 108 ScriptData* GetScriptData();
109 109
110 Vector<const Reservation> Reservations() const; 110 Vector<const Reservation> Reservations() const;
111 Vector<const byte> Payload() const; 111 Vector<const byte> Payload() const;
112 112
113 Vector<const uint32_t> CodeStubKeys() const; 113 Vector<const uint32_t> CodeStubKeys() const;
114 114
115 static uint32_t SourceHash(Handle<String> source); 115 static uint32_t SourceHash(Handle<String> source);
116 static void InvalidateVersionForTest(byte* buffer, size_t buffer_size);
116 117
117 private: 118 private:
118 explicit SerializedCodeData(ScriptData* data); 119 explicit SerializedCodeData(ScriptData* data);
119 SerializedCodeData(const byte* data, int size) 120 SerializedCodeData(const byte* data, int size)
120 : SerializedData(const_cast<byte*>(data), size) {} 121 : SerializedData(const_cast<byte*>(data), size) {}
121 122
122 Vector<const byte> DataWithoutHeader() const { 123 Vector<const byte> DataWithoutHeader() const {
123 return Vector<const byte>(data_ + kHeaderSize, size_ - kHeaderSize); 124 return Vector<const byte>(data_ + kHeaderSize, size_ - kHeaderSize);
124 } 125 }
125 126
(...skipping 22 matching lines...) Expand all
148 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; 149 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size;
149 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; 150 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size;
150 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; 151 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size;
151 static const int kHeaderSize = kChecksum2Offset + kInt32Size; 152 static const int kHeaderSize = kChecksum2Offset + kInt32Size;
152 }; 153 };
153 154
154 } // namespace internal 155 } // namespace internal
155 } // namespace v8 156 } // namespace v8
156 157
157 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_ 158 #endif // V8_SNAPSHOT_CODE_SERIALIZER_H_
OLDNEW
« no previous file with comments | « no previous file | src/snapshot/code-serializer.cc » ('j') | src/snapshot/code-serializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698