File tree 7 files changed +29
-14
lines changed
7 files changed +29
-14
lines changed Original file line number Diff line number Diff line change @@ -1019,6 +1019,7 @@ v8_header_set("v8_version") {
1019
1019
configs = [ " :internal_config" ]
1020
1020
1021
1021
sources = [
1022
+ " include/v8-value-serializer-version.h" ,
1022
1023
" include/v8-version-string.h" ,
1023
1024
" include/v8-version.h" ,
1024
1025
]
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ /* *
6
+ * Compile-time constants.
7
+ *
8
+ * This header provides access to information about the value serializer at
9
+ * compile time, without declaring or defining any symbols that require linking
10
+ * to V8.
11
+ */
12
+
13
+ #ifndef INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_
14
+ #define INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_
15
+
16
+ #include < stdint.h>
17
+
18
+ namespace v8 {
19
+
20
+ constexpr uint32_t CurrentValueSerializerFormatVersion () { return 13 ; }
21
+
22
+ } // namespace v8
23
+
24
+ #endif // INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_
Original file line number Diff line number Diff line change @@ -1789,8 +1789,6 @@ class V8_EXPORT ValueSerializer {
1789
1789
virtual void FreeBufferMemory(void* buffer);
1790
1790
};
1791
1791
1792
- static uint32_t GetCurrentDataFormatVersion();
1793
-
1794
1792
explicit ValueSerializer(Isolate* isolate);
1795
1793
ValueSerializer(Isolate* isolate, Delegate* delegate);
1796
1794
~ValueSerializer();
Original file line number Diff line number Diff line change @@ -3225,11 +3225,6 @@ struct ValueSerializer::PrivateData {
3225
3225
i::ValueSerializer serializer;
3226
3226
};
3227
3227
3228
- // static
3229
- uint32_t ValueSerializer::GetCurrentDataFormatVersion () {
3230
- return i::ValueSerializer::GetCurrentDataFormatVersion ();
3231
- }
3232
-
3233
3228
ValueSerializer::ValueSerializer (Isolate* isolate)
3234
3229
: ValueSerializer(isolate, nullptr ) {}
3235
3230
Original file line number Diff line number Diff line change 389
389
'../include/v8-profiler.h' ,
390
390
'../include/v8-testing.h' ,
391
391
'../include/v8-util.h' ,
392
+ '../include/v8-value-serializer-version.h' ,
392
393
'../include/v8-version-string.h' ,
393
394
'../include/v8-version.h' ,
394
395
'../include/v8.h' ,
Original file line number Diff line number Diff line change 6
6
7
7
#include < type_traits>
8
8
9
+ #include " include/v8-value-serializer-version.h"
9
10
#include " src/base/logging.h"
10
11
#include " src/conversions.h"
11
12
#include " src/factory.h"
@@ -30,6 +31,8 @@ namespace internal {
30
31
// Version 13: host objects have an explicit tag (rather than handling all
31
32
// unknown tags)
32
33
static const uint32_t kLatestVersion = 13 ;
34
+ static_assert (kLatestVersion == v8::CurrentValueSerializerFormatVersion(),
35
+ " Exported format version must match latest version." );
33
36
34
37
static const int kPretenureThreshold = 100 * KB;
35
38
@@ -154,11 +157,6 @@ enum class WasmEncodingTag : uint8_t {
154
157
155
158
} // namespace
156
159
157
- // static
158
- uint32_t ValueSerializer::GetCurrentDataFormatVersion () {
159
- return kLatestVersion ;
160
- }
161
-
162
160
ValueSerializer::ValueSerializer (Isolate* isolate,
163
161
v8::ValueSerializer::Delegate* delegate)
164
162
: isolate_(isolate),
Original file line number Diff line number Diff line change @@ -43,8 +43,6 @@ enum class SerializationTag : uint8_t;
43
43
*/
44
44
class ValueSerializer {
45
45
public:
46
- static uint32_t GetCurrentDataFormatVersion ();
47
-
48
46
ValueSerializer (Isolate* isolate, v8::ValueSerializer::Delegate* delegate);
49
47
~ValueSerializer ();
50
48
You can’t perform that action at this time.
0 commit comments