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

Unified Diff: src/value-serializer.h

Issue 2748473004: [wasm] Transferrable modules (Closed)
Patch Set: compile error Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/value-serializer.h
diff --git a/src/value-serializer.h b/src/value-serializer.h
index 7961b2ea0b6a78375b8975945fa740cc3de8b06d..47f8a84ef80c6551839004e8a1fab20703fa5727 100644
--- a/src/value-serializer.h
+++ b/src/value-serializer.h
@@ -31,6 +31,7 @@ class JSValue;
class Object;
class Oddball;
class Smi;
+class WasmModuleObject;
enum class SerializationTag : uint8_t;
@@ -211,6 +212,13 @@ class ValueDeserializer {
Handle<JSArrayBuffer> array_buffer);
/*
+ * Accepts the WasmModuleObject corresponding to the one having transfer_id
+ * produced by v8::ValueSerializer::GetWasmCompiledModuleId().
+ * See issue v8:6106.
+ */
+ void TransferWasmModule(uint32_t transfer_id,
+ Handle<WasmModuleObject> module);
+ /*
* Publicly exposed wire format writing methods.
* These are intended for use within the delegate's WriteHostObject method.
*/
@@ -218,6 +226,9 @@ class ValueDeserializer {
bool ReadUint64(uint64_t* value) WARN_UNUSED_RESULT;
bool ReadDouble(double* value) WARN_UNUSED_RESULT;
bool ReadRawBytes(size_t length, const void** data) WARN_UNUSED_RESULT;
+ void set_allow_inline_wasm(bool allow_inline_wasm) {
+ allow_inline_wasm_ = allow_inline_wasm;
+ }
private:
// Reading the wire format.
@@ -230,6 +241,7 @@ class ValueDeserializer {
Maybe<T> ReadZigZag() WARN_UNUSED_RESULT;
Maybe<double> ReadDouble() WARN_UNUSED_RESULT;
Maybe<Vector<const uint8_t>> ReadRawBytes(int size) WARN_UNUSED_RESULT;
+ bool allow_inline_wasm() const { return allow_inline_wasm_; }
// Reads a string if it matches the one provided.
// Returns true if this was the case. Otherwise, nothing is consumed.
@@ -263,6 +275,7 @@ class ValueDeserializer {
MaybeHandle<JSArrayBufferView> ReadJSArrayBufferView(
Handle<JSArrayBuffer> buffer) WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadWasmModule() WARN_UNUSED_RESULT;
+ MaybeHandle<JSObject> ReadWasmModuleTransfer() WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadHostObject() WARN_UNUSED_RESULT;
/*
@@ -285,10 +298,12 @@ class ValueDeserializer {
PretenureFlag pretenure_;
uint32_t version_ = 0;
uint32_t next_id_ = 0;
+ bool allow_inline_wasm_ = false;
// Always global handles.
Handle<FixedArray> id_map_;
MaybeHandle<SeededNumberDictionary> array_buffer_transfer_map_;
+ std::vector<Handle<WasmModuleObject>> transferred_wasm_modules_;
jbroman 2017/03/17 14:44:37 Hmm. This seems to require that the handles remain
Mircea Trofin 2017/03/17 16:55:31 As discussed offline - this alternative appears to
DISALLOW_COPY_AND_ASSIGN(ValueDeserializer);
};
« no previous file with comments | « src/api.cc ('k') | src/value-serializer.cc » ('j') | test/unittests/value-serializer-unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698