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_VALUE_SERIALIZER_H_ | 5 #ifndef V8_VALUE_SERIALIZER_H_ |
6 #define V8_VALUE_SERIALIZER_H_ | 6 #define V8_VALUE_SERIALIZER_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void WriteRawBytes(const void* source, size_t length); | 82 void WriteRawBytes(const void* source, size_t length); |
83 uint8_t* ReserveRawBytes(size_t bytes); | 83 uint8_t* ReserveRawBytes(size_t bytes); |
84 | 84 |
85 // Writing V8 objects of various kinds. | 85 // Writing V8 objects of various kinds. |
86 void WriteOddball(Oddball* oddball); | 86 void WriteOddball(Oddball* oddball); |
87 void WriteSmi(Smi* smi); | 87 void WriteSmi(Smi* smi); |
88 void WriteHeapNumber(HeapNumber* number); | 88 void WriteHeapNumber(HeapNumber* number); |
89 void WriteString(Handle<String> string); | 89 void WriteString(Handle<String> string); |
90 Maybe<bool> WriteJSReceiver(Handle<JSReceiver> receiver) WARN_UNUSED_RESULT; | 90 Maybe<bool> WriteJSReceiver(Handle<JSReceiver> receiver) WARN_UNUSED_RESULT; |
91 Maybe<bool> WriteJSObject(Handle<JSObject> object) WARN_UNUSED_RESULT; | 91 Maybe<bool> WriteJSObject(Handle<JSObject> object) WARN_UNUSED_RESULT; |
| 92 Maybe<bool> WriteJSObjectSlow(Handle<JSObject> object) WARN_UNUSED_RESULT; |
92 Maybe<bool> WriteJSArray(Handle<JSArray> array) WARN_UNUSED_RESULT; | 93 Maybe<bool> WriteJSArray(Handle<JSArray> array) WARN_UNUSED_RESULT; |
93 void WriteJSDate(JSDate* date); | 94 void WriteJSDate(JSDate* date); |
94 Maybe<bool> WriteJSValue(Handle<JSValue> value) WARN_UNUSED_RESULT; | 95 Maybe<bool> WriteJSValue(Handle<JSValue> value) WARN_UNUSED_RESULT; |
95 void WriteJSRegExp(JSRegExp* regexp); | 96 void WriteJSRegExp(JSRegExp* regexp); |
96 Maybe<bool> WriteJSMap(Handle<JSMap> map) WARN_UNUSED_RESULT; | 97 Maybe<bool> WriteJSMap(Handle<JSMap> map) WARN_UNUSED_RESULT; |
97 Maybe<bool> WriteJSSet(Handle<JSSet> map) WARN_UNUSED_RESULT; | 98 Maybe<bool> WriteJSSet(Handle<JSSet> map) WARN_UNUSED_RESULT; |
98 Maybe<bool> WriteJSArrayBuffer(JSArrayBuffer* array_buffer); | 99 Maybe<bool> WriteJSArrayBuffer(JSArrayBuffer* array_buffer); |
99 Maybe<bool> WriteJSArrayBufferView(JSArrayBufferView* array_buffer); | 100 Maybe<bool> WriteJSArrayBufferView(JSArrayBufferView* array_buffer); |
100 | 101 |
101 /* | 102 /* |
102 * Reads the specified keys from the object and writes key-value pairs to the | 103 * Reads the specified keys from the object and writes key-value pairs to the |
103 * buffer. Returns the number of keys actually written, which may be smaller | 104 * buffer. Returns the number of keys actually written, which may be smaller |
104 * if some keys are not own properties when accessed. | 105 * if some keys are not own properties when accessed. |
105 */ | 106 */ |
106 Maybe<uint32_t> WriteJSObjectProperties( | 107 Maybe<uint32_t> WriteJSObjectPropertiesSlow( |
107 Handle<JSObject> object, Handle<FixedArray> keys) WARN_UNUSED_RESULT; | 108 Handle<JSObject> object, Handle<FixedArray> keys) WARN_UNUSED_RESULT; |
108 | 109 |
109 /* | 110 /* |
110 * Asks the delegate to handle an error that occurred during data cloning, by | 111 * Asks the delegate to handle an error that occurred during data cloning, by |
111 * throwing an exception appropriate for the host. | 112 * throwing an exception appropriate for the host. |
112 */ | 113 */ |
113 void ThrowDataCloneError(MessageTemplate::Template template_index); | 114 void ThrowDataCloneError(MessageTemplate::Template template_index); |
114 V8_NOINLINE void ThrowDataCloneError(MessageTemplate::Template template_index, | 115 V8_NOINLINE void ThrowDataCloneError(MessageTemplate::Template template_index, |
115 Handle<Object> arg0); | 116 Handle<Object> arg0); |
116 | 117 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 Handle<SeededNumberDictionary> id_map_; | 231 Handle<SeededNumberDictionary> id_map_; |
231 MaybeHandle<SeededNumberDictionary> array_buffer_transfer_map_; | 232 MaybeHandle<SeededNumberDictionary> array_buffer_transfer_map_; |
232 | 233 |
233 DISALLOW_COPY_AND_ASSIGN(ValueDeserializer); | 234 DISALLOW_COPY_AND_ASSIGN(ValueDeserializer); |
234 }; | 235 }; |
235 | 236 |
236 } // namespace internal | 237 } // namespace internal |
237 } // namespace v8 | 238 } // namespace v8 |
238 | 239 |
239 #endif // V8_VALUE_SERIALIZER_H_ | 240 #endif // V8_VALUE_SERIALIZER_H_ |
OLD | NEW |